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

Thread: Teensy 4.0 breakout with Feather Adapter

  1. #1
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,481

    Cool Teensy 4.0 breakout with Feather Adapter

    At times I like to use Adafruit Feather wings and I use the Adafruit Teensy 3.2 -> Feather adapter:


    And for portable projects like my wooden bowtie with neopixel ring, I like to use the feather adapter even if I'm not using feather wings, because it has a JST-PH 2-pin adapter for a lipo battery, and in fact it will charge the battery while it is being powered by USB. In fact, I can use the on/off pin to turn off power to the Teensy proper, and the feather adapter will still charge the battery. This makes it useful for things like props, where I can take off the prop and set it up with a USB power source to charge the battery overnight. Even though there are other options (such as the onehorse board specifically for the Teensy), I like using the feather adapter, because the JST PH connector is much more firmly attached than soldering a JST PH connector to a breadboard is, and sometimes it is a tight fit to get the battery out. The only downside is the lack of an on/off pin, and the Teensy 4.0 provides one.

    Some notes about using the Teensy 4.0 in the feather adapter:
    • The Teensy 4.0 does not have a pin for AREF, so you should make sure the pin on the adapter for AREF is wired to 3.3v;
    • The Teensy 4.0 does not have a DAT output pin (A14 for the Teensy 3.2), which means if you connect the pin in that position (the on/off pin), you cannot use the first analog pin (but it would allow you to bring out the on/off pin to the feather wings.
    • While there are a lot of differences in pin layout between the Teensy 3.2 and 4.0, the pins that the feather adapter cares about (Serial1 0/1, I2C0 18/19, SPI 11/12/13) are the same, so within the limitations of the feather interface, it works fine.


    With the Teensy 3.2, there was enough room (0.2") between the Teensy and and the JST-PH connector for 2 rows of pins (2 x 7 pins). The FrankB ConnectorBoard was perfect to bring out the pins on the bottom pads, while maintaining a small size and allowing normal feather wings to be attached.:


    So with all of the Teensy 4.0 breakout boards that have been designed, I was wondering if one had been designed specifically to mount a Teensy 4.0 into a feather adapter. I didn't recall any.

    My thoughts would be:
    • Standard 14 pins on each side;
    • Standard 5 pins at the back;
    • Connector for VUSB;
    • 3.3v connection for AREF ;
    • Pad 24 to connect where the 3.2 has A10 (but the feather adapter doesn't really bring out this pin, so we might not need it);
    • Pad 25 to connect where the 3.2 has A11 (but the feather adapter doesn't really bring out this pin, so we might not need it);
    • Bring out pins 26-33 in two rows behind the Teensy (or bring out 24-33);
    • On the right side of the feather adapter, there are 6 pins (A7-A9, 3.3v, ground, VIN) that aren't used in the feather wing (most boards have their lipo adapter there), so we could grow the board by 1 or 2 rows. One row could be the SD pins, and the other row could be the USB out pins.

  2. #2
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,163
    Did you ever suggest that to Lady Ada?
    I imagine they'd be interested.

    p.s. Did you try the T4_PowerButton.h library?

  3. #3
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,481
    Quote Originally Posted by Frank B View Post
    Did you ever suggest that to Lady Ada?
    I imagine they'd be interested.
    No, I will. Good idea.

    Quote Originally Posted by Frank B View Post
    p.s. Did you try the T4_PowerButton.h library?
    No, I will, thanks for reminding me.

  4. #4
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,481
    Quote Originally Posted by Frank B View Post
    p.s. Did you try the T4_PowerButton.h library?
    I just tried it, and it works great. Thanks.

    Though now that it is much faster acting, I will have to better protect the button, so it doesn't get pressed by accident. Right now, I just have the button on top of the Teensy, where movement might press it by accident.

  5. #5
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,163
    Hm, it is possible to set a debounce time, up to 500ms (Page 1310, 19.6.11.4 SNVS_LP Control Register)
    You can try this and maybe leave the button where it is...
    If it works (have not tried it) I can add this setting to the lib.

  6. #6
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,481
    Quote Originally Posted by Frank B View Post
    Hm, it is possible to set a debounce time, up to 500ms (Page 1310, 19.6.11.4 SNVS_LP Control Register)
    You can try this and maybe leave the button where it is...
    If it works (have not tried it) I can add this setting to the lib.
    Thanks, I'll look into when I get home.

    Note, this is in a costume prop where I can't see the microprocessor normally. I had put the button on the top, and because of the current timeout without the T4_PowerButton library, I didn't have to worry about accidental presses. I need to move the button so it isn't likely to be pressed by accident.

  7. #7
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,163
    I've tested a bit and updated the library.
    500ms, half a second is not long, but maybe long enough to prevent accidential switch-off(?)

    example:
    Code:
    #include <T4_PowerButton.h>
    void pwr_off_callback() {
     // Serial.flush(); delay(100);
    }
    void setup() {
     pinMode(13, OUTPUT);
     digitalWriteFast(13,1);
     set_arm_power_button_callback(&pwr_off_callback);
     set_arm_power_button_debounce(arm_power_button_debounce_500ms);
     set_arm_power_button_press_on_time(arm_power_button_press_on_time_500ms);
    }
    
    void loop() {}
    From the header:
    Code:
    enum arm_power_button_debounce {
        arm_power_button_debounce_0ms = 3,    //No debounce
        arm_power_button_debounce_50ms = 0,    //50ms debounce (default)
        arm_power_button_debounce_100ms = 1,    //100ms debounce
        arm_power_button_debounce_500ms = 2    //500ms debounce
    };
    
    enum arm_power_button_press_time_emergency {
        arm_power_button_press_time_emergency_5sec = 0, // (default)
        arm_power_button_press_time_emergency_10sec = 1,
        arm_power_button_press_time_emergency_15sec = 2,
        arm_power_button_press_time_emergency_off = 3
    };
    
    enum arm_power_button_press_on_time {        //Time to switch on
        arm_power_button_press_on_time_0ms = 3,
        arm_power_button_press_on_time_50ms = 1,
        arm_power_button_press_on_time_100ms = 2,
        arm_power_button_press_on_time_500ms = 0 //(default)
    };
    
    [...]
    void set_arm_power_button_debounce(arm_power_button_debounce debounce);
    void set_arm_power_button_press_time_emergency(arm_power_button_press_time_emergency emg);
    void set_arm_power_button_press_on_time(arm_power_button_press_on_time ontime);
    Note, the times stay active - even after reset or, if a battery is connected.
    Last edited by Frank B; 02-03-2020 at 10:05 PM.

  8. #8
    Senior Member+ Frank B's Avatar
    Join Date
    Apr 2014
    Location
    Germany NRW
    Posts
    6,163
    Quote Originally Posted by Frank B View Post
    Did you ever suggest that to Lady Ada?
    I imagine they'd be interested.
    Quote Originally Posted by MichaelMeissner View Post
    No, I will. Good idea.
    What did they say?

    I have no experience with the Feather Boards, and I don't own one.
    But the idea sounds good. If I find some free time, I might take a closer look at it and see what can be done.

  9. #9
    Senior Member+ MichaelMeissner's Avatar
    Join Date
    Nov 2012
    Location
    Ayer Massachussetts
    Posts
    3,481
    I did suggest it over at the Adafruit forum, but I didn't hear anything. I didn't really expect to hear anything, since Adafruit has many different boards that the build themselves (feathers, circuit python, itsy bitsy, trinket, gemma/flora, metro, and such). In fact, I was in Microcenter tonight, and picked up 2 more adapters. I had hooked up my previous Teensy 4 for doing a wooden bowtie with a WS2812B (neopixel), specially to add the lipo power/charger support, but I had some issues when I tried to put some of the wings on (notably the wifi wing), so I want to redo the setup, to resolve some issues I had with the previous one (the on/off button interferes with putting wings on, and I need to pay better attention to making sure all of the pins are brought out).



    It would be nice if they could add a small bit of documentation about AREF and the DAC pin for the Teensy 4.

Posting Permissions

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