ATMEGA32 + V-USB vs ATMEGA32U4 ?

Go To Last Post
20 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,

 

I want to make a macro keyboard

 

- have up to 10 buttons

- use a oled display

- address 10 ws8212b leds

- it will I/O midi (send midi events or receive sysex)

 

I first aimed at an ATMEGA32 and having a USB stack with the V-USB library

 

https://www.obdev.at/products/vu...

 

then I noticed there is an ATMEGA32UA with integrated USB

 

which solution would be best ? I see the USB port can be used for programming, but I intend to do it via ISP

 

I guess an integrated usb peripheral would be best, but I feel there could be a catch (apart from the price difference)

 

thanks for your advice's around this

 

Phil

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

V-USB is "bit-banged" - isn't it?

 

The  ws8212b will also require bit-banging, with some fairly tight tolerances.

 

I think trying to do both of them would be asking for trouble - get a proper USB device.

 

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Not too sure what a macro keyboard might be.

 

If you want to permanently communicate with a PC via USB the 32U4 is a better choice.

 

If it is a self contained item that only talks MIDI it does not matter if there is USB or not.   You only want a PC when you initially program the firmware (with an external programmer).

 

David.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

a macro keyboard is sending combinations of keys or send a whole text file or anything you want to the pc like if you were typing it

 

in my case it's not an HID pc keyboard but a midi controller so maybe I should not have used that term

 

since I MIDI is sent over usb, I actually need a usb port

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

indeed I have'nt thought of that...I wont be needing to update the rgb leds while I receive midi, so can CLI while I update the leds I guess

 

But, can the boot loader be deactivated ? I dont want the same bs as on an arduino, waiting for 8 seconds before my program starts or interfering with my midi devices

Last Edited: Sun. Mar 28, 2021 - 11:49 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

8 second startup??

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:

V-USB is "bit-banged" - isn't it?

 

The  ws8212b will also require bit-banging, with some fairly tight tolerances.

 

I think trying to do both of them would be asking for trouble - get a proper USB device.

 

I agree.  If you are going to use V-USB, find a ws8212 library that (ab)uses the AVR hardware SPI.

 

I have no special talents.  I am only passionately curious. - Albert Einstein

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ralphd wrote:

awneil wrote:

V-USB is "bit-banged" - isn't it?

 

The  ws8212b will also require bit-banging, with some fairly tight tolerances.

 

I think trying to do both of them would be asking for trouble - get a proper USB device.

 

I agree.  If you are going to use V-USB, find a ws8212 library that (ab)uses the AVR hardware SPI.

 

 

or the other way around

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

phil1234567 wrote:
V-USB library

 

https://www.obdev.at/products/vu... 

I don't think that any of the reasons stated there for choosing V-USB over a proper USB-equipped microcontroller are relevant here:

Objective Development Software GmbH wrote:
Advantages over Microcontrollers with USB Hardware

  • Standard AVR controllers are usually easier to obtain.
  • Most of the controllers with USB support are only available in SMD, which is almost impossible to handle for hobbyists.
  • V-USB comes with a free shared Vendor- / Product-ID pair.
  • A good free ANSI-C compiler (GNU gcc) and a free development system for Windows (WinAVR) are available for AVR.
  • AVR controllers are faster than most of the controllers with integrated USB and cost less.
  • Stand-alone operation: Some of the USB controllers download their firmware from the host computer into RAM. They don’t work without connection to the host.
  • AVR controllers have on-chip EEPROM.

(in fact, not sure that most of them are relevant at all nowadays?)

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok...I'll order a u4

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ralphd wrote:
... the AVR hardware SPI.
in follow-on AVR :

Advanced Examples | Getting Started with Configurable Custom Logic (CCL)

[bottom]

...

... interfacing the CCL and SPI peripherals with the WS2812 LED.

...

 

"Dare to be naïve." - Buckminster Fuller

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

CCL being ??

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

phil1234567 wrote:
CCL being ??

This:

gchapman wrote:
in follow-on AVR :

Advanced Examples | Getting Started with Configurable Custom Logic (CCL)

[bottom]

...

... interfacing the CCL and SPI peripherals with the WS2812 LED.

...

 

Top Tips:

  1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
  2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
  3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
  4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
  5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
  6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

phil1234567 wrote:
being ??...

...explained here:

 

http://ww1.microchip.com/downloa...

 

(it's like a very small CPLD/FPGA available within the AVR - right back at the start of AVRs there were models of AVR with VHDL programmable CPLD areas but it never really caught on but now the recent Microchip made AVR releases have resurrected a small scale version of the idea with "Configurable Custom Logic")

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

what I really wanted to know if I could disable the Atmega32u4 bootloader

 

I want to use the ISP pins and keep the usb part only for the midi over usb part

 

 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

USB chips are usually fused for HWBE anyway so it won't activate the bootloader unless you assert the HWB pin anyway. But, sure you can ISP it and clear both HWBE and BOOTRST and then it will always boot to 0x0000 no matter what happens on HWB.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

ok thanks, just what I wanted to know :-)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

V-USB and similar bit-banged implementations are rumored to be failing at an increasing rate as hosts move to USB3-capable controllers.  (See the big "Deprecation Warning" Adafruit has on their own VUSB products:  https://www.adafruit.com/product... )
 

V-USB was always "low speed" USB, so I'm not entirely sure it would have ever worked corrected as a MIDI device.