| Electronic Components Datasheet Search |
|
AVR401 Datasheet(PDF) 9 Page - ATMEL Corporation |
|
|
|||||||||||||||||||||||||||||
AVR401 Datasheet(HTML) 9 Page - ATMEL Corporation |
|
9 / 12 page ![]() 9 AVR401 0953C–AVR–02/03 “div17u” 17/16 Bit Division This routine performs a 17/16 bit division. The 17-bit dividend must be stored in the (C:didH:didL) variable, where the Carry Flag is most significant. The divisor is stored in the (divH:divL) variable. The result is placed in (resH:resL) and the reminder in (remH:remL). The routine is based on the “div16u” multiplication routine described in application note AVR 200. Example Program The included example program performs repeated conversions. First, the charging time for the reference is measured, then for the input voltage. The result is output to Port D and Port B pin 4 (MSB). The result is inverted before it is output, so active low LEDs can be connected to show the result. This conversion cycle is repeated in an endless loop. To perform a calibration the PB7-pin must be initially in high state and the capacitor has to be discharged. Afterwards the user should apply 2.5 volts at the input before setting the PB7-pin low. The calibrated V ref is stored in EEPROM, where it is fetched at every normal Power-up. Table 8. “div17u” Subroutine Performance Figures Parameter Value Code Size 18 words Execution Cycles 209 min, 292 max. Register Usage Low Registers High Registers Global Flags :6 :None :1 :C Table 9. “div17u” Register Usage Register Input Internal Output R1 didL – Low part dividend dresL – Low part result R2 didH – High part dividend dresH – High part result C-flag 17th bit of dividend R3 divL – Low part divisor R4 divH – High part divisor R5 remL – Low part reminder R6 remH – High part reminder |
|
|
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 |