Hi All, I want to daisy chain 256 controllers serially. TX0--->RX1|TX1--->RX2|TX2...->RX255|TX255--->RXPC Each controller has to send a packet of 8bytes to the next controller plus all the data that it has received from the previous controllers. The last controller is connected to a PC serial port where all the data is captured. Can anyone throw some ideas how to go about writing this code ?? Any help will be great. Thankzz && Bye -Rocknmoon
Any sample code to implement a RX queue and a TX queue on a low end controller would be great.
I suggest that you look at: http://www.keil.com/forum/docs/thread1352.asp You will probably find other sources on the W.W.W. As your packets are of fixed length, you don't need a start and end marker. If you can, use ASCII for your communications and perhaps choose line feed and carriage return for your start and end markers respectively. ASCII may seem inefficient, but it can make debugging a lot easier! I suggest that your design should try to avoid using delay timers in the way that you suggest. Use timers to collect your data in real time and on time, but buffer everything else and receive/transmit when you must/can. Good luck.
Keil interrupt-driver serial IO example also has ring buffers. See the downloads area.
If you take CAN as back-bone for data exchange and 1 CAN to RS232 BRIDGE interface, you should be able to connect just anything to anything without breaking your mind for timing and speed .... And to make things a little bit cheaper, you could perhaps convert all RS232 to RS485 and interface this to your PC.