Other Parts Discussed in Thread: MOTORWARE, C2000WARE,
Hello,
I am using a custom board (derived heavily from the DRV8301-HC-EVM evaluation board) to implement InstaSpin FOC for motor control. I have an LCD module that is sending messages to the motor control board (MCB). There are 2 types of messages: 1 is a "GET," which requests data from the MCB, the other is a "SET," which sends new values for various parameters to the MCB, in response to user input. I am successfully controlling the motor now, and want to be able to communicate with the control board in the manner described above, using the SLIP protocol. If there are no substitutions in the message from the LCD (sometimes required so that control characters are not mistaken for data), then the GET message is 12 bytes, and the SET message is 33 bytes.
These messages from the LCD are being transmitted every 500ms at 115.2kBAUD. Let's assume the message is 12 bytes (the smaller one) - that would take 833us to complete. It's really closer to 1ms, when you consider start & stop bits, etc... I'm using Lab 05b, from the InstaSpin Labs as a template for motor control. I've added routines native to MotorWare to handle the serial communications. The motor I'm using is of relatively low inductance (60uH), so I've been using 45kHz as the PWM Frequency. I can lower it to 30kHz, without any immediately obvious adverse effects, but lowering it to 20kHz results in some awful cogging, and a screeching sound. I'm decimating that by a factor of three to derive the ISR frequency. This means that the main interrupt fires at 15 kHz. This allows 66us between interrupts, in order to control the motor with InstaSpin. This doesn't even allow time to pick up a single byte. Even if it did, there's no guarantee that contiguous bytes would have the courtesy to arrive at the Rx input of the micro between interrupts.
I can receive messages successfully, if the interrupts are not present. So, I have the two halves of this project working independently, but they cannot, so far, work together. I've looked into using DMA to disentangle comm from control, but evidently there is no path from SCI to DMA, even though "Multichannel buffered serial port transmit and receive" is listed as one of the "Peripheral interrupt trigger sources" in the TMS320 Technical Reference document (pg. 720). How can I successfully implement serial communications with the LCD module, if the interrupts keep interrupting it, and I can't use DMA?
Here's a screen capture from an oscilloscope showing what's going on. I put a "toggle GPIO" statement at the beginning and end of the main ISR. That's the yellow trace. The blue trace is the serial message from the LCD module.
Best Regards,
Dave Reagan