This page lists all the examples related to position sense.
This section provides a debugging guide for troubleshooting issues that may arise during testing or development.
The PRU_ICSSG_CFG registers from offset 0xE0 to 0x11C are allocated for encoder configuration. To review and verify the encoder settings:
Note: Ensure you are entering the correct base address for encoder registers. Each ICSS instance has a different address for the CFG register.
For detailed register descriptions, refer to: Section 6.4.14.5 PRU_ICSSG_CFG Registers in the AM243x Technical Reference Manual (TRM)
Key registers and their configurations:
The RS485 interface card, control card, and encoder should be connected to the correct PRU GPIO pins mapped for the Encoder interface Peripheral IF mode. All associated pins must be selected in SysConfig.
When using alternative pin options, the 'G_MUX_EN' bit of the 'ICSSG_SA_MX_REG' register must be set.
| Pin name | Jumper number | Function |
|---|---|---|
| PRG0_PRU1_GPO0 | J2.11 | Channel 0 clock |
| PRG0_PRU1_GPO1 | J7.67 | Channel 0 transmit |
| PRG0_PRU1_GPO2 | J7.68 | Channel 0 transmit enable |
| PRG0_PRU1_GPI13 | J8.71 | Channel 0 receive |
| GPIO1_78 Pin (J8.73) | ENC1_EN (J8.73) | Enable 3 channel peripheral interface in Axis 1 of BP (C16 GPIO pin) |
| PRG0_PRU1_GPO6 | J7.69 | Channel 2 clock |
| PRG0_PRU1_GPO12 | J8.72 | Channel 2 transmit |
| PRG0_PRU1_GPO8 | J6.57 | Channel 2 transmit enable |
| PRG0_PRU1_GPI11 | J7.70 | Channel 2 receive |
| GPIO1_77 Pin (J8.74) | ENC2_EN | Enable 3 channel peripheral interface in Axis 2 of BP (B17 GPIO pin) |
For PRU-related issues, verify that the application is loading the PRU firmware into the correct PRU core. If firmware loading fails:
Load Symbols
SDK examples uses IEP CMP event to trigger periodic mode. CMP0 is used to get periodic CMP events by resetting the IEP counter continuously. Firmware triggers a R5F interrupt after getting a response from the encoder. The application code uses a callback function to clear the PRU interrupt, which can be modified as per the use case. CMP3 is used for single channel and single PRU multi-channel mode. For multi-channel load share mode, CMP3 is used for RTU core, CMP5 is used for PRU core and CMP6 is used for TX PRU core channel. Refer the example specific page for details on how to modify the compare events.
When programming the values for CMP based trigger events, ensure that the command send and receive can complete within the cycle time (configured with CMP0). In multi-channel, ensure that command completion for timings for all channels are considered. Incorrect values may send PRU FW in bad state. Also, refer to encoder specifications to ensure that requirement for mimimum interval between two commands is met.
The Industrial Ethernet Peripheral (IEP) is used for periodic continuous mode. If the IEP is not configured correctly, periodic continuous mode will not work.
To verify IEP configuration:
IEP_COUNT_REG0/1 registersIEP_CMP_CFG_REG to ensure all compare events are properly configured for trigger modeIEP_CMP_STATUS_REG to verify that corresponding compare events are setting status flags correctlyNote: Ensure you are entering the correct address for IEP registers. Each ICSS instance has a different base address for the IEP registers.
For detailed register descriptions, refer to: Section 6.4.14.9 PRU_IEP_IEP Registers in the AM243x TRM
If you experience missing PRU interrupts or incorrect IRQ mapping, verify the interrupt mapping between PRU and R5F in the SysConfig PRU INTC module. The Host channel number and PRU Event should match your configuration.
For example, the EnDAT example uses:
18: pr0_pru_mst_intr[2]_intr_req
The interrupt service routine (ISR) configuration is implemented in endat_periodic_trigger.c. Here's a key code snippet showing the configuration:
The PRU event number is defined in endat_periodic_trigger.h: