Teensy 3.2 Serial Communication with RF module Issue

Status
Not open for further replies.
Hi all,
I just testing my new Radio freq. modules (915Mhz) to my arduino uno and its work fine, send the data to the RF receiver in my pc using teraterm correctly .
but when i switch using my teensy 3.2, the data i received is nonsense (error).
this is source code that i used to

//SoftwareSerial print_serial(0,1); using arduino uno
#define print_serial Serial3 // using teensy 3.2, i also have tried with serial1 and output still uncorrect.

void setup() {
print_serial.begin(57600);
Serial.begin(57600);
delay(1000);
}

void loop() {
Serial.println('b');
print_serial.println('b');
delay(1000);
}

Note :
-COM4 is the teensy serial, and COM3 is the RF receiver in my PC.
-Baudrate already set to 57600 in teraterm and teensy.

any suggestion or my simple SC is still wrong? thanks all.
 

Attachments

  • Capture.PNG
    Capture.PNG
    33 KB · Views: 124
4 things:
1.) Voltage: The Arduino UNO is an old-fashioned 5V device, the Teensy 3.2 a modern 3.3V device. Please make sure that your RF modules can work with 3.3V logic levels (should normally if these are modern, too). If not, take a 74HCT245 or a 74LV1T125 out of the drawer and put it between Teensy TX and rf mod RX as a level converter.
2.) Serial port: Depends on where you connect your modules. When using pins 0 and 1, #define print_serial Serial1. When using pins 9 and 10, #define print_serial Serial2. When using pins 7 and 8, #define print_serial Serial3.
3.) Common sense: Don't forget to cross RX and TX lines - Teensy TX goes to rf mod RX and vice versa.
4.) Common ground: Besides the RX and TX lines, the ground pins of the Teensy and the RF module must be connected together, too.
 
What does the oscilloscope (or the logic analyzer) on the Teensy's TX pin1 tell when you send the 'b' character? Please post a picture or screenshot.

You wrote that you set the 57600 baud rate in Teraterm, but did you also change the baud rate inside the rf modules? Perhaps these are not aware of your speed change. Try with print_serial.begin(9600) to come closer to that ugly softwareSerial and revert Teraterm also (temporarily) to 9600.
 
What does the oscilloscope (or the logic analyzer) on the Teensy's TX pin1 tell when you send the 'b' character? Please post a picture or screenshot.

You wrote that you set the 57600 baud rate in Teraterm, but did you also change the baud rate inside the rf modules? Perhaps these are not aware of your speed change. Try with print_serial.begin(9600) to come closer to that ugly softwareSerial and revert Teraterm also (temporarily) to 9600.

ok i'll try it with osci. soon,
where can i change or know the baudrate of my RF?

i have try almost all of the baudrate size that exist in serial. but still uncorrect data received.
this with baudrate 9600.
 

Attachments

  • Capture1.PNG
    Capture1.PNG
    18 KB · Views: 118
Most devices specify a default or initial baud rate - device specific documents would indicate that and if it can be changed. Some devices emit a startup string the osc might catch that - or have a Teensy running at standard baud rates in turn reading any available characters from Serial3 and echoing them to USB Serial to observe as you power up the device when connected - then repeat as needed altering the Teensy program baud rate and restarting the device.

Not seeing any indication of what the 915 MHz RF device is :: part # or model# or link to the supplier or even a photo might help get to the needed info.
 
You can get much better help when you show us (not tell, but actually show) what you're really doing. Specific part numbers or product name/model for the modules & whatever non-Teensy USB-serial hardware you really using would be a good start. Photos showing (again, show, don't just tell) how you've actually connected the wires are also a good idea.

Often these sorts of problems are simple misunderstandings. If you look over the many threads on this forums, we're surprisingly good at guessing what's wrong when we can see. But without details, we still try blind guessing, but it's not nearly as effective at actually helping. You can really help us to help you by posting better info to actually show us what you're really doing.
 
i have try almost all of the baudrate size that exist in serial. but still uncorrect data received.
this with baudrate 9600.

The setting that matters most is this line:

Code:
print_serial.begin(57600);

If you're changing settings on your PC but not editing that line and uploading the new code to Teensy, then everything is still the same on the Teensy side.

For the COM port to Teensy, your PC's baud setting is ignored, so you can avoid wasting time with changes to COM4. Teensy's speed will only depend on that line in your code.
 
Had just a quick look onto these devices and their description. Their default baudrate seems effectively to be 9600. This can be changed by AT commands for the transmitter and RT commands for the receiver.

I think what’s troubling here, are the manifold places where the baudrate would have to be changed: The Teensy UART, the transmitter’s UART, the receiver’s UART, Window’s virtual USB com port, and the Terminal program. All have to be set to the same baud rate to make things work.
 
Had just a quick look onto these devices and their description. Their default baudrate seems effectively to be 9600. This can be changed by AT commands for the transmitter and RT commands for the receiver.

I think what’s troubling here, are the manifold places where the baudrate would have to be changed: The Teensy UART, the transmitter’s UART, the receiver’s UART, Window’s virtual USB com port, and the Terminal program. All have to be set to the same baud rate to make things work.

teensy baudrate set in SC, receiver & transmitter rf module baudrate is 57600 bcs i test on arduino it work in that baudrate not in other baudrate.all have set in 57600 following the rf baudrate, but still it sends unidentify char. or val. :(
 
The setting that matters most is this line:

Code:
print_serial.begin(57600);

If you're changing settings on your PC but not editing that line and uploading the new code to Teensy, then everything is still the same on the Teensy side.

For the COM port to Teensy, your PC's baud setting is ignored, so you can avoid wasting time with changes to COM4. Teensy's speed will only depend on that line in your code.

ive editing that too bcs 57600 is the rf baudrate. but still.
 
Cap1ture.PNG
after i try many times, the tx led in transmitter and rx led in receiver are blinked, maybe it is the sign of data communication. but the data is not displayed in monitor, just the white char. cursor in teraterm is blinking.
the difference, in uno tx led is 1 blinking /second, but in teensy is faster like 2x or 3x speed of led blink in uno. are you know what is happened? thanks for your help guys :).
 
Last edited:
Status
Not open for further replies.
Back
Top