My failed FullDuplexSerial experiment
Mickster
Posts: 2,694
So I took an RS232 cable and chopped it. Then I stuck my Prop board with two serial ports between the two chopped ends and simply tried to pass the data through in both directions using FullDuplexSerial. Each Rx was fed to the other Tx but it wouldn't work as I'd hoped. I selected the appropriate Baud and used the ".RxCheck" routines to be sure there was no waiting(?).
Have I misunderstood something silly here?
Have I misunderstood something silly here?
Comments
I try to use a MAX3232 chip (or other longer distance serial protocol chip) if the cable is over a few feet.
My 5V TTL barcode reader will only work out to about six feet of cable.
Yes, whatever is received on port #1 is sent to transmit on port #2 and vice versa.
@Duane
The board is equipped with MAX3232s and is a well proven design. I can receive data from either device and send it to PST.
Thanks for the attention, guys.
Doesn't RxCheck return a -1, $FFFF_FFFF, when no data is available? How do the attached devices react to receiving a series of $FFs? Are you missing an IF statement?
Edit: Tried other modes with no success.
I assume this is for my board?
If so then try this code, I just tested it and it is ok.
This code tx's from 0 to z ASCII out on UART1 TX which should be wired to UART2 RX.
The received character is echoed out on UART2 TX which should be wored to UART1 RX
Provided the echoed character received on UART1 RX is the same it is then output to PST.
Regards,
Coley
EDIT for some reason the percent sign will not show in a post, stange!
Looking at your original code, you are using rxcheck, this will return -1 if there is no data, Mike G is correct.
If you are using my board then you have to invert the tx and rx pins in the Mode settings as you are going through an RS232 level shifter.
What is it you are trying to do?
Hey bud!
Yes it is your board. Kills me to have to use it because I only need the two serial ports but it is self contained and professional looking and going in a piece of CNC equipment.
Here's my project:
- PC, DOS-Based controller, circa 1994, source code no-longer available
- Needs to talk directly to a 3M-Microtouch touch monitor. There isn't a memory resident mouse emulating driver
- Touch monitor has its own micro-controller that communicates via RS232 (9600, N, 7, 2)
- PC initiates the communication by sending "R" (reset) to the touch screen's micro-controller
- The touch screen's micro-controller responds with Chr(1) + "0"......but the PC software expects an immediate response or it exits to DOS
- The original touch monitor just failed after 20 years so now we are attempting to fit a newer model
- Incredibly, the firmware of the touch screen's micro-controller, according to 3M-Microtouch, has "become cluttered with features and has slowed down a bit"
- So this new controller is not responding with said Chr(1) + "0" quick enough and therefore the PC's software assumes that there is no touch screen present and simply exits to DOS.
My plan is to have the Prop intercept the one initial "R" from the PC and immediately return a Chr(1) + "0" to keep the DOS software happy and prevent it from exiting. All other comm's can then simply pass through.Unfortunately, I have to visit the customer's facility to test this new code so have to wait for the next opportunity.
Regards,
Mickster
So are there any STX or ETX characters sent just chr(1) and "0", no CR or LF??
Regards,
Coley