Hi, so I want to read ASCII signal from a multimeter using teensy 3.5 with the following code. The RS 232 output panel of the multimeter is conncected to a TTL converter, and the data pin (pin 3) of the TTL-converted RS232 is connected to serial port 1 of teensy 3.5.
Code: [Select]
int incomingByte = 0; // for incoming serial data
void setup() {
Serial1.begin(9600); // opens serial port, sets data rate to 9600 bps
}
void loop() {
// send data only when you receive data:
if (Serial1.available() > 0) {
// read the incoming byte:
incomingByte = Serial1.read();
// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, DEC);
}
}
This code worked fine just few days ago, with the output as the following:
Code: [Select]
I received: 49
I received: 46
I received: 49
I received: 48
I received: 53
I received: 51
I received: 51
I received: 49
I received: 69
I received: 45
I received: 48
I received: 52
I received: 13
I received: 10
Which interprets as 1.105331E-04\r\n
However, now I get the following output with the same code:
Code: [Select]
I received: 255
I received: 255
I received: 255
I received: 255
I received: 95
I received: 127
I received: 247
I received: 215
I received: 87
I received: 213
I received: 255
I received: 255
I received: 87
I received: 255
I received: 255
I received: 95
which interprets as squares and random alphabets.
This kind of weird signal is read repeatedly (around 10 signals per second) with or without the signal actually being sent to the microprocessor. The only way to stop the acquisition of weird signal is by physically unplugging the data pin.
I did not touch any settings of the multimeter and I have no idea why the teensy 3.5 is sunddenly malfunctioning. Is the microprocessor broken? Is there a way to reset its settings?
Thank you so much.
Jaewoo
Code: [Select]
int incomingByte = 0; // for incoming serial data
void setup() {
Serial1.begin(9600); // opens serial port, sets data rate to 9600 bps
}
void loop() {
// send data only when you receive data:
if (Serial1.available() > 0) {
// read the incoming byte:
incomingByte = Serial1.read();
// say what you got:
Serial.print("I received: ");
Serial.println(incomingByte, DEC);
}
}
This code worked fine just few days ago, with the output as the following:
Code: [Select]
I received: 49
I received: 46
I received: 49
I received: 48
I received: 53
I received: 51
I received: 51
I received: 49
I received: 69
I received: 45
I received: 48
I received: 52
I received: 13
I received: 10
Which interprets as 1.105331E-04\r\n
However, now I get the following output with the same code:
Code: [Select]
I received: 255
I received: 255
I received: 255
I received: 255
I received: 95
I received: 127
I received: 247
I received: 215
I received: 87
I received: 213
I received: 255
I received: 255
I received: 87
I received: 255
I received: 255
I received: 95
which interprets as squares and random alphabets.
This kind of weird signal is read repeatedly (around 10 signals per second) with or without the signal actually being sent to the microprocessor. The only way to stop the acquisition of weird signal is by physically unplugging the data pin.
I did not touch any settings of the multimeter and I have no idea why the teensy 3.5 is sunddenly malfunctioning. Is the microprocessor broken? Is there a way to reset its settings?
Thank you so much.
Jaewoo