Pacetech
08-04-04, 10:29 PM
Ok, I have my application working well in a tight loop using CAN and serial - whole application is 1300 lines of code.
I am now ready to turn it into a state machine so that I can try to do more. I basically have one Isopod on the CAN Bus receiving values and storing them in an array. In that same loop, it is spitting formatted commands out the serial port using the data in the array. The serial port is set at 38400 Baud.
The loop is taking about 16ms to run.
I was wondering if it is possible to overflow the serial buffer? I have a 32 byte transmit buffer. If I hammer it with a bunch of bytes and start to overflow it, will it delay until the buffer is not full?
Another way to ask the question, is my serial transmit wasting processor time? I'm not looking to transmit faster, but if I can regain any wasted clock cycles by going to a state machine, then I'll make the effort.
I am now ready to turn it into a state machine so that I can try to do more. I basically have one Isopod on the CAN Bus receiving values and storing them in an array. In that same loop, it is spitting formatted commands out the serial port using the data in the array. The serial port is set at 38400 Baud.
The loop is taking about 16ms to run.
I was wondering if it is possible to overflow the serial buffer? I have a 32 byte transmit buffer. If I hammer it with a bunch of bytes and start to overflow it, will it delay until the buffer is not full?
Another way to ask the question, is my serial transmit wasting processor time? I'm not looking to transmit faster, but if I can regain any wasted clock cycles by going to a state machine, then I'll make the effort.