Other Parts Discussed in Thread: MOTORWARE
Hi,
I am trying to interface with a RS-422 UART based absolute encoder in the sensored InstaSPIN project. The encoder sends a packet of 8 bytes, which contains 3 byte absolute position data and other status and configuration bits.
I based my code on examples provided here. However, I found many issues, such as missing functions in pie and sci headers. E.g, PIE_registerPieIntHandler, PIE_enableInt, SCI_setRxFifoIntLevel. I defined those functions based on the C2000_LaunchPad libraries. Here is the rest of my code: 7242.enc_comm.zip This is my interrupt service routine:
interrupt void sciaRxFifoIsr(void)
{
ENC_COMM_updatePosition(encCommHandle);
// Clear Overflow flag
SCI_clearRxFifoOvf(ENC_COMM_getSciHandle(encCommHandle));
// Clear Interrupt flag
SCI_clearRxFifoInt(ENC_COMM_getSciHandle(encCommHandle));
// Issue PIE acknowledgment
PIE_clearInt(DRV_getPieHandle(drvHandle), PIE_GroupNumber_9);
return;
}
I am able to send commands to the encoder to start and stop transmission and it seems to respond well. However, I am not able to read the received data properly. I was assuming that the word size in F28069M is 16 bits, so a 4 word fifo interrupt would let me receive the 8 byte data. But, the received data in the buffer seems to be of 8 bits. The interrupt doesn't seem to be firing at the correct time. Is there something that I am missing? Will I have to configure the module differently to achieve what I am trying to achieve?
I would really appreciate any help.
Thanks,
Tamil