Teensy 3.5 serial port malfunctioning

Status
Not open for further replies.

po03087

Member
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
 
That can‘t be guessed at distance without further information and details. The most efficient approach would be to use a logic analyzer to see if the multimeter, the ttl adapter, or the Teensy is wrong.
 
You can see the T_3.5 Serial1 working by crossing its Serial2 pins over to it and writing a sketch that outputs on one port and receives on the other.
 
Could be many things, like maybe you do not have a good electrical connection between your multi-meter and the Teensy.
You need to have a common ground between the Teensy and the multi-meter (probably trough the ttl converter. I am assuming you have it connected to the RX pin of Serial1? i.e. pin 0?

Also maybe there is an issue with the input signal. That is does the multimeter send out a continuous stream of characters, where the system may not be able to deduce that start of the data?
 
Status
Not open for further replies.
Back
Top