Micro-controller Reset
As soon as power is given to micro-controller, the reset should be kept activated until all the internal peripheral of the micro-controller comes into working state.During reset, all I/O Registers are set to their initial values, and the program starts execution
from the Reset Vector. The instruction placed at the Reset Vector must be a JMP
Types of Reset in Atmega32ua
Power-on-Reset (POR) - Power-on Reset (POR) pulse is generated by an On-chip detection circuit. A Power-on Reset circuit ensures that the device is reset from Power-on.
External Reset - An External Reset is generated by a low level on the RESET pin. Reset pulses longer than the minimum pulse width (400ns) will generate a reset, even if the clock is not running.
USB End of Reset - The MCU is reset (excluding the USB controller that remains enabled and
attached) on the detection of a USB End of Reset condition on the bus, if this feature is
enabled by the user.
Reset Circuitry
The capacitor should be kept as close to reset pin as possible. Try to avoid having other capacitor in the RESET-Ground pin. Ideal choice is 10K and 100nF. Atmel recommend a diode but is not required. Higher the capacitor, slower the speed of programing will be.
Reset switch - A switch across capacitor. This will pull the RESET pin to ground, the capacitor will make sure to avoid any glitches in switch.
Power
VCC (pin34 and pin14) - Digital supply voltage
Multiple VCC pins are to improve dynamic current distribution inside the chip. Connect all VDD and VSS to circuit power supply. Decouple individual VCC pin by connecting 0.1uF capacitor as close as possible to VDD/VSS paire.
UVCC - USB Pads Internal Regulator Input supply voltage.
AVCC - AVCC is the supply voltage pin (input) for all the A/D Converter channels. If the ADC is not used,
it should be externally connected to VCC. If the ADC is used, it should be connected to VCC
through a low-pass filter. AVCC must not differ more than ±0.3V from VCC. The circuit to power AVCC is shown below
AVCC1 is connected to VCC through a low pass filter (ferrite bead and capacitor circuit). Ferrite bead [3] is used to eliminate high frequency EMI noise. The same circuitry should be used for AVCC filtering on the ADC8-ADC13 side. (Ferrite bead digikey part number - MH2029-300YDKR-ND)
Reset pull-up resistor value ~ 30-60kohm (ref - 378, datasheet). Stronger external pull-up resistor might be required in noisy environment to avoid accidental reset. However, it should not be too strong if using RESET pin for programing. Typical value is to use ~10K
I/O Pin Pull-up resistors ~ 20-50kohm
Connection to USB
49ohm (or 100ohm) resistors should be used to limit the current.
3.3V diodes should be used across D+/D- and ground to limit the voltage in the line to 3.3V
* polarized capacitors (aka electrolytic capacitor)uses ionic conduction electrolytes as one of its plate to achieve high capacitance per unit area and hence have polarity. Usually aluminum is one electron and thin layer of aluminum oxide acts as dielectric, its this very small thickness which is responsible for higher capacitance. They are usually use to eliminate AC noise from DC power source. Most electrolytic capacitors are polarized and require one of the electrodes to be positive relative to the other; they may catastrophically fail if voltage is reversed.
UCAP - USB pads internal regulator output supply voltage. Should be connected to external 1uF capacitor
used crystal - 16MHz
The device is shipped with Low Power Crystal Oscillator (8.0MHz-16MHz) enabled
ADC Power supply
ADC Reference Voltage -
ADC reference voltage can be selected as AVcc (voltage to ADC) or internal 2.56V or external voltage. If connected to fixed external voltage, the user may not use other reference voltage option in the application, as this will short the external voltage. ADC reference voltage can be made more immune to noise by connecting a capacitor (0.1uF) between AREF pin and ground.
Local decoupling Capacitors - 0.1uF as close as possible to VCC/GND pair in IC. C5 and C6
Using 100mA mas regulator to protect USB port. However, not using remaining 400mA. Other way to protect usb port from overcurrent is to use PPTC
Extra parts
16MHz resonator
Circuit Detail
R1 (10K) and C1(0.1uF) for Reset pin. R2 (330R) to avoid high voltage at reset pin during pressing switch
L1 and C4(0.1uF) for power supply of ADC.
C3(0.1uF) to avoid high frequency noise at Vref of ADC.
C5(0.1uF) and C6(0.1uF) are local decoupling capacitors.
C7(10uF) is power supply decoupling capacitor.
LED connection: LED lights when pin is ground.
Debugging Board
1) Switch can bring the RESET pin to ground
2) Programmer can't bring the RESET pin to ground and hence get the error "Unable to enter programming mode".
Actually I set the wrong device it should be ATmega32U4
CPU clock source
The device is shipped with Low Power Crystal Oscillator (8.0MHz-16MHz) enabled and with the
fuse CKDIV8 programmed, resulting in 2.0MHz system clock with an 16 MHz crystal. So for ISP setting the maximum ISP clock frequency which is 1/4th of system clock frequency is 500Hz.
To do in next version
1) Change to microB USB connector type H11574CT-ND
2) Might not need switch for RESET pin as it can be reset from Arduino IDE
3) Change rout below USB connector
4) Order resonator(535-10008-1-ND), ferrite bead (30ohm@100MHz MH2029-300YTR-ND and 60ohm@100MHz-MH2029-600YCT-ND )and Atmega32u4
5) Update eagle 16MHz resonator part
6) Add potentiomete to one of the ADC pin.
Digikey part number - 987-1004-1-ND and SM-3TW103CT-ND
7) In the board few tracks are very thin fix it.
8) Add a SMD buzzer , 3V - 668-1207-1-ND and 668-1060-1-ND, 5V - 668-1066-1-ND
9) You can also have extra header for LCD
Diode for reset pin - CD1206-S01575CT-ND
For EDS protection - CG0603MLC-05EDKR-ND
PTC resettable fuses to protect USB port - MF-MSMF050-2CT-ND
22ohm resistors - device package - 1206, 1/4W, 1% tolurrance 311-22.0FRCT-ND
To Arduino
Install arduino IDE (and driver it will ask to install)
Connect board to PC
With avrstudio install **.hex bootloader file (usually found in arduino folder)
After burn is complete, windows should install driver for the connected arduino board.
How IDE programs the board
When you first reset the board (ie by switch or through serial port) "Arduino micro bootloader" mode kicks in stays there for 10seconds and then the sketch starts to run. Now every sketch as a "Arduino micro" USB driver as part of it. So when you reset first windows recognize it as "Arduini micro bootloader" until bootloader drivier is running after that hardware list refresh and you see "Arduino Micro" when sketch start to run.
11/21/13 11PM
Initially, I was unable to program the board from Arduino IDE. The problem was that after reset the uC was not going into the bootloader mode (some time it did, some time didn't). The reason was that there is a HWB pin in micro-controller (page 335 datasheet) when it is connected to ground, after reset first bootloader is executed followed by program execution. Fortunately, in my board this pin was close to ground wire so I just connected it without changing the board. Now, although I can not upload with USB reset done by the Arduino IDE but I can keep the reset button pressed, hit upload and when upload message appear, I release the reset button, in device manager I can see the board is now detected as "Arduino micro bootloader" and the upload completes successfully.
I burned Caterina bootloader on my chip and just found out that with this bootloader the board enters the bootloader mode only if doubled tapped. That explains why sometime I was able to enter the bootloader mode by resetting. However, when I press and hold the button during the sketch upload there was no tap so I could not upload my sketch as it was not entering bootloader mode.
Pins
Total 25pins are useful in atmega32u4 for I/O, interrupt and ADC.
I have 19pin for general purpose use, 3 pins for ISP, 2 pin for LED + Switch and 1 pin is not currently used (I will add SMD buzzer to it).
Side area will have pins for general I/O and center area will be saved for further components
Board desing, track coming from the pins are 15mil and others are 16mil. In some critical situation 10mil tracks are used.
Board desing, track coming from the pins are 15mil and others are 16mil. In some critical situation 10mil tracks are used.
Reference - Datasheet
http://www.kanda.com/files/isp_circuits.pdf
http://www.atmel.com/Images/doc4284.pdf
[3] http://www.murata.com/products/emc/knowhow/pdf/23to25e.pdf
No comments:
Post a Comment