AM243x Motor Control SDK  09.02.00
NIKON Diagnostic

Nikon diagnostic application does the following:

  • Configures pinmux, GPIO, UART, ICSS clock to 200MHz,
  • Initializes ICSS0-PRU1,
  • Initializes default parameters, loads the PRU firmware & executes it.

This application is controlled with a terminal interface using a serial over USB connection between the PC host and the EVM. Please connect a USB cable between the PC and the EVM/LP. A serial terminal application (like teraterm/ hyperterminal/ minicom) is then run on the host. To configure, select the serial port corresponding to the port emulated over USB by the EVM. The host serial port should be configured to 115200 baud, no parity, 1 stop bit and no flow control.

The Nikon receiver firmware running on ICSS0-PRU1 provides a defined interface. The Nikon diagnostic application interacts with the Nikon receiver firmware interface. It then presents the user with menu options to select different commands. The application collects the data entered by the user and configures the relevant interface. Then via the Nikon receiver interface, the command is triggered. Once the command completion is indicated by the interface, the status of the transaction is checked. If the Status indicates success, the result is presented to the user.

Channel Selection In Sysconfig

Channel Selection In Sysconfig
Nikon configuration selection between Single/Multi channel

Important files and directory structure

Folder/Files Description
${SDK_INSTALL_PATH}/examples/position_sense/nikon_diagnostic
nikon_diagnostic.c Nikon diagnostic application
${SDK_INSTALL_PATH}/source/position_sense/nikon
firmware/ Folder containing Nikon PRU firmware sources.
driver/ Nikon diagnostic driver.

Supported Combinations

Parameter Value
CPU + OS r5fss0-0 freertos
ICSSG ICSSG0
PRU PRU1 (single channel, multi channel using single PRU)
PRU1, RTU-PRU1, TXPRU1 (multi channel using three PRUs - load share mode)
Toolchain ti-arm-clang
Board am243x-lp (2 channel and 1 channel examples)
Example folder examples/position_sense/nikon_diagnostic

Steps to Run the Example

Hardware Prerequisites

Hardware Setup

Hardware Setup(Using Booster Pack & AM243x-LP)

Hardware Setup of Booster Pack + LP for Nikon

Booster Pack Jumper Configuration

Designator ON/OFF Description
J11 OFF VSENSE/ISENSE select
J13 OFF VSENSE/ISENSE select
J17 Pin 1-2 Connected SDFM Clock Feedback Select
J18/J19 J19 installed: sets VSENSOR1 to 5.0V Axis 1: Encoder/Resolver Voltage Select
J20/J21 J21 installed: sets VSENSOR2 to 5.0V Axis 2: Encoder/Resolver Voltage Select
J22 OFF Axis 1: Manchester Encoding Select
J23 OFF Axis 2: Manchester Encoding Select
J24 OFF Axis 1: RS485/DSL MUX
J25 OFF Axis 2: RS485/DSL MUX
J26 OFF VSENSE/ISENSE Select
J27 ON 3WIRE/SDFM MUX
J28 OFF 3WIRE MUX

Build, load and run

  • When using CCS projects to build, import the CCS project and build it using the CCS project menu (see Using SDK with CCS Projects ).
  • When using makefiles to build, note the required combination and build using make command (see Using SDK with Makefiles )
  • Launch a CCS debug session and run the executable, see CCS Launch, Load and Run
  • Refer to UART terminal for user interface menu options.

Sample Output

Shown below is a sample output when the application is run:

Nikon Sample Output

Test Case Description

CMD_ID CMD Description Pass/fail Criteria
0 ABS full 40 bit data request In this command we will receive: Absolute 40 bit data for Single encoder with status information. CRC success with Rotor angle, num rotations and CRC values printed in the terminal.
1 ABS lower 24bit data request In this command we will receive: Absolute lower 24 bit data for Single encoder with status information. CRC success with Rotor angle, num rotations and CRC values printed in the terminal.
2 ABS upper 24bit data request In this command we will receive: Absolute upper 24 bit data for Single encoder with status information. CRC success with Rotor angle, num rotations and CRC values printed in the terminal.
3 Encoder status Request In this command we will receive: Encoder will send status information, Alarm bits and additional information. Alarm bits, Encoder status bits printed in the terminal along with CRC success.
4 ABS full 40 bit data request(MT) In this command we will receive: Absolute 40 bit data for Multiple encoders connected in bus with status information. CRC success with Rotor angle, num rotations and CRC values printed in the terminal.
5 ABS lower 24bit data request(MT) In this command we will receive: Absolute lower 24 bit data for Multiple encoders connected in bus with status information. CRC success with Rotor angle, num rotations and CRC values printed in the terminal.
6 ABS upper 24bit data request(MT) In this command we will receive: Absolute upper 24 bit data for Multiple encoders connected in bus with status information. CRC success with Rotor angle, num rotations and CRC values printed in the terminal.
7 Encoder status Request(MT) In this command we will receive: Encoder will send status information, Alarm bits and additional information for all encoders connected in bus. Alarm bits, Encoder status bits printed in the terminal along with CRC success.
8 Status flag clear request In this command we will receive: Encoder will send status information, Alarm bits and additional information after clearing the status flags. Alarm bits, Encoder status bits printed in the terminal along with CRC success.
9 Multiple turn data clear request In this command we will receive: Encoder will send status information, Alarm bits and additional information after clearing the Multiple turn data bits. Alarm bits, Encoder status bits printed in the terminal along with CRC success.
10 Status+ Multiple turn data clear request In this command we will receive: Encoder will send status information, Alarm bits and additional information after clearing the Status and Multiple turn data bits. Alarm bits, Encoder status bits printed in the terminal along with CRC success.
11 Encoder address setting I (one-to-one connection) In this command we will receive: Encoder address setting will be performed and status will be returned with ALM bits. Alarm bits, Encoder status bits printed in the terminal along with CRC success.
12 Single turn data zero preset In this command we will receive: Encoder will set single turn data bits to zero and returns status bits along with ALM bits. Alarm bits, Encoder status bits printed in the terminal along with CRC success.
13 EEPROM read request In this command we will receive: Encoder will send EEPROM register data along with the requested address information. Received data CRC should match with calculated CRC and CRC success printed in the terminal.
14 EEPROM write request In this command we will receive: Encoder will perform EEPROM register write the data specified by user in the specified address. Received data CRC should match with calculated CRC and CRC success printed in the terminal.
15 Temperature data request In this command we will receive: Encoder will send temperature information along with status. Encoder Temperature and status bits printed in the terminal along with CRC success.
16 Identification code read I In this command we will receive: Encoder will send identification code. Encoder identification code will be printed in the terminal along with CRC success.
17 Identification code read II(one-to-one connection) In this command we will receive: Encoder will send identification code irrespective of encoder address. Encoder identification code will be printed in the terminal along with CRC success.
18 Identification code write I In this command we will receive: Encoder will update identification code provide by user in its local register. Encoder identification code will be printed in the terminal along with CRC success.
19 Identification code write II(one-to-one connection) In this command we will receive: Encoder will update identification code provide by user in its local register irrespective of encoder address. Encoder identification code will be printed in the terminal along with CRC success.
20 Encoder address setting II In this command we will receive: Encoder will update its own address field based on identification code provide by user. Encoder identification code and updated address will be printed in the terminal along with CRC success.
21 ABS lower 17bit data request In this command we will receive: Absolute lower 17 bit data for Single encoder with status information. CRC success with Rotor angle, num rotations and CRC values printed in the terminal.
22 ABS lower 17bit data request(MT) In this command we will receive: Absolute lower 17 bit data for encoders connected in bus with status information. CRC success with Rotor angle, num rotations and CRC values printed in the terminal.
27 ABS lower 24bit + status request In this command we will receive: Absolute lower 24 bit data for Single encoder with status and alarm bits information. CRC success with Rotor angle, num rotations, alm and CRC values printed in the terminal.
28 ABS lower 24bit + status request(MT) In this command we will receive: Absolute lower 24 bit data for encoders connected in bus with status and alarm bits information. CRC success with Rotor angle, num rotations, alm and CRC values printed in the terminal.
29 ABS lower 24bit + Temperature data request In this command we will receive: Absolute lower 24 bit data for Single encoder with Temperature information. CRC success with Rotor angle, num rotations, Temperature and CRC values printed in the terminal.
30 ABS lower 24bit + Temperature data request(MT) In this command we will receive: Absolute lower 24 bit data for encoders connected in bus with Temperature information. CRC success with Rotor angle, num rotations, Temperature and CRC values printed in the terminal.
32 Start Continuous Mode In this command we will receive: Absolute lower 40 bit data for encoders connected in point to point / bus. CRC success with Rotor angle, num rotations and CRC stats printed in the terminal.