How to add XTAL for this chip?

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

I want to programing this ATmage32u4:

 

but I found there was only pin16(XTAL1) been extended as DIP pin, I found a photo here - https://circuitdigest.com/microc...

 

 

Is that OK?

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


If you want to arrange for a mega32U4 to be clocked why are you looking at circuits for a mega16 ? When I type "atmega32u4 schematic" into google it returns results such as:

 

https://electronics.stackexchang...

 

which has:

 

 

The key thing here being what is connected to pins 16 and 17.

 

Note that most AVRs would also require you to connect up programming pins to do ISP as you would need to change the CKSEL fuses to say "enable the crystal". But the 32U4 is a USB chip that expects to be clocked by either an 8MHz or a 16mHz crystal by default so it should already have the CKSEL fuses set correctly. So just using the clock circuit in this diagram should be enough. It should contain the DFU bootloader by default so if you connect both the clock and the USB then you should find you can program it using Flip! talking to the DFU bootloader - so you don't actually need ISP to program it. However, if you want you could wire up to either its ISP or its JTAG pins and program it using one of those two methods (but be warned, if you do, you will probably wpie the DFU bootloader that is already programmed into it).

 

(Life is much simpler if you just get an Arduin based on the 32U4 in which case it already has clock, power supply, USB connection and working programming method).

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

The chip probably be used, how could I know it has DFU bootloader or not? And, if it hasn't, how could I burn the DFU into it?

 

clawson wrote:
Life is much simpler if you just get an Arduin based on the 32U4

I think my job is to build an Arduino Leonardo(based on the 32u4), so could I achieve this goal by programming the chip a bootloader in Arduino IDE?

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

Just buy a real Leonardo clone e.g. https://www.ebay.co.uk/itm/25331...

 

Or a Pro Micro clone e.g. https://www.ebay.co.uk/itm/31327...

 

Since you have chosen a 32U4 I assume that you will be soldering it to a proper pcb complete with XTAL and USB socket.

It is easiest to solder the SMD chip first.   Then program the Application via the factory DFU bootloader.

 

If you want to replace the factory DFU with the Leonardo Caterina Bootloader you will need an external ISP programmer e.g. USBASP https://www.ebay.co.uk/itm/27464...

 

Programming an SMD chip in a clam-shell is extremely inconvenient.   You have to provide an external XTAL1 clock signal.

Much easier when soldered on its target pcb.

 

David.

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


Have you studied the resources - datasheet, application notes, etc - on the Product Page:

 

https://www.avrfreaks.net/commen...

https://www.avrfreaks.net/commen...

 

MianQi wrote:
ATmage32u4

when searching, it will help to spell the part number correctly: ATmega32u4 ...

 

wink cheeky

 

It fooled me for a moment:

 

I think (sic?) my job is to build an Arduino Leonardo

You "think" ?

 

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...
Last Edited: Thu. Apr 22, 2021 - 01:22 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

awneil wrote:
think

 

Someone let me to test why he couldn't program this chip, I tested by Multi-meter, the IC adapter is DIP40, and to these 40 pins, it just connected 35 of them, one of the XTAL pin(#17) was not broke out, so I asked if it is possible I just connected one XTAL pin for programming.

 

Since he told me the chip couldn't be identified in PC, while the other same one for comparing could, so I guess the bootloader was flushed by former programming, so I think maybe the convenient way to use this chip maybe ISCP programming it in Arduino IDE as Leonardo, since Arduino Leonardo based on it, then programming it by USB in Arduino IDE.

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

If it's ISP you are attempting then the CPU needs to be clocked for this to work. If it has been fused for a crystal (which 32U4s are by default) but there is no crystal you won't be able to do ISP. However, as my tutorial article about recovering "locked" AVRs will tell you if you are in the situation where a chip is looking for some kind of external clock then usually you can simply present a full swing square wave to the XTAL1 so it is enough for the ISP session to succeed. The only caveat is that ISP itself must be run at 1/4 or less of what ever clock frequency is applied. The article gives various ideas for generating such a clock.