| Electronic Components Datasheet Search |
|
AVR4013 Datasheet(PDF) 3 Page - ATMEL Corporation |
|
|
|||||||||||||||||||||||||||||
AVR4013 Datasheet(HTML) 3 Page - ATMEL Corporation |
|
3 / 7 page ![]() AVR4013 3 8349A-AVR-11/10 4 Source code availability The code for all five optimization levels is included in a separate .zip file, and has been tested with AVR Studio 4.18 RC2 and the WinAVR-20100110 toolchain. 5 Demonstration stages The code consists of five levels of optimization, each level offering increased power saving in the application. No optimization Enable pull-ups on unused I/O pins and disable modules not used Pre-scale clock from 8Mhz to 2MHz Use power-save sleep mode while waiting for next transmit Calibrate oscillator to enable higher baud rate Before we start the demonstration we must calibrate the internal RC oscillator. This is to make sure that the baud rate generator is able to generate a stable clock source over the entire voltage range. Oscillator calibration is highly device depended, and referring to the ATmega88PA datasheet, the factory calibration of the internal RC oscillator has an accuracy of ±10% (see section 28.4.1, Calibrated Internal RC Oscillator Accuracy, in the datasheet) and user calibration accuracy is within ±1%. To do this, you can use an oscilloscope and enable the CKOUT fuse (see section 27.2, Fuse Bits, in the datasheet) to find the frequency closest to 8MHz. You will use the OSCCAL register to calibrate the oscillator (see OSCCAL – Oscillator Calibration Register in the datasheet), and refer to application note AVR053 for a good way to calibrate the oscillator. On the ATmega88PA used in this example, we found that the value 0x66 in the OSCCAL register gave the best frequency. 5.1 No optimization We start by running the code with no optimization to create a reference point. We execute the code with the device set at 8MHz and the baud rate generator set to 19200 baud. While waiting for the next transmit, the controller will poll the TIFR2 Timer/Counter 2 Interrupt Flag Register to check if a second has elapsed since the last transmit started. This approach will run the code in active mode all the time Runtime: 6 seconds. |
|
|
Link URL |
| Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link to Datasheet | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
| Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
|
Family Site : ic2ic.com |
icmetro.com |