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

Thread: Teensy2.0 and Teensy2.0++

  1. #1

    Teensy2.0 and Teensy2.0++

    I want to make a custom keyboard. It will have 6 rows and 18 columns, so I need 24 digital in pins for that. That seems to work out ok since the teensy2.0 and teensy2.0++ both have more than 24 i/o pins.

    I also want macro functionality. I.e., somewhere an array of scancodes is stored, and when the macro key is pressed, that array is iterated and the scancodes sent over usb to the computer.

    Now, when programming the teensy, does it upload your program to flash or eeprom? I would like to use the entire flash for macros if possible, and eeprom for keyboard firmware.

    I will be programming my own custom keyboard firmware.



    In case the teensy by default uploads your program to flash, is there any way to override that decision? As in, force reprogram the eeprom and leave flash storage alone?

  2. #2
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,082
    On those older 8 bit boards, code can only execute from flash. The processor can not execute instructions from any other type of memory.

    If you want a large memory, perhaps consider using the newest Teensy 4.1. It has 8M flash (64 times as much), and the price is similar to the old Teensy++ 2.0.

  3. #3
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,082
    Something else you can get with Teensy 4.x is 8X lower latency. Teensy 4.x has 480 Mbit USB, where the HID polling interval can be set (by editing usb_desc.h) as low as 1 microframe. So you can get the PC to poll for keyboard state changes 8000 times per second.

    With 12 Mbit USB on Teensy 2 or 3, the fastest possible HID polling interval is 1000 times per second.

  4. #4
    Thanks for your help. I think I'll be fine with 1ms max latency vs 0.125ms. I'm thinking of getting the teensy2.0++ and then using half of the flash for the program. the other half for reading/writing macros.

  5. #5
    Senior Member PaulStoffregen's Avatar
    Join Date
    Nov 2012
    Posts
    22,082
    After loading your program on Teensy++ 2.0, the flash memory is read-only. If you want to write macros at runtime, the eeprom memory is the only option on that board. Those old chips have a lot of limitations built into the hardware.

    Why are you so choosing to use the oldest hardware? The newer boards offer so much more at about the same price.

  6. #6
    Quote Originally Posted by PaulStoffregen View Post
    After loading your program on Teensy++ 2.0, the flash memory is read-only. If you want to write macros at runtime, the eeprom memory is the only option on that board. Those old chips have a lot of limitations built into the hardware.

    Why are you so choosing to use the oldest hardware? The newer boards offer so much more at about the same price.

    Since my keyboard will have a custom layout due to the macro keys, I will have to make a custom pcb (I don't feel like loose wiring the matrix). Combine that with the fact that shipping to the Netherlands is very expensive, and the retails is marked up very high, (and I don't have a credit card so I can't directly order off of pjrc) I thought I would just buy the micro controller separately and integrate it directly in my pcb.

    I believe the commandline tool avrdude gives me control over setting or not setting the program protect/lock bits, so that the flash remains writable. The chips advertise write-while-read, so it must be possible.

    Although from your answers it's starting to look like I'm better of buying the microcontroller found in the teensy4.0 and using that.

Posting Permissions

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