I've made a PCB which contains an Atmega32u4, and just finished soldering it up today. Now, I realised that I bought the wrong Atmega32u4 version - I bought the version which does not by default use its internal oscillator, but which does by default use the USB bootloader. So, I want to change the fuses of the microcontroller to instead use the internal oscillator, since I didn't include an external one on the PCB.
To do so, I downloaded MPLAB, and opened up the MPLAB IPE, then selected the device as "ATmega32U4", and the tool as "Snap" - it detected my SNAP programmer, as it tells me what its serial number is. I went into settings and set the interface to ISP, as this is the interface I included on my PCB (I'll show the schematic later in the post). Then, I went back to the Operate tab, and tried to verify the microcontroller with the Verify button. This returned the following message:
Configuring firmware mode...
Data transmission failed. Error code -112 returned while trying to send USB datat.
A communication error with the debug tool has occurred. The tool will be reset and should re-enumerate shortly.
Connection Failed.
Verify Failed
So it appears that the reason it's failing to verify is something to do with the communication between the computer and the SNAP programmer, rather than between the programmer and the PCB. Does this seem correct? I'm running the IPE on Linux, and have made sure to restart to allow any udev rules to work.
Here's the schematic:
The ISP header is J2. Are there any issues with this schematic?
The way I've connected the ISP header, J2, to the SNAP programmer board is as follows:
- J2 pin 1 -> SNAP pin 4 (MISO)
- J2 pin 2 -> SNAP pin 2 (VTG
- J2 pin 3 -> SNAP pin 5 (SCK)
- J2 pin 4 -> SNAP pin 7 (MOSI)
- J2 pin 5 -> SNAP pin 6 (RESET)
- J2 pin 6 -> SNAP pin 3 (GND)
I believe these connections are correct according to page 37 of the SNAP user guide.
Is there anything that could be going wrong here? I really hope I haven't made a mistake somewhere in the PCB!
Important info from comments:
The specific microcontroller I have on the board is the Atmega32u4-AU. The different models are described on page 422 of this document.
I've been thinking about this, and I think the question can boil down to should the Atmega32u4 be able to be programmed over the ISP header even if the MCU itself cannot run on its own clock. Is the ISP still able to program it and set its config bits to make it run on the internal clock?