Report
5 years, 4 months ago.

Using the FRDM-KL25Z board 3.3vpins with Arduino 5v pins for Serial Communication

Hey, I purchased a FRDM-KL25Z board and I want to connect it to my arduino but the arduino Rx/Tx pins are 5v and my FRDM-KL25Z pins are 3.3v. I tried using the sparkfun logic level converter https://www.sparkfun.com/products/11978 but it corrupted my signal. I was getting horrible data even though the arduino received something. I know my code is correct as I connected two FRDM-KL25Z boards (both 3.3v) and my data was correct. I also tested my values with teraterm and it worked. Please I would like to find out if anyone has successfully used serial connections between the FRDM-KL25Z and arduino; and if yes, please how did you do it?

Thanks

Comment on this question

1 Answer

5 years, 4 months ago.

I have used the Sparkfun board on I2C and it works fine. Did you connect it properly? One side of the board is for the high voltage and one side for low voltage. There are actually two converters for two signals on the board. You need an active driver to go from low voltage to high (TX from KL25Z to Arduino RX) and one passive divider to go from high voltage to low (Arduino TX to KL25Z RX). The board needs 3V3, 5V powersupply and you also need to have a common ground.

My Mbed and arduino have common grounds (on the arduino) but the sparkfun board has its LV ground connected to the ground pin on the KL25Z board. But I doubt that should distort my readings

posted by Kosy Onyenso 12 Feb 2014

My Mbed and arduino have common grounds (on the arduino) but the sparkfun board has its LV ground connected to the ground pin on the KL25Z board. But I doubt that should distort my readings

posted by Kosy Onyenso 12 Feb 2014

The LV and HV ground pins are connected. Hooking up one of them to the common ground should be OK. Did you check the 3v3 and 5v on the levelconverter. Can you provide the schematic of the connections.

Note that there was a problem with early revisions of the level converter: the resistor divider for 5v to 3v3 consisted of two identical valued resistors. That meant 5V in resulted in 2.5V out. This is critically low for detecting a 3V3 high level. Later revisions of the board have the proper resistance values to give you 3V3 out. The wrong value could result in incorrect serial data. You can fix that by using the second active driver: they are bidirectional and can also convert 5V into 3V3 levels.

posted by Wim Huiskamp 12 Feb 2014

5V to 2.5V shouldn't be an issue as it's the mbed sending the data (3v3) and not the arduino which is 5v.

posted by Kosy Onyenso 12 Feb 2014

Finally got it...turns out it was working all along but the arduino couldn't handle multiple Rx/Tx connections (both mbed and PC) hence the scrappy values. I put conditions on the arduino to show results and removed the connections from the PC serial and it worked like a charm.

posted by Kosy Onyenso 13 Feb 2014

To post an answer, please log in.