Serial Port Comm via MAx232 - Half Working
Archiver
Posts: 46,084
I asked earlier about serial port flow control. I got a MAX232 chip
and wired it up to my BS2. This is connected to my PC serial port. PC
I/O is done via Java Comm API. Settings are 9600 8N1 and using
hardware flow control. Baud value on the Stamp is $84 (not inverted).
I am using Stamp I/O pins 0-3, with everything wired as pictured in
NV89.pdf (Nuts 'n Volts article by Jon Williams).
The good news is I can send and receive data without errors. The bad
news is there is a specific case were there is no communication.
If my SERIN command times out, I have a 3 second pause (and flash an
LED, etc.). If the PC tries to send the data while the BS2 is
executing pause, the data will never be sent. The PC program is hung
in the write command. If the PC sends the data while the BS2 is
actively executing the SERIN command, all works perfectly.
With a logic probe, I see when SERIN is active, my CTS I/O pin is 0.
When executing pause, CTS is 1. This seems "inverted" to me.
Similarly, the RTS pin is 0 when the PC is hung trying to send data.
These values seem inverted to me and I am confused. It seems to me
that RTS should be 1?
I have not looked deeply into the Java Comm API library. I presume the
library handles the correct toggling of the RTS line, etc.
Thanks for any help.
Harry
and wired it up to my BS2. This is connected to my PC serial port. PC
I/O is done via Java Comm API. Settings are 9600 8N1 and using
hardware flow control. Baud value on the Stamp is $84 (not inverted).
I am using Stamp I/O pins 0-3, with everything wired as pictured in
NV89.pdf (Nuts 'n Volts article by Jon Williams).
The good news is I can send and receive data without errors. The bad
news is there is a specific case were there is no communication.
If my SERIN command times out, I have a 3 second pause (and flash an
LED, etc.). If the PC tries to send the data while the BS2 is
executing pause, the data will never be sent. The PC program is hung
in the write command. If the PC sends the data while the BS2 is
actively executing the SERIN command, all works perfectly.
With a logic probe, I see when SERIN is active, my CTS I/O pin is 0.
When executing pause, CTS is 1. This seems "inverted" to me.
Similarly, the RTS pin is 0 when the PC is hung trying to send data.
These values seem inverted to me and I am confused. It seems to me
that RTS should be 1?
I have not looked deeply into the Java Comm API library. I presume the
library handles the correct toggling of the RTS line, etc.
Thanks for any help.
Harry