I've looked around a ton so it's probably not available but does anyone know if there is a usable core for the ATMega16u2 (the chip the Uno and Due uses for USB to Serial). I have a project I was going to use the 32u4 for but they aren't really available for several months and the 16u2 has all the functionality that I would really need.
Asked
Active
Viewed 469 times
0
-
["171 in stock"](https://www.sparkfun.com/products/12640) – Ignacio Vazquez-Abrams Jun 29 '14 at 15:24
-
I need the actual IC, NOT a board that already has it. – Adam Haile Jun 29 '14 at 15:25
-
:O I... I don't think I've ever seen so many 0s before... Newark has a few -MUs, but I think someone bought up the world's supply of -AUs. – Ignacio Vazquez-Abrams Jun 29 '14 at 15:40
-
Yup :( Was very dissapointed that basically no one has them... – Adam Haile Jun 29 '14 at 15:40
-
I think it's pretty much the same as the 32u4 but has less flash memory and less RAM. I think avr-gcc handles the RAM part. As for the flash memory, just copy and modify the atmega32u4 section in boards.txt to handle that. – Gerben Jun 29 '14 at 16:07
-
I forgot about the bootloader. But I think you can just recompile it for the atmega16u2 without many, if any, changes. – Gerben Jun 29 '14 at 16:08
-
Or use a programmer and forgo the bootloader entirely. – Ignacio Vazquez-Abrams Jun 29 '14 at 16:53
-
Don't need the bootloader actually. As long as it can be programmed via an ISP I'm good. – Adam Haile Jun 29 '14 at 17:15
-
3A thought just occurred to me. If a 16U2 will do, then why not use a 16U4 instead? All you'd need to change is the amount of flash available. And DigiKey has a few hundred of those in stock in -AU. – Ignacio Vazquez-Abrams Jun 30 '14 at 04:08
1 Answers
1
As @IgnacioVazquez-Abrams said, a 16u4 is virtually identical with a 32u4, so you can use a Leonardo or Micro core with a tiny modification to boards.txt. A 16u2 is a rather different animal, with fewer timers, many fewer pins, and no A/D converter, so you’d have to do a fair amount of editing to obtain a usable Arduino core.
That said, if you’re reasonably fluent in C++, building your own Arduino core is not very difficult, and I found it an instructive exercise. If you care about getting your project up as quickly as possible and not get sidetracked, however, go with the 16u4.
microtherion
- 1,492
- 8
- 19
-
You don't have to write the "@", it only functions in comments (it alerts that user). In questions or answers it has no function. – Joris Groosman Apr 27 '15 at 17:06