SoftwareSerial broken for Teensy LC

Status
Not open for further replies.

jacky4566

Well-known member
Seems there is a problem with software serial on the Teensy LC.

When i run the following code my IC just freezes up. Any tips here? I am using pins 1 and 0 to determine if i wired my device backwards.

Arduino 1.8.7 with Teensyduino 1.44

I am using library SoftwareSerial at version 1.0 in folder: C:\Program Files (x86)\Arduino\hardware\teensy\avr\libraries\SoftwareSerial

Code:
#include <SoftwareSerial.h>

SoftwareSerial mySerial(1, 0); // RX, TX

void setup() {
  mySerial.begin(19200);
}

void loop() {
  mySerial.write("AT\r");
  Serial.println("...");
  delay(1000);
}
 
When the pins don't align with a real serial serial port, SoftwareSerial is trying to bigbang. But that code only works on Teensy 3.x. It's using the DWT cycle counter which doesn't exist on Teensy LC.
 
Sadly, no. AltSoftSerial isn't ported to Teensy LC either.

But you do have 3 real hardware serial ports on LC, and SoftwareSerial is able to use those 3 if you're stuck with some Arduino lib that's hard coded to require SoftwareSerial.
 
OK. Thanks for the quick response Paul.

I am having trouble communicating with a specific modem on a built pcb and i may have my TX/RX backwards. I was trying to test with software real quick.

The datasheet isn't exactly the clearest.
Capture.PNG
 
Oh that does look confusing.

One simple test you can try involves a resistor to GND. Usually anything in the 1K to 100K range works. If the pin is being driven (TTL level serial is logic high when idle) it'll stay close to 3.3V even with the extra resistor load. But if it's an input, usually a resistor will bring close to 0 volts, or to some lower voltage you can easily measure if the input has a pullup resistor.
 
Status
Not open for further replies.
Back
Top