Programming a Teensy via Win 7

Status
Not open for further replies.

UNTEngineer

Active member
Im having some issues getting the computer to recognize that the Teensy is a Serial Port, so I cant program the Teensy. I also ran into a strange problem with one of my USB cables heating up as soon as I plugged it into the Teensy (I resolved that issue by using another, shorter cable), but I still cant program the Teensy. I know its powered, because the led blinks just fine, and the other devices Ive got powered through the Teensy are all responding. How can I get Win 7 to recognize the device? Im using Arduino 0021 for my code.
 
Well I had it working fine on my Vista laptop. My Uno programs fine with the Arduino 0022. I'll try these new versions.

Yes, your Uno will run programs compiled with 0.22 and suchlike releases from four years ago. Equally, it runs fine with 1.0.2 released less than a month ago - and benefits from bug fixes. There is no particular beneit to running old beta versions when the Arduino platform has been out of beta for a year or two. You will need to watch out for some 0.22 0.23 to 1.0 changes (Wire.send renamed to Wire.write, Wire.receive renamed to Wire.read).

Teensyduino makes modifications to the Arduino binaries and thus, for safety, only works with specific versions of the Arduino codebase (1.0.1, 1.0.2).
 
Well I tried the latest versions with the Teensy, and still no luck on getting the computer to recognize the COM port. I hear that little sound when I unplug and plug in the Teensy, but Hardware Manager doesnt recognize anything. I know the Teensy itself is functioning because the blink program is running, so I dont have any idea what is wrong.
 
First, Teensy is *not* a serial port while programming. It works differently from Arduino Uno. There's more explanation here: (scroll to "No Serial Port While Programming")

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

Troubleshooting experience using Arduino Uno, where you "look for the serial port to program the code", simply does not apply to Teensy.

When running the bootloader and ready for programming (eg, after pressing the pushbutton), Teensy appears as a HID device with ID 16C0:0478. The Teensy Loader looks for this, not a serial port. You can look for it in the Windows Device Manager, but do not look under "Ports". Here's how to find it in the device manager:

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

Of course, the simplest thing to do is just run the Teensy Loader and watch the window. When you push the button, the loader should recognize the board and change the gray-blurry image to a clear, color image of the board. There's also a "verbose info" in the help menu (yes, it's hidden in a place nobody ever looks... the help menu) to show you more detailed info about what the Teensy Loader is seeing.
 
Last edited:
Also, when you program Teensy using Arduino, the Teensy only becomes a serial port when it boots up using your freshly programmed code. So you do NOT select the serial port from the Tools menu before programming. That's not necessary for programming, because in programming mode Teensy is a HID device that's automatically recognized by the Teensy Loader.

When Teensy becomes a serial port, you do need to select the port from the Tools > Serial Ports menu before opening the Arduino Serial Monitor.

However, Teensy can implement non-serial devices (a capability no Arduino board has). Select it from the Tools > USB Type menu. In the modes where Serial isn't selected, a special HID interface is used to emulate serial, so your sketch can still use Serial.print() to send to the Arduino Serial Monitor. You do not need to select the port (and you can't, because it's not a real serial port). Instead it's automatically detected and routed to the Arduino Serial Monitor.

Really, all this stuff should "just work"... but it does break down when people with years of experience troubleshooting traditional Arduino boards depend on the "everything is a serial port" model Arduino uses. Teensy can implement a serial port when the Tools > USB Type selects Serial... but it is not natively a serial port like Arduino.
 
Ok Ok. So I did find it under HID devices. And the loader totally recognizes it.

I set the USB Port Type as RAW HID, and it worked. I managed to upload one of the examples to the Teensy to verify uploading.

Thanks Paul. Its been awhile since I've used the Teensy's, I appreciate the setup reminder.
 
Last edited:
Well I'm still not getting anything over the COM port for serial communication. Im trying to setup this XBee to just send some Serial data for debugging. Is there something special I should be doing?

Im following the image just like it says with pins 2,3 on the XBee shield going to pins 7,8 on the Teensy.
 
Last edited:
Nothing. COM port isnt even being recognized by the computer.
Well, it won't be recognised as a Serial device until your program (which you uploaded to the Teensy) makes it become one. Remember this is a native USB device, not a 'serial over USB only' device like Arduino.
So, did you try to upload a program?
 
So, did you try to upload a program?

Uhh, yeah. I followed the advice that Paul posted. Uploading a program to it works. I got that, but now Im try to troubleshoot the COM port and Serial communications.

I can't parse your message. does Serial.print() work at all? if not, focus on that before the xbee.

I cant tell if Serial.print() works or not, because the COM port doesnt show up to feed data to the terminal. The code compiled and uploaded to the Teensy just fine (and it works for the most part other than the Serial output debug stuff), so I know the code is good. How should I be setting up the Terminal to view Serial data out of the Teensy?
 
I cant tell if Serial.print() works or not, because the COM port doesnt show up to feed data to the terminal. The code compiled and uploaded to the Teensy just fine (and it works for the most part other than the Serial output debug stuff), so I know the code is good. How should I be setting up the Terminal to view Serial data out of the Teensy?

I just went through these steps, on Win7, with the Device Manager open. Since it all works for me, could you go through them as well and say when what you see differs from what I see?

  • Open Device Manager
  • Launch the Teensyduino environment
  • Set board to Teensy 2, USB type to serial
  • Load Examples > Teensy > USB Serial > Hello World
  • Plug in Teensy. Device manager wil probably show an extra HID device (depends on what sketch was loaded before)
  • Compile, upload, press Teensy button
  • Device Manager now shows USB Serial (Communication Class, Abstract Control Model) (COMx)
  • (in my case that is COM5, see attached image)
  • Set Serial Port to that number
  • Open Serial Monitor
  • Hello World is printed
teensy-usb-serial.png
 
Same thing on Teensy 3.0, which re-used COM5. Apparently multiple USB Serial devices can share a USB Serial COM port number.
 
Try running the serial installer. Even if you're previously run it, the installer marks the registry device nodes to be refreshed by the new hardware wizard... so many of the funky problems that can happen with Windows get fixed when the unplug and reconnect.

The serial installer is on this page:

http://www.pjrc.com/teensy/td_download.html
 
Well, you've double checked Tools > USB Type is Serial, and it's obviously running the sketch, and the USB works because you can reprogram the board. Is that all correct?

When it's begins running the sketch, does *anything* new appear in the Windows Device Manager. It's obviously implementing a serial device, so something should show up.
 
Well, you've double checked Tools > USB Type is Serial, and it's obviously running the sketch, and the USB works because you can reprogram the board. Is that all correct?

When it's begins running the sketch, does *anything* new appear in the Windows Device Manager. It's obviously implementing a serial device, so something should show up.

Yes to the first three questions. The sketch gets uploaded fine and it runs just fine. The Device Manager shows it as a HID but not as a COM port. I should be able to get it to show up as a COM port to actually view something on the serial terminal. But its not doing that.
 
Status
Not open for further replies.
Back
Top