ATMEL AtMega16U4

On April 10, 2012, in Misc, by Cmc

About one week ago I stumbled on very interesting problem about one of the ATMEL microcontrollers. When I was writing TWI using code for 32u4 series witch worked, I was unable to make the same code compile for 16u4.

Digging a little deeper, I was unable to find a solution for my problem. But when I decided to ask about it from avrfreaks forum, it started to surface that the problem might not be mine to begin with.

The first response to my query was that AtMega32u4 has broken TWI. I could not agree with that since I just used the same hardware from the same micro.

But the responses from the forum were really helpful. Firstly I got a response from someone from AVR tool chain team (Dean, thank you for the response) that it might be oversight from them.

Also there are some extra things to worry about. The AtMega32/16u4 chips have still some problems with TWI hardware. From the datasheet under “ATmega16U4/ATmega32U4 Rev A” one can find information about TWI malfunction.

“1. Spike on TWI pins when TWI is enabled
100 ns negative spike occurs on SDA and SCL pins when TWI is enabled.
Problem Fix/work around
Enable ATmega16U4/ATmega32U4 TWI before the other nodes of the TWI network.”

I wonder if this might become a problem for me later on? For now it seems to be a little inconvenience that does not change the overall design process much.

Sadly I have to be ready for ATMEL-s response (if any) about this problem. The forum posts also pointed out a possibility of this being a part of deeper problem about the TWI hardware. If it does not work I might have to change the projects main micro. That would not be a fun thing to do. The only alternative posted was using something from the XMega series. Sadly that would mean changing the pcb design to 3.3V.

The development board I am using right now is design of Erik Ilbis (A5D)

A5D designed AtMega Development board. (teensy clone)


Best regards to the avrfreaks, A5D and all the others,


Tagged with:

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>