Hi All,
I am currently working on what I initially thought was a simple project reading data from the RS232 port of a pH meter with a Teensy 3.5. The meter sends data at time intervals over RS232. The hardware setup for this on the teensy is via a TTL to RS232 converter from here, a RS232 gender charger (I checked pin to pin connection with a multimeter) and the code is attached.
The pH meter is set to a baud of 9600 and the manual for it reports it needs, 8-bit data bits, 1 stop bit with no parity and XON/XOFF protocol. I can communicate to the teensy from a putty terminal (putty -->USB to RS232 converter --> RS232 to TTL --> Teensy), I can receive from the pH meter (pH --> RS323 to USB --> Putty) but I cannot get anything from the pH meter to the teensy. The common denominator in all of this is the RS323 to USB converter/ putty makes it work and the gender bender breaks it. I have checked the RS232 gender changer with a multimeter and it is just a connector and does not swap pins from what I can see. This leaves me to think that I am not quite understanding serial communication needed with the XON/XOFF protocol. I can however get putty to receive data even when I set the Flow control to off.
What I have done so far:
1. Shorted pins 1,6 and 4 together and pins 7 and 8
2. Figured out the pH meter has three pins connected back at the box (GND, TX and RX) (then realised 1 was not needed)
3. Investigated Serial1.write(17) and Serial1.write(19)
Any help appreciated.
Regards,
Deadsilly
I am currently working on what I initially thought was a simple project reading data from the RS232 port of a pH meter with a Teensy 3.5. The meter sends data at time intervals over RS232. The hardware setup for this on the teensy is via a TTL to RS232 converter from here, a RS232 gender charger (I checked pin to pin connection with a multimeter) and the code is attached.
Code:
void setup() {
Serial.begin(9600);
Serial1.begin(9600, SERIAL_8N1);
delay(100);
}
void loop() {
String B;
char A;
if (Serial1.available()>0){
while (Serial1.available()>0){
delay(20);
A = Serial1.read();
B += A;
}
Serial.print("UART received: ");
Serial.println(B);
}
}
The pH meter is set to a baud of 9600 and the manual for it reports it needs, 8-bit data bits, 1 stop bit with no parity and XON/XOFF protocol. I can communicate to the teensy from a putty terminal (putty -->USB to RS232 converter --> RS232 to TTL --> Teensy), I can receive from the pH meter (pH --> RS323 to USB --> Putty) but I cannot get anything from the pH meter to the teensy. The common denominator in all of this is the RS323 to USB converter/ putty makes it work and the gender bender breaks it. I have checked the RS232 gender changer with a multimeter and it is just a connector and does not swap pins from what I can see. This leaves me to think that I am not quite understanding serial communication needed with the XON/XOFF protocol. I can however get putty to receive data even when I set the Flow control to off.
What I have done so far:
1. Shorted pins 1,6 and 4 together and pins 7 and 8
2. Figured out the pH meter has three pins connected back at the box (GND, TX and RX) (then realised 1 was not needed)
3. Investigated Serial1.write(17) and Serial1.write(19)
Any help appreciated.
Regards,
Deadsilly