TX and RX pins refuse to work

Serial communication via usb works like a charm, however, using TX and RX pins (and Serial1 commands + Serial1.begin(9600) ) produces no results

Simple “hello world” programs don’t seem to work at all, even hooked up to an oscilloscope no change on the pins can be seen

any other troubleshooting suggestions I should try?

Serial1 is to communicate with other devices via the TX and RX pins on the core.

You will need something like (similar to Arduino)

if (Serial1.available ())
    Serial.print (Serial1.read ());

That’s what i was originally attempting to do, however I scaled back when things weren’t working

Shouldn’t there still be some change on the TX pin when Serial1.write() is used?

oh yeah it should…

If you share your code we can take a look :wink:

ok that’s what I figured haha

int i=0;

void setup() 
{
Serial.begin(9600);
Serial1.begin(9600);
}

void loop() 
{
Serial.println("working");
Serial1.write(i);
i++;
delay(1000);
}

Hmm, my scope and DMM is not with me now. Will test and get back to you.

Or someone else in the community can help see if the tx rx is communicate ok :smiley:

That’s alright, I won’t have access to the spark until tomorrow morning, so I won’t be able to confirm anything just yet.

I have tended to receive on the Spark physical serial port, but I have had few issues. Obviously when I forgot to use a Serial1.begin(9600) things would not work, but once that is fixed, things work. The other issue I have had is code like if Serial.available() {Serial1.read()}

Don’t forget that the Rx and Tx lines are 3.3V and are from memory not 5V tolerant. They are certainly not RS232 level, but I am sure you knew that anyway.

Darryl

yep, didn’t forget the Serial1.begin(9600)

I’m using a LT10801CN RS-232 transceiver to bring things to the spark’s level
However it seem the issues i’m having reside in the spark

@daflippymaster, just a note that Serial1.write() takes a uint8_t argument (char) and I am not sure what passing an int will do. :smile:

1 Like

here is a very simple little program that acts as a serial pass-thru for testing, i used it to talk to a adafruit fingerprint reader, so its tested and works fine with the PC app.

void setup()  
{
  Serial.begin(57600);
  Serial1.begin(57600);
}

void loop() // runs over and over
{
  while (Serial1.available())
    Serial.write(Serial1.read());
  while (Serial.available())
    Serial1.write(Serial.read());
}
2 Likes

@peekay123, Thank you, i’ll have to remember that for future use, however it doesn’t seem to make much of a difference whether .print() or .write() is used (in terms of the TX pin functioning)

@Hootie81, Just gave your code a shot and, unfortunately, there’s still no change -____-

Could it be bad pin connections on the spark board? or does this seem to be more software related?

@daflippymaster, have you tested with the LT10801CN completely disconnected from the core? Is the core on a breadboard?

Yep, i’ve taken the core off the breadboard so that it’s only attached via usb so we’ve ruled out the board as the issue

@daflippymaster, reading the spec sheets on the LT10801CN shows that it is a 5V device which puts out 5V signals on the logic pins. The Rx and Tx lines of the Spark are not 5V tolerant. There is a possibility that the Rx/Tx pins were damaged.

1 Like

It's dead hardware... perhaps a blown I/O pin, or bad solder connection.

Look at pin 12 and 13 of the STM32 micro and see if they are soldered well.

The solder connections look to be alright. I’m worried that @peekay123 might be correct.

But would the TX pin get damaged? it shouldnt have 5v applied to it… unless you swapped the tx and rx round during testing?

Have a look at this post and see if it will help you out if you have damaged the pins

I’m fairly certain that the pins were never swapped

sorry, which post @Hootie81?