Introduction and Key Training Application
Next Video
Hands-On Training (PDF):
This is a series of both video and hands-on training focused on the fundamentals of AVR® microcontrollers development. Projects are developed from scratch, using the datasheet, AVR LibC, and later app notes, as primary programming references (START is not used).
In the video series, several AVR peripherals are introduced, including GPIO, timer/counter, USART, and ADC. In the process, the training evolves toward building an example application which samples an analog light sensor with ADC, then proportionally updates a PWM duty cycle based on the ADC sensor reading. An averaged sensor value is then sent over USART to a PC terminal.
An off-line training can be downloaded as "Application note AN17644 - Getting Started with AVR Microcontroller" which contains the following projects:
- Toggle a LED on a push button
- Dim the LED using PWM, using TC1
- ADC channel read every 500 ms & LED0 toggled
- Power Optimization and Sleep mode
Project Access Through On-Line Atmel Start:
You can also access this training from the Atmel START database.
Atmel Start Project - Getting Started with AVR Microcontroller
This training is a combined solution to the projects mentioned above. In this combined solution, power optimization code is added, sleep mode is selected as POWERDOWN, ADC channel0 is read and PWM is generated on PB1 using TC1.
After initializing peripherals, the device enters sleep mode and wakes up on pin-change interrupt of PB7. When SW0 (PB7) on ATmega328PB is pressed, device wakes up, then reads ADC channel0 and wait for 10 seconds. During this time LED dimming is observed on PB1 (connect PB1 to PB5 on ATmega328PB Xplained Mini). After 10 seconds, the device goes back to sleep.
SUPPORTED EVALUATION KIT
- ATmega328PB Xplained Mini
RUNNING THE START PROJECT DEMO
- Click on 'Download Pack' and save the .atzip file.
- Import .atzip file into Atmel Studio 7, File > Import > Atmel Start Project.
- Build and flash into supported evaluation board.
- On the ATmega328PB Xplained Mini, connect PB1 to PB5 as LED0 is connected at PB5. Then connect PC0 to 3V3 as PC0 is ADC channel0.
- Device enters sleep mode.
- Press 'SW0' on the ATmega328PB Xplained Mini which wakes up the device from sleep. The ADC channel is read, then wait for 10 seconds. Observe the LED dimming for 10 seconds.
- After 10 seconds, the device enters sleep mode again. During sleep mode, the LED dimming can't be observed as in POWERDOWN sleep mode TC1 is also stopped.