Migrating atmega328 progect to ATmega32U2

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

Hey all, considering an upgrade to my 328 with v-usb. Wondering the following?

 

1) On the ATmega32U2 Datasheet I do not see pc1 or pc3. Are they not available?

2) Would the on board 16mhz be enough to power the USB logic or is there an advantage to using an external clock?

3) Would running a usb bootloader be do-able? On my 328n with v-usb I put some code to handle a boot loader when a pin is grounded. Un-grounded it runs the main code. Any possible pit falls here?

4) I'm assuming this is a full hardware usb controller and does not need flash space?

5) does "Analog Comparators: 1" mean only one pin is available for ADC?

 

What I'm hopping to find A chip with.

C ports 0-7

B port 0-7

D port 0-7

At least 4 ADC ports on port C

USB full speed

32k or more flash

I'm looking for it all in one chip and understand I may not find it and have to use a co component.

 

 

 

 

 

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

You could look at the AT90USB646/1286

PA 0-7

PB 0-7 (SPI)

PC 0-7

PD 0-7 (USART)

PE 0-7 

PF 0-7 (ADC0-7)

I've run a USB bootloader in this chip (as well as the ATmega32U2) and USB applications.

The USB does require some flash for interrupts and data processing for the interface (I have used LUFA, but others are available)

You can do the "GND a pin" (HWB on PE2) to boot to bootloader.

I used an external 16MHz for the both USB1286 & 32U2 because I did not trust the internal 8MHz (factorycalibration ±10%, user calibration ±1%)

David

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

I'd just get an AT90USBKEY which is great value and comes with AT90USB1287 which is the most heavily loaded of all the Mega-USB chips. Develop on the top of the range then scale down the solution to the smallest chip that will accommodate it for the final implementation. 

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

Shirley you have been a member for 9 years,  you must know how to read the ATmega32U2 data sheet by now.

 

Page 77 has 12.3.2 Alternate Functions of Port C

 

Just like any other AVR,  peripheral functions appear on the pins.   You have to design your pin budget accordingly.

I would avoid using the PC1 (Reset) pin for GPIO.   Go for a 32U4 in a 44-pin package.   The pcb space is similar.

 

You would normally use a 12MHz crystal for USB.   Get power from USB.  Use the factory-installed DFU bootloader, ...

 

If you want to develop a project,  by a Leonardo or Pro Micro clone (which use 32U4).   Far easier than a bare chip.

 

David.