This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Adding serial comm to InstaSpin

Part Number: TMS320F28069M
Other Parts Discussed in Thread: DRV8301,

Hello,

I'm trying to add serial communications to an InstaSpin Lab (currently using Lab06a). This is a custom board, based on the DRV8301 EVM board. I would like to control the motor drive board, using an LCD.

I'm using the SLIP protocol, at 115.2 kBAUD, 8 bits, 1 STOP bit, no parity. I have it set up in the main loop, just polling the Rx port. When the motor control board receives a message from the LCD, it responds in kind.

This scheme worked in isolation (project was communication only), but I keep getting a "framing error", after incorporating it into the InstaSpin Lab. Apparently the TMS320F28069M  is missing the STOP bit.

The STOP bit is indeed being sent (I had this working without InstaSpin involved). I suspect that an interrupt is cutting off reception.

I tried toggling a GPIO when the Main ISR starts and finishes, and found that the time spent in the interrupt is around 55us, followed by a 1.2 us idle time, not in the interrupt.

How am I supposed to fit anything in, if the Main ISR consumes so much time? The time to receive one byte is 69.4us at 115.2 kBAUD. Maybe I'm interpreting this wrong?

Thanks,

Dave

  • You may try to use a lower PWM and control frequency for motor control and use a low baud rate and FIFO for SCI if possible. And also reduce the SCI ISR execution time if used any SCI interrupt.

  • Hi Yanming,

    I have a low inductance motor (60uH), so I don't think I can lower the PWM frequency (60 kHz) or the control frequency (20 kHz is, I believe, the lowest we can have for that PWM frequency). The fact that it's missing the STOP bit bothers me. It's not even getting through an entire byte. Would 2 STOP bits help? I looked around in this forum and couldn't find much on this topic.Are there previous posts that you could direct me to where somebody had this problem and solved it?

    I'm not currently using an interrupt for the serial comm. I've just put it in the main loop and check RXFFST for data available in the FIFO. It seems like a lower BAUD rate would just make things worse, since each bit would take longer to get in and get evaluated. If I used an interrupt for at least Rx, and gave it a higher priority than the mainISR, would that really screw up the motor control?

    Thanks,

    Dave

  • I tried toggling a GPIO when the Main ISR starts and finishes, and found that the time spent in the interrupt is around 55us, followed by a 1.2 us idle time, not in the interrupt.

    Any other code you added in ISR? Seems like the execution is too long in the ISR with 20kHz frequency. The normal execution time of the InstaSPIN-FOC/MOTION in ISR should be less than 25us/30us. Don't add a lot of codes in ISR to reserve more CPU bandwidth for background loop.

  • Just wanted to check in and see if there is any update from your side, I haven’t heard from you for 4 weeks, so I’m assuming you were able to resolve your issue. Please let me know if you have any questions. We would like to close this thread if no any further questions. Thanks.