Hi, I am using Arduino with ATmega328 by this minimal schematic. There are only 1 capacitor and 1 resistor, 8MHz crystal is integrated in atmega.
Now I need Arduino with native USB (FTDI FT232 is expensive and complicated to soldering). I found Arduino Micro which have ATmega32u4. Official schematic have a lot of components.
I want power only over USB, and I need I2C and SPI (for Wiznet W5500 Ethernet). Is possible to use internal 8MHz crystal?
I try to modify schematic (in attachment). Is it good/workable? Can you please check it?
RC oscillator is no good for anything requiring precise timing, so I'd say add a crystal
or you'll probably not get USB working.
Keep all the components around the USB side of things, keep decoupling caps and reset
circuitry. You can probably simplify most of the power circuitry if you are just running
USB powered, and lose things like the LEDs.
martin159:
Hi, I am using Arduino with ATmega328 by this minimal schematic. There are only 1 capacitor and 1 resistor, 8MHz crystal is integrated in atmega.
Now I need Arduino with native USB (FTDI FT232 is expensive and complicated to soldering). I found Arduino Micro which have ATmega32u4. Official schematic have a lot of components.
I want power only over USB, and I need I2C and SPI (for Wiznet W5500 Ethernet). Is possible to use internal 8MHz crystal?
I try to modify schematic (in attachment). Is it good/workable? Can you please check it?
I will be happy for your views.
Looks mostly OK to me, but I have a few comments:
D2 is not needed (but won't do any harm either). It was needed on the Uno, but only because there is a capacitor on the Uno connecting the reset pin to the USB interface mcu, which meant that the reset pin could be driven above +5V.
You need to connect Vcc to Vcc1, which is implied in your diagram but not very clear
dc42:
You do need to use a crystal (and not a ceramic resonator) to make the USB work reliably in most USB modes of operation.
That's what I thought, thanks for confirming my educated guesswork. In general I treat
quartz accuracy as de-rigeur in all logic applications - omitting a crystal is a cost-cutting
exercise when doing volume production of something really cheap and non-critical
dc42:
You do need to use a crystal (and not a ceramic resonator) to make the USB work reliably in most USB modes of operation.
Depends on the baud rate. The internal RC oscillator should work fine for serial/UART comms at =< 9600bps. Up to 38400 may also be possible (but not guaranteed). EDIT: oh, I see this is for the ATmega32u4 and USB, and USB is going to be much more picky than serial. Nevermind.
Anyway, if high speed asynchronous baud rates are important, 8MHz is the wrong speed to be running at, even with a crystal. WormFood's AVR Baud Rate Calculator Ver. 2.1.1 shows more appropriate clock rates like 7.3728MHz or 14.7456MHz.
As for the OP, synchronous I2C at 100 or 400kHz won't care one bit about a little clock error. I expect synchronous SPI with the Atmega as master would also work 100% reliably. The only situation I could see SPI having trouble on the internal RC oscillator is when the Atmega is the slave and you try to run it at fOSC/2.
The OP is talking about using an atmega32u4 to interface to USB directly. USB timing is far more critical than serial comms in most modes. See the bottom of http://www.beyondlogic.org/usbnutshell/usb2.shtml/.
On ATmega32u4 package (image below) I see a lot of +Voltage and GND.
Is it importatnt to connect it together?
Vcc - pins 34 and 14 each on other side of package
GND - pins 15, 23, 43
AVCC - pins 24 and 44
these pins have the same name. Is it possible to connect only one of this? For example 14 to +5V and 43 to GND?
AVCC is for ADC? I do not want to use ADC converter. Can I ignore AREF and AVCC?
What about UVcc (pin 2) and UGnd (pin 5) and VBUS? Can/must I connect UVcc and VBUS to VCC? When I use +5V from USB, is it possible to conect +5V to ATmega only on one of these pins?
L-C between Vcc and Avcc is only for ADC converter? Can I ignore this?
martin159:
Why I must connect Vcc to Vcc1 and Avcc to Avcc1?
The manufacturer has provided multiple pins for good reasons. One of these is to ensure that there is a low impedance between the insides of the chip and the decoupling capacitor(s). You might get away with connecting only one Vcc and one Avcc pin, but I advise against trying it. I strongly advise agaist connecting only one ground pin. You should use a ground plane anyway, so connecting all the ground pins should be straightforward.
martin159:
AVCC is for ADC? I do not want to use ADC converter. Can I ignore AREF and AVCC?
You can ignore Aref, but you must still connect Avcc to +5V.
martin159:
What about UVcc (pin 2) and UGnd (pin 5) and VBUS? Can/must I connect UVcc and VBUS to VCC? When I use +5V from USB, is it possible to conect +5V to ATmega only on one of these pins?
I suggest you read the datasheet to see exactly what these pins are for and how to connect them.
martin159:
L-C between Vcc and Avcc is only for ADC converter? Can I ignore this?
You have true. I must connect UVCC, AVCC, VCC and VBUS to +5V.
There is another discussion about ATmega32u4 and minimal USB board.
In datasheet in section 21.3.1 Bus Powered device is schematic (attachment).
Theoretically is possible to use internat RC oscillator instead of external crystal.
Look at section 21.4 Crystal-less operation:
To reduce external components count and BOM cost, the USB module can be configured to
operate in low-speed mode with internal RC oscillator as input source clock for the PLL. The
internal RC oscillator is factory calibrated to satisfy the USB low speed frequency accuracy
within the 0°C and -40°C temperature range.
For USB full-speed operation only external crystal oscillator or external source clock can be
used.
If I will have communication speed same as RS-232 at 9600 baud I will be happy
Do you have any experience with this? How can I set USB to low-speed mode? But I will probably use external crystal.
Update:
I googling USB low speed mode. It is possible to set in Arduino, but Arduino bootloader doesn't work in low-speed mode. I will use external crystal.