Spark and Arduino Serial Communications

Spark is 3v3. (Many) Arduinos are 5v. To get them communicating via Serial, I’m assuming I need a logic level converter, correct? I’d like to communicate back and forth between a Spark Core (Serial1) and Arduino Mega (Serial 1/2/3/4) so I can issue commands and process responses.

wgbartley, I believe the Spark digital pins (except for D0 and D1) can tolerate 5V so no need for any level shifters. :smile:

From the Serial documentation:

A similar warning is in the Hardware Serial (UART) documentation:

I also realize that I’m semi-responding to my own question with documentation references. My question is more regarding the logic level converter and talking to the Arduino over Serial1. :wink:

Can’t find the exact docs on which Digital pins are 5v tolerant but @zach did mentioned here:

But TX & RX is mentioned here…

So looking at: http://docs.spark.io/#/shields/shield-shield,

It uses a TXB0108PWR as the logic converter. I think others like:


works well too :smiley:

If you want to test stuff out 1st, you can use a simple voltage divider :smile:

Dang, these little things SO need documenting!

1 Like

When looking at the STM32 datasheet (p. 28ff) the pins that have FT in the column “I/O Level (2)” are 5V tolerant - hence FT (Five volt Tolerant).
As for the Cores RX/TX pins (PA2, PA3 for USART2) - they are lacking this FT, so I’d assume level shifting is required for RX (5V comming from Arduino into Core - easiest with voltage devider as @kennethlimcp suggested) but not necessarily for TX (Core to Arduino) since any voltage > 2,6V should be recognized as HIGH by the Arduino - aslong you can assure, that the Arduino pin used as RX (connected to the Core’s TX) will never be driven HIGH!

USART3 (PB10, PB11) on the other hand would be FT, but are not available as pins on the Core - maybe this might be worth a thought on future Core revisions.

As as summary for the current Core:
NOT 5V tolerant:
TX (PA2)
RX (PA3)
A0 (PA0)
A1 (PA1)
A2 (PA4)
A3 (PA5)
A4 (PA6)
A5 (PA7)
A6 (PB0)
A7 (PB1)
D2 (PB5)

5V tolerant:
D0 (PB7)
D1 (PB6)
D3 (PB4)
D4 (PB3)
D5 (PA15)
D6 (PA14)
D7 (PA13)

3 Likes