1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Teensy 3.2 & Noritake VFD

Discussion in 'Papers' started by Stéphane Lenclud, Jun 13, 2017.

  1. Stéphane Lenclud

    Stéphane Lenclud Founder Staff Member

    Purpose & Scope

    We will describe what it takes to switch from an Arduino Micro to a Teensy 3.2 to drive a Nortitake VFD module

    Port manipulation

    To efficiently send pixel bytes to our display we used the port C of our Arduino Micro.
    However port manipulation on Teensy 3.2 is quite different from Arduino Micro.
    To find out more I suggest you search its manual for GPIO.

    As seen below we used the port D of our Teensy 3.2.
    Using GPIOD_PDOR to write our byte.
    We attempted to use GPIOD_PDDR to configure our pins but that did not work somehow.
    Therefore we used pinMode to configure our pins, since its a one off setup operation it did not need to be optimised.

    Below we highlighted the relevant port D pins on the Teensy 3.2. schematics:

    upload_2017-6-13_1-5-36.png

    Notice we used pins 0 and 1 for our BUSY (input) and /WR (output) signals respectively.
    We took care of selecting a pin that's 5V tolerant for BUSY though I'm not sure which voltage that Noritake outputs.
    The Teensy 3.2 documentation does mention that only the digital pins are 5V tolerant.

    Raw HID

    On Arduino Micro we had to install that HID-Project library to be able to use Raw HID.
    However Teensydruino comes with it's own library for raw HID support so slight code changes will be needed.
    Though I found some code related to Teensy in HID-Project it would not compile so I had to switch to Teensy native raw HID.
    Oddly on Teensy instead of doing RawHID.begin you need to set the USB Type compile option to Raw HID for it to work.
    Please find the menu Tools > USB Type > Raw HID in Arduino IDE.

    Moreover Teensy 3.2 in Raw HID mode defines two HID devices, by default they are:
    • One being used as a virtual serial port with the following usage definition: 0xFFC9/0x0004
    • One that's actually our Raw HID device with the following usage definition: 0xFFAB/0x0200
    It means you have to be careful which device your are opening from your host computer since specifying solely Vendor ID and Product ID, as typically done with the popular signal11/hidapi, does not guarantee you will open the proper device. Opening the wrong HID device can cause your code to hang and freeze when trying to send an HID report, depending of your implementation.
    PJRC raw HID example however does indeed take care of matching the usage when opening the HID device.

    Results

    Interestingly our Teensy frame rate was slightly below our Arduino Micro frame rate.
    Also for the first 10 seconds or so after boot-up our Teensy frame rate average around 20 before settling to 27. It looks like the Teensy is busy booting up during that time.
    The pixels noise we noticed on Arduino is now gone.
     
    Last edited: Jun 13, 2017

Share This Page