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

Thread: Using usb as serial port and for uploading code

  1. #1

    Using usb as serial port and for uploading code

    I'm sure this is explained somewhere here - but haven't found it yet!

    My project will be with a Teensy3.5 and I'd like to use the USB connector with which code is uploaded as a serial port for the sketch the chip is running. I currently use a CP2104 to get usb/serial data from a Processing sketch on a PC to an Arduino - but it seems with the Teensy I could skip the CP2104.

    So if the Teensy is running my sketch, and I want to reload a new version - how do I switch the context of the USB connector?

    Tks!

    =A.

  2. #2
    Senior Member vjmuzik's Avatar
    Join Date
    Apr 2017
    Location
    Florida
    Posts
    374
    Strictly speaking a Teensy is completely different from how a standard USB to UART adapter works, you can program it to do the same function however. To program a Teensy you don’t have to put it into any kind of special mode, all of that is handled by the boot loader which in most cases gets activated when you click upload on Arduino through the Teensyduino addon. However in situations where your Teensy is either frozen or you have some other code that bypasses the auto detect for the boot loader there is a program button on board that you can press to put into programming mode.

  3. #3
    Senior Member vjmuzik's Avatar
    Join Date
    Apr 2017
    Location
    Florida
    Posts
    374
    You can also run your whole processing sketch on the Teensy instead of just forwarding the messages to a separate Arduino.

  4. #4
    Quote Originally Posted by vjmuzik View Post
    You can also run your whole processing sketch on the Teensy instead of just forwarding the messages to a separate Arduino.
    WOW! How does that work? Is there a version of Processing for ARM/Cortex?

  5. #5
    Thanks for those details. I’m just beginning to “get” the wonders of the Teensy world. Wish I’d woken up to it about 3years ago... would have saved a lot of grief… LOL!

    Quote Originally Posted by vjmuzik View Post
    Strictly speaking a Teensy is completely different from how a standard USB to UART adapter works, you can program it to do the same function however. To program a Teensy you don’t have to put it into any kind of special mode, all of that is handled by the boot loader which in most cases gets activated when you click upload on Arduino through the Teensyduino addon. However in situations where your Teensy is either frozen or you have some other code that bypasses the auto detect for the boot loader there is a program button on board that you can press to put into programming mode.

  6. #6
    Senior Member vjmuzik's Avatar
    Join Date
    Apr 2017
    Location
    Florida
    Posts
    374
    I didn’t understand what Processing was, now that I do, I meant you could run your Arduino sketch on the Teensy instead of using the Teensy to transmit the serial messages to an Arduino. Which is probably already what you were trying to do in the first place by switching to Teensy.

Posting Permissions

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