Photon TX pin won't go high?

I’ve been struggling to send data with Serial.write, got a scope on the pins and for some reason the TX pin on 2 different photons is always low.

Receiving works fine, so the Serial library is working fine.

World’s simplest code…

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

void loop() {
    delay(1000);
    Serial.write(0x30); 
    Serial1.write(0x30);  
}

@Nemiah, Serial will write to the USB serial port while Serial1 writes to the RX/TX pins. What are the RX/Tx pins connected? How are you “receiving” data? Which Serial library are you referring to?

A UART uses an NRZ protocol (Non Return Zero) so with nothing connected to TX, simply doing Serial1.begin(1200); should make the TX pin go HIGH.

1 Like

How are you measuring the TX level?

@peekay123 that code just echoes “0” to both the USB serial and the Tx pin on the photon. USB works, Tx pin doesn’t. It’s the standard Serial lib

The Tx pin never goes high and there’s nothing connected to it.

@ScruffR I’m using a digital scope.

Could it be that you fried your pin?

You can try this

void setup() {
  pinMode(TX, OUTPUT);
}

void loop() {
  digitalWrite(TX, !digitalRead(TX));
  delay(5);
}

to see if you can get any HIGH level on the pin at all.

4 Likes