Bill Bigge
Member
I wrote a simple sketch that sends a message every 300ms over the USB serial on a teensy 3.2. The messages alternate between two versions.
I noticed that some times the same message repeats, as if a data packet was being dropped. I tried using another serial port and an FTDI USB serial converter and saw no problems.
Along the way I tried connecting the teensy USB serial to a serial monitor app called termite but it did not work. It only works when using the Arduino serial monitor. If I use Termite to connect to the FTDI serial it works fine, it just doesn't like the native USB on the Teensy.
I recompiled the same code and tested it on an UNO with no issues (but UNO uses the FTDI chip for serial anyway so I didn't expect it to)
I haven't yet tried reinstalling any USB drivers but I was wondering if anyone has encountered this issue before and if so whether they know if it is specific to teensy?.
I noticed that some times the same message repeats, as if a data packet was being dropped. I tried using another serial port and an FTDI USB serial converter and saw no problems.
Along the way I tried connecting the teensy USB serial to a serial monitor app called termite but it did not work. It only works when using the Arduino serial monitor. If I use Termite to connect to the FTDI serial it works fine, it just doesn't like the native USB on the Teensy.
I recompiled the same code and tested it on an UNO with no issues (but UNO uses the FTDI chip for serial anyway so I didn't expect it to)
I haven't yet tried reinstalling any USB drivers but I was wondering if anyone has encountered this issue before and if so whether they know if it is specific to teensy?.
Code:
const int VIB_PWM = 3;
const int VIB_EN = 13;
const int delaytime = 300;
long int stepn = 0;
void setup() {
Serial.begin(115200);
//Serial1.begin(115200);
pinMode(VIB_PWM, OUTPUT);
pinMode(VIB_EN, OUTPUT);
}
void loop() {
vibON();
if(Serial) {Serial.print(stepn);Serial.println(" ON");}
//Serial1.print(stepn);Serial1.println(" ON");
stepn++;
delay(delaytime);
vibOFF();
if(Serial) {Serial.print(stepn);Serial.println(" --");}
//Serial1.print(stepn);Serial1.println(" --");
stepn++;
delay(delaytime);
}
void vibON(){
digitalWrite(VIB_EN, 1);
analogWrite(VIB_PWM, 1023);
}
void vibOFF(){
digitalWrite(VIB_EN, 0);
analogWrite(VIB_PWM, 0);
}