Forum Rule: Always post complete source code & details to reproduce any issue!
Results 1 to 16 of 16

Thread: Teensy 3.0 serial monitor not working?

  1. #1
    Junior Member
    Join Date
    Nov 2012
    Posts
    4

    Teensy 3.0 serial monitor not working?

    Hello there everyone.

    I don't exactly know what's going on with my teensy or my computer. I can't seem to receive serial output from the Teensy 3.0 through serial monitor.

    I have uploaded my fast-paced blink code onto the teensy 3.0 and it seems to work perfectly, but I cannot seem to get anything that outputs serial to be read by the serial monitor.

    I would appreciate any assistance.

    I looked at pin 1 through my oscilloscope, and I saw no activity. Does this pin work like how the arduino uno pins work?

    Thanks,
    Brandon

  2. #2
    Senior Member
    Join Date
    Oct 2012
    Location
    Portland OR
    Posts
    706
    First, realize the Teensy 3 (unlike Arduino Uno) does the USB interface in software and hardware inside the CPU chip. By contrast, the Arduino Uno and previous Arduinos use an external USB-Serial converter chip. The Teensy 3 *also* has three "traditional" UART-based serial ports, accessed by Serial1, Serial2, Serial3; but if your code is for example Serial.print("hi there"); that will go through the USB port so there will be no signals on pin 1 or any other GPIO pin on the board edge.

    That said, it should work with the serial monitor. The problem is, you have to select the correct COM port. Merely uploading the sketch to the Teensy does not use the virtual COM port interface (to program, it uses a separate USB HID device type, and then after programming, it switches back to being a virtual COM port). So if you have your serial port COMxx setting wrong, you can still upload to the Teensy, but you won't be able to get the serial monitor to work when the program runs.

  3. #3
    By default the teensy acts like a USB serial device. If you want to use pin 1/2, try using HardwareSerial or Serial1.

    -c

  4. #4
    Junior Member
    Join Date
    Nov 2012
    Posts
    4
    Quote Originally Posted by JBeale View Post
    First, realize the Teensy 3 (unlike Arduino Uno) does the USB interface in software and hardware inside the CPU chip. By contrast, the Arduino Uno and previous Arduinos use an external USB-Serial converter chip. The Teensy 3 *also* has three "traditional" UART-based serial ports, accessed by Serial1, Serial2, Serial3; but if your code is for example Serial.print("hi there"); that will go through the USB port so there will be no signals on pin 1 or any other GPIO pin on the board edge.

    That said, it should work with the serial monitor. The problem is, you have to select the correct COM port. Merely uploading the sketch to the Teensy does not use the virtual COM port interface (to program, it uses a separate USB HID device type, and then after programming, it switches back to being a virtual COM port). So if you have your serial port COMxx setting wrong, you can still upload to the Teensy, but you won't be able to get the serial monitor to work when the program runs.
    Ahh, that's brilliant!

    Yes, I have considered it. My computer is on the only serial port that shows up under the arduino environment (COM1). And I am using the beta7 version of the teensy IDE. Interesting information though...

    Quote Originally Posted by cmason View Post
    By default the teensy acts like a USB serial device. If you want to use pin 1/2, try using HardwareSerial or Serial1.

    -c
    I did (meticulously) try to measure if there was any output at the USB port. I didn't read anything.
    Last edited by blu; 11-18-2012 at 06:32 AM.

  5. #5
    Junior Member
    Join Date
    Nov 2012
    Posts
    4
    In case anybody is wondering... here's my code
    Code:
    /*
      Blink With Serial
      Turns on an LED on for one second, then off for one second, repeatedly.  And with some serial action per loop.
     
      This example code is in the public domain.
     */
     
    // Pin 13 has an LED connected on most Arduino boards.
    // Pin 11 hes the LED on Teensy 2.0
    // Pin 6 hes the LED on Teensy++ 2.0
    // give it a name:
    int led = 13;
    
    // the setup routine runs once when you press reset:
    void setup() {                
      // initialize the digital pin as an output.
      pinMode(led, OUTPUT);
      Serial.begin(9600);  
    }
    
    // the loop routine runs over and over again forever:
    void loop() {
      Serial.println("loop");
      digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
      delay(1000);               // wait for a second
      digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
      delay(1000);               // wait for a second
    }

  6. #6
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,778
    First, since you're using Windows, make sure you've run the Serial Installer program. It's available here:

    http://www.pjrc.com/teensy/td_download.html

    While Teensy is running that program, use the Windows Device Manager to find the serial port and learn which COM port number it is. You mentioned only COM1 appears in the Arduino Tools > Serial Port list. Rarely is COM1 a USB serial device. Usually COM3 is the first number Windows will assign. So before going back to Arduino, you need to verify Windows is seeing the port. The name will be "USB Serial (Communication Class, Abstract Control Model)". You can easily tell if it's from Teensy by just unplugging the USB cable to see if the device disappears, and then reappears when you plug the cable back in.

    When you see the COM port in the device manager, and then select that port in Tools > Serial Port, I'm sure it will magically start working.

    Alternately, with "beta8", you could select "Keyboard+Mouse+Joystick" from the Tools > USB Type menu. On Windows 7 there's a known bug where rebooting takes 10 to 15 seconds, so please be sure to wait for the upload to work. In this mode, Teensy becomes a Keyboard with emulated serial (so there's no COM port to select). The serial monitor should automatically work in that mode, no matter what is selected in the Tools > Serial Port menu.

  7. #7
    Junior Member
    Join Date
    Nov 2012
    Posts
    4
    Quote Originally Posted by PaulStoffregen View Post
    First, since you're using Windows, make sure you've run the Serial Installer program. It's available here:

    http://www.pjrc.com/teensy/td_download.html

    While Teensy is running that program, use the Windows Device Manager to find the serial port and learn which COM port number it is. You mentioned only COM1 appears in the Arduino Tools > Serial Port list. Rarely is COM1 a USB serial device. Usually COM3 is the first number Windows will assign. So before going back to Arduino, you need to verify Windows is seeing the port. The name will be "USB Serial (Communication Class, Abstract Control Model)". You can easily tell if it's from Teensy by just unplugging the USB cable to see if the device disappears, and then reappears when you plug the cable back in.

    When you see the COM port in the device manager, and then select that port in Tools > Serial Port, I'm sure it will magically start working.

    Alternately, with "beta8", you could select "Keyboard+Mouse+Joystick" from the Tools > USB Type menu. On Windows 7 there's a known bug where rebooting takes 10 to 15 seconds, so please be sure to wait for the upload to work. In this mode, Teensy becomes a Keyboard with emulated serial (so there's no COM port to select). The serial monitor should automatically work in that mode, no matter what is selected in the Tools > Serial Port menu.
    Thanks a lot. That worked perfectly. (now if only I can figure out why I didn't find that in the first place...)

  8. #8
    Junior Member
    Join Date
    Nov 2012
    Location
    SJ, CA
    Posts
    3
    bringing back an oldish thread...

    im having the same troubles. i cannot get the serial monitor working. Ive updated arduino to arduino 1.0.3, ive installed the serial installer program, and i have "keyboard+mouse+joystick" selected in Tools > USB type.

    im not sure what else to do.

    i am on windows 7. i cant find any COM port in the device manager. When i plug in the teensy the thing that comes up is a new section called "Human Interface Devices" and under it is a list of "HID-compliant device", "HID-compliant game controller", and then 4 of "USB Input Device". when i unplug the teensy that all goes away so im assuming thats the teensy. But plugged or unplugged i cannot find any COM port in the device manager.

    Also, when i do open the serial monitor its labeled "COM1" at the top left.

    and one more thing, if i do select "Serial" under Tools > USB type in the arduino IDE, the "Serial Port" menu under Tools is greyed out and i dont even have the option to try to select any serial ports. (When i select keyboard+mouse+joystick its still greyed out, but it says "serial port: emulated"

    hope this is enough info...

    any help?

    thanks.
    G
    Last edited by mohawkpiper; 01-14-2013 at 01:34 AM. Reason: spelling

  9. #9
    Hey guys, I had a similar issue with the Serial Monitor not displaying things that I was printing (using teensy 3.0 with Arduino 1.0.3 downloaded from PJRC). I read through a lot of forum discussion and tried many things (using Uart.print instead of Serial.print, trying serial2 or serial3, watching the COM port through a sniffer to figure out what was going on, adding sufficient delay after each print statement, etc.), and here's what I finally figured out. This may be obvious to everyone else, but to relative beginners like myself I hope this is useful:

    The teensy turns off the COM port when it starts running your program. If the COM port is off, there is no communication between the Teensy and your computer, period (even if you have serial.print statements in your code). When you open the Serial Monitor, this turns the COM port back on. On an regular Arduino (an Uno, for example), it seems to catch any serial print statements which happened between starting the program and opening the Serial Monitor. However, on the Teensy, if something was printed between when you started the program and when you open the Serial Monitor, only the information sent AFTER you opened the window is actually printed. So you have to have a long enough pause at the beginning of your program to allow yourself to open up the window before any serial.print statements.

    Even trickier, if you have uploaded the program already to the Teensy and opened the Serial Monitor, and then you press the physical reset button on the Teensy, guess what? Yep - COM port is off! Even though you have the Serial Monitor open, because you didn't open it since the Teensy restarted (which shut off the COM port), then COM port is off and no serial print statements will show up on the Serial Monitor.

    SO... If you want serial print to work:

    + Upload the program using the Arduino IDE
    + AND Ensure that you have a wait time (a few seconds delay) at the beginning of your program so you can open the Serial Monitor during that time (and, as stated in previous posts, a little delay after each print statement)
    + You CANNOT simply restart the Teensy using the restart button and expect to see anything on Serial Print if you had the Serial Monitor open before the restart - if you want to use the restart button, make sure to close your serial monitor and reopen it at the beginning of the program, thus turning on the COM port.

    This problem may seem simple and silly (it did to me, once I figured it out), but for beginners it can be very frustrating.

    Greg

  10. #10
    Junior Member
    Join Date
    Feb 2013
    Posts
    4
    Hi,

    I've been wasting some time on trying to get the "serial" functionnalties working, so I'll share my experience as well. If, just like me, you compile your own Linux kernel: do not forget to enable USB Modem support. If you are not sure it is enabled, you can check for a CONFIG_USB_ACM=y line in your kernel configuration file. If you don't have the support, /dev/ttyACM0 will never show up when you plug the board, regardless on how you compile our code.

    I hope it might help others.

    Regards,
    Shad

    P.-S.: I'm not using the Serial Monitor within the Arduino IDE, instead I use GNU screen on /dev/ttyACM0 and it works like a charm.

  11. #11
    Junior Member ARCHILA's Avatar
    Join Date
    Feb 2013
    Posts
    3
    hello, "sorry I do not speak English" I have a serious problem with my teensy 3.0

    I was working with the arduino environment, change USB Type: a raw HID, then appeared again hardware detection, and error installing HID device.

    and not recognized in any form or as serial com port or as HID, it seems that the embers damaged plate, I can do?

    Thank you!

  12. #12
    Junior Member ARCHILA's Avatar
    Join Date
    Feb 2013
    Posts
    3
    hello, please help!

  13. #13
    Junior Member
    Join Date
    Apr 2013
    Posts
    18
    I think what you are saying is that the COM port doesn't appear in the Serial list anymore?

    I had a related issue (No COM port assigned, different reason though), but I could still flash new code to the Teensy using the Teensyduino. Can you try the same with the USB Type selected as Serial this time?

  14. #14
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,778
    Teensy is not natively a serial device. There's more info here: (scroll to "No Serial Port While Programming")

    http://www.pjrc.com/teensy/troubleshoot.html

  15. #15
    I got this working after some pfaffing about. I'm running Eclipse Juno SR1, 32 bit, on a Windows 8 64 bit machine, with Arduino 1.0.5.

    I had to set the Project -> Properties -> Arduino -> USB Type to "Serial + Keyboard + Mouse + Joystick" and then restart Eclipse, verify the project, and then upload. Just uploading caused a "this can't happen" error. And then, when opening the serial monitor, it gave me a new COM port number.

    But it works, at last. Cheers to all those who've dealt with this problem before and paved the path.

  16. #16
    Junior Member
    Join Date
    Aug 2020
    Posts
    1
    Quote Originally Posted by happyinmotion View Post
    I got this working after some pfaffing about. I'm running Eclipse Juno SR1, 32 bit, on a Windows 8 64 bit machine, with Arduino 1.0.5.

    I had to set the Project -> Properties -> Arduino -> USB Type to "Serial + Keyboard + Mouse + Joystick" and then restart Eclipse, verify the project, and then upload. Just uploading caused a "this can't happen" error. And then, when opening the serial monitor, it gave me a new COM port number.

    But it works, at last. Cheers to all those who've dealt with this problem before and paved the path.
    Thanks, I could not get the teensy 3.5 to print to serial monitor but this worked. Having it just on Serial caused it to freeze. Setting it to Serial + Keyboard + Mouse + Joystick and its working fine now.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •