I have a CP2102 chip that converts serial to usb. It is working because I can connect TX and RX together and run this python program and it outputs fine
So this works fine. But when I connect to Teensy Serial1 (port 0 and 1) and try to just print something, nothing is happening
I would post an image of putty or python but the screen will just be blank. I am positive I am using the correct port when connecting - I made sure of this by disconnecting the CP2102 to see which port disappears. I have also checked all the other ports just to be sure.
So the problem is that I had a more complex program than this which was working a couple of months ago, I come back to try to use it again and it is no longer working. So I go back to the simple code above and even that does not work. This leads me to two things
So please if anyone has any ideas I would be grateful, maybe I am missing something simple... One last thing to add is the teensy still seems to work other than the HW serial, I have run a Keyboard feedthrough using USB host, the micro USB Serial, and that seems to work. So is it possible that just the HW serial is broken?
Code:
import time
import serial
from struct import pack, unpack
from time import sleep
SERIAL_DEVICE='COM6'
BAUD_RATE=9600
ser = serial.Serial(SERIAL_DEVICE, BAUD_RATE)
try:
while ser.is_open:
ser.write(b'hello')
time.sleep(1)
s = ser.read(5)
print(s)
except:
ser.close()
So this works fine. But when I connect to Teensy Serial1 (port 0 and 1) and try to just print something, nothing is happening
Code:
#define HWSER Serial1
void setup()
{
HWSER.begin(9600);
}
void loop()
{
HWSER.print("hello");
delay(100);
}
I would post an image of putty or python but the screen will just be blank. I am positive I am using the correct port when connecting - I made sure of this by disconnecting the CP2102 to see which port disappears. I have also checked all the other ports just to be sure.
So the problem is that I had a more complex program than this which was working a couple of months ago, I come back to try to use it again and it is no longer working. So I go back to the simple code above and even that does not work. This leads me to two things
- I broke the Teensy
- I am doing something wrong
So please if anyone has any ideas I would be grateful, maybe I am missing something simple... One last thing to add is the teensy still seems to work other than the HW serial, I have run a Keyboard feedthrough using USB host, the micro USB Serial, and that seems to work. So is it possible that just the HW serial is broken?