Author Topic: USB HID chip (atmega32u4) cheaper, faster alternatives?  (Read 11859 times)

0 Members and 1 Guest are viewing this topic.

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
USB HID chip (atmega32u4) cheaper, faster alternatives?
« on: February 15, 2019, 12:38:08 am »
Hello,

I'm making USB keyboard, and was wondering is there a cheaper (under 3 USD) Atmega32u4 alternatives? Also would be nice to have more CPU power for LED animation calculations.

Maybe cheap (if there are any cheap chips) I2C to USB HID chips and STM32 MCU? I'm not familiar with this scenario, so any suggestions are welcome.

Thanks.

EDIT:
sorry, as usual I was dumb and didn't include all information that I should:
What I need from MCU:
USB support (HID keyboard)
7 fast switching regular digital outputs (not PWM)
5 regular digital inputs (optional - 5V tolerant)
I2C
Optional - 9 to 18 capacitive touch input pins
Optional - SPI

64k< program memory
48MHz<
~1K EEPROM (I noticed STM doesn't have EEPROM, so external IC for that is needed?)

I prefer it to be Arduino compatible.
« Last Edit: March 04, 2019, 01:03:08 am by 3dgeo »
 

Offline NorthGuy

  • Super Contributor
  • ***
  • Posts: 3325
  • Country: ca
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #1 on: February 15, 2019, 12:47:02 am »
PIC16F1454 is about $1. Probably too small, but certainly can do I2C.
 

Offline ataradov

  • Super Contributor
  • ***
  • Posts: 12012
  • Country: us
    • Personal site
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #2 on: February 15, 2019, 12:57:49 am »
SAM D11. ~$1 and way more powerful.
Alex
 

Offline bobaruni

  • Regular Contributor
  • *
  • Posts: 156
  • Country: au
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #3 on: February 15, 2019, 02:06:04 am »
STM32F042 is around USD $2 or AUD $3.
It has crystal-less USB, built in USB bootloader and no resistors or diodes are required for the USB interface but you will need a small 3.3v reg!
« Last Edit: February 15, 2019, 02:09:20 am by bobaruni »
 

Offline wraper

  • Supporter
  • ****
  • Posts: 18224
  • Country: lv
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #4 on: February 15, 2019, 02:16:26 am »
Silabs EFM8UB series, Starting from about $0.75 @ qty of 1, crystal-less and has built in 3.3V 100mA vreg.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2296
  • Country: au
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #5 on: February 15, 2019, 02:24:50 am »
Hello,

I'm making USB keyboard, and was wondering is there a cheaper (under 3 USD) Atmega32u4 alternatives? Also would be nice to have more CPU power for LED animation calculations.

Maybe cheap (if there are any cheap chips) I2C to USB HID chips and SMT32 MCU? I'm not familiar with this scenario, so any suggestions are welcome.

The SiLabs EFM8UB3 has 40k of Flash, and a 48MHz CPU speed.
Lists ~ 93c/1k
EFM8UB1 is even cheaper, but has less code space and it sounds like you may need more code space if you are 'adding features'
 

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #6 on: February 15, 2019, 01:24:37 pm »
Thank You all for help,
Sorry  :palm: I forget to mention – it should be Arduino compatible.
 

Offline tsman

  • Frequent Contributor
  • **
  • Posts: 599
  • Country: gb
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #7 on: February 15, 2019, 02:18:06 pm »
Thank You all for help,
Sorry  :palm: I forget to mention – it should be Arduino compatible.
If that is a requirement then a cheap "Bluepill" STM32F103 board and STM32duino.
 

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #8 on: February 15, 2019, 02:59:50 pm »
Thank You all for help,
Sorry  :palm: I forget to mention – it should be Arduino compatible.
If that is a requirement then a cheap "Bluepill" STM32F103 board and STM32duino.

It's not a requirement, but for now it's a bit too big of a jump to use other ecosystem, and I want to spin out 100-300 units of the 1st version and let users to reprogram it easily if they have need to do so. I guess it's not the end of the world to use Atmega32u4 for version 1.0, but I definitely will be using other controller on v2.0. It's a bit intimidating to start to work with other ecosystems, I don't know where to start.
 

Offline PCB.Wiz

  • Super Contributor
  • ***
  • Posts: 2296
  • Country: au
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #9 on: February 15, 2019, 09:51:28 pm »
Maybe cheap (if there are any cheap chips) I2C to USB HID chips ...

There is SiLabs CP2112  = I2C to USB HID chip ?, or slightly more FT260 is faster i2c choices, and includes a HID UART channel too ?
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 4055
  • Country: nl
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #10 on: February 20, 2019, 03:15:11 am »
I'm with TSman.
For "arduino" combatibility the cheap "Bluepill" STM32F103 boards seem a very good choice.

You can start with breadboard compatible modules, and later move on to bare TQFP chips.
The Price/performance ratio of this chip is exceptionally good and the STM32 chips are also used in a lot of the cheap products from Ebay / Ali / China.
 

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #11 on: February 20, 2019, 11:06:31 am »
I'm with TSman.
For "arduino" combatibility the cheap "Bluepill" STM32F103 boards seem a very good choice.

You can start with breadboard compatible modules, and later move on to bare TQFP chips.
The Price/performance ratio of this chip is exceptionally good and the STM32 chips are also used in a lot of the cheap products from Ebay / Ali / China.

Is it hard to make STM32 as a HID? Keyboard HID in particular?
 

Offline exe

  • Supporter
  • ****
  • Posts: 2671
  • Country: nl
  • self-educated hobbyist
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #12 on: February 20, 2019, 11:34:34 am »
Is it hard to make STM32 as a HID? Keyboard HID in particular?

I did that, stm32f103 is natively supported by qmk (probably other stm32 chips too, if you have spare time to figure out how to do that). But it's not arduino. I dunno how many keyboards you want to make, but I suggest save your time and just buy part that will work for you. Otherwise you may spend weeks just to save $3.
 

Offline magic

  • Super Contributor
  • ***
  • Posts: 7570
  • Country: pl
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #13 on: February 20, 2019, 01:02:38 pm »
If you need a cheaper and smaller atmega32u4, there is the at90usb162. It can work self-powered from USB using only a few passives and it will run all your software with minimal modification, subject to memory limits and at the same speed.
 

Offline exe

  • Supporter
  • ****
  • Posts: 2671
  • Country: nl
  • self-educated hobbyist
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #14 on: February 20, 2019, 01:04:53 pm »
btw, they are cheaper on aliexpress. Obviously, quality cannot be guaranteed.
 

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #15 on: February 20, 2019, 07:04:04 pm »
I want to make at least 100 of them, I have few "blue pills" from ALI, they work just fine (didn't try USB compatibility), but for V1 ATmel32U4 will be enough, V2 definetly with STM32. Can You link tutorial how to set up STM32 USB HID?
 

Offline martinayotte

  • Regular Contributor
  • *
  • Posts: 64
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #16 on: February 20, 2019, 08:50:55 pm »
I want to make at least 100 of them, I have few "blue pills" from ALI, they work just fine (didn't try USB compatibility), but for V1 ATmel32U4 will be enough, V2 definetly with STM32. Can You link tutorial how to set up STM32 USB HID?
On stm32duino.com forum, there was discussions/posts about HID Composite Library, the thread is 15 pages long ...
http://stm32duino.com/viewtopic.php?f=13&t=2926&hilit=HID+Keyboard
And this one as a followup, with thread of 3 pages :
http://stm32duino.com/viewtopic.php?f=9&t=3994&p=48224&hilit=HID+Keyboard#p48224
The code of the library is there :
https://github.com/arpruss/USBComposite_stm32f1
« Last Edit: February 20, 2019, 08:53:34 pm by martinayotte »
 
The following users thanked this post: 3dgeo

Offline technix

  • Super Contributor
  • ***
  • Posts: 3508
  • Country: cn
  • From Shanghai With Love
    • My Untitled Blog
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #17 on: February 27, 2019, 05:28:39 pm »
I have some example code for using STM32F042 in USB HID mode.
 

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #18 on: March 04, 2019, 01:01:58 am »
I have some example code for using STM32F042 in USB HID mode.

Hey, would be awesome if you share it. I made a prototype with 32U4, but it's just too slow, I have to upgrade to STM32.
What I need from MCU:
USB support (HID keyboard)
7 fast switching regular digital outputs (not PWM)
5 regular digital inputs (optional - 5V tolerant)
I2C
Optional - 9 to 18 capacitive touch input pins
Optional - SPI

64k< program memory
48MHz<
~1K EEPROM (I noticed STM doesn't have EEPROM, so external IC for that is needed?)

If I can eliminate capacitive touch IC and replace 32U4 with STM32F103C8T6 it would be perfect.

BTW, to make STM32 "blue pill" as HID keyboard was waaaaaaay easier than I expected, it's as simple as burning a bootloader as described in a video below (burning bootloader is optional, I burn it cos I don't want to use FTDI) and using USB Composite library for STM32F1, I don't know why but I thought it will be way harder to migrate to STM32. I should went with STM32 from the start... You live you learn  ;D

The last thing I need to finalize functionality of my software is to add multimedia keys support, but as I understand it's not a same thing as HID keyboard.


« Last Edit: March 04, 2019, 08:43:00 pm by 3dgeo »
 

Offline Scrts

  • Frequent Contributor
  • **
  • Posts: 800
  • Country: lt
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #19 on: March 04, 2019, 02:29:23 pm »
Hey, would be awesome if you share it. I made a prototype with 32U4, but it's just too slow, I have to upgrade to STM32.
What I need from MCU:
USB support (HID keyboard)
7 fast switching regular digital outputs (not PWM)
5 regular digital inputs (optional - 5V tolerant)
I2C
Optional - 9 to 18 capacitive touch input pins
Optional - SPI

I'm just curious: what GUI interface and libraries do you use on host side? I'd guess its Windows. Did you develop app for that as well?
 

Offline 3dgeoTopic starter

  • Frequent Contributor
  • **
  • Posts: 289
  • Country: au
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #20 on: March 04, 2019, 03:15:21 pm »
I'm just curious: what GUI interface and libraries do you use on host side? I'd guess its Windows. Did you develop app for that as well?

Additional libraries (GUI) are not required if the MCU (in this case 32U4 or STM32F103) supports HID, OS automatically recognizes it as a Keyboard or other HID device that you specify when coding. But I plan to create a special OS gadget with Visual Studio.

Beja, sveikas.
 

Offline plogue

  • Newbie
  • Posts: 9
  • Country: fr
Re: USB HID chip (atmega32u4) cheaper, faster alternatives?
« Reply #21 on: March 05, 2019, 07:42:50 am »
STM32F103 could be a nice option as it has plenty of I/Os, flash & RAM. You might even get the cheaper clones (I haven't tried them yet) like the GD32F103 or the CS32F103.
 



Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf