by aurora » Tue Jan 11, 2011 11:07 pm
Wow... 4x UARTs..!!
How critical is your UARTs transmission? Are the data very important?
For my software UART, here is what I did:
1. write a single character (I use 0xFE, can be anything)
2. wait for string of character and save, and check for special acknowledge (single character, I use 0xFF, also can be anything)
3. Once the special acknowledge character is received, end the transmission
On the transmission end, I have RX interrupt enable. It will be doing whatever, and when it receive a character, an interrupt is called. Within the interrupt routine, I transmit my data, last character ends with 0xFF.
If your transmission end is not that critical, you can use the above example and get data from each UART one after another. After complete, transmit the data through USB to your host. Lastly, follow by whatever routine you wish to do.
Of course, this can only happen if you can sort of manipulate the transmission line, to start transmitting only after it receive a special character (0xFE, in my case) from the UART. By the way, it will limit the data transmission by a bit, since you cannot use the two special character in your transmission line. For my case, 0xFE (254) and 0xFF (255).