using all serial ports

Questions on UARTs, and serial communication
Post Reply
basicchip
Posts: 837
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

using all serial ports

Post by basicchip » Mon Apr 20, 2015 4:25 pm

>from help line

I am wanting to use all four hardware Uarts in my program on the SuperPro. This involves communicating with 3 motion control modules through separate RS-232 ports and also sending a continuous stream of status bytes (strings) out through the fourth UART (UART0). Going to try for 19.2kb on all systems. Handshake lines not used for any of this. (Manual suggests that using bbRxD/bbTxD on any old pins as the fourth port will lead to trouble.)

At the same time, I also want to be able to use UART0 for occasional reprogramming and debug purposes. Is this possible? It looks like you would just plug in with a cable that uses the handshake lines and this would return you to "debug mode" once ARM Tools was run. (Of course you would see the status stream as soon as the pgm started, but that's ok as long as "STOP" is independently available.)

Can you confirm this approach will work?



basicchip
Posts: 837
Joined: Fri Oct 19, 2012 2:39 am
Location: Lake Tahoe, CA
Contact:

Re: using all serial ports

Post by basicchip » Mon Apr 20, 2015 4:30 pm

Yes you can use all 4 UARTs on the SuperPRO.

bbRXD is left over from PBASIC emulation days, and while it works it requires interrupts to be turned off, which can be an issue waiting for the first character to come in.

bbTXD also turns interrupts off, but only during the transmission of the serial bits, so in most cases it can still be used.

But it is better to use the UARTs as they have FIFOs, and buffering via interrupts.

Reconnecting the USB debug and starting BASICtools will stop your program, but then allow for debug/ reprogram.
You might consider using a bbTXD to spit out debug info to a terminal program like TeraTerm or TclTerm.

Post Reply