URL: <http://savannah.nongnu.org/bugs/?27198>
Summary: avr/iox128a1.h is missing definitions for calibration signature indexes Project: AVR C Runtime Library Submitted by: simonk Submitted on: Fr 07 Aug 2009 01:27:14 GMT Category: Header Severity: 3 - Normal Priority: 5 - Normal Item Group: Header files Status: None Percent Complete: 0% Assigned to: None Open/Closed: Open Discussion Lock: Any Release: 1.7.* Fixed Release: None _______________________________________________________ Details: There are no #defines or enums defining an index for each possible production/calibration signature row entry/register. This index has to be loaded into ZL when using LPM on the NVM to load production signature entries. It could look like: typedef enum NVM_PROD_SIG_IDX_enum { NVM_PROD_SIG_IDX_RCOSC2M = 0x00, NVM_PROD_SIG_IDX_RCOSC32K = 0x02, NVM_PROD_SIG_IDX_RCOSC32M = 0x03, NVM_PROD_SIG_IDX_LOTNUM0 = 0x08, NVM_PROD_SIG_IDX_LOTNUM1 = 0x09, NVM_PROD_SIG_IDX_LOTNUM2 = 0x0A, NVM_PROD_SIG_IDX_LOTNUM3 = 0x0B, NVM_PROD_SIG_IDX_LOTNUM4 = 0x0C, NVM_PROD_SIG_IDX_LOTNUM5 = 0x0D, NVM_PROD_SIG_IDX_WAFNUM = 0x10, NVM_PROD_SIG_IDX_COORDX0 = 0x12, NVM_PROD_SIG_IDX_COORDX1 = 0x13, NVM_PROD_SIG_IDX_COORDY0 = 0x14, NVM_PROD_SIG_IDX_COORDY1 = 0x15, NVM_PROD_SIG_IDX_ADCACAL0 = 0x20, NVM_PROD_SIG_IDX_ADCACAL1 = 0x21, NVM_PROD_SIG_IDX_ADCBCAL0 = 0x24, NVM_PROD_SIG_IDX_ADCBCAL1 = 0x25, NVM_PROD_SIG_IDX_TEMPSENSE0 = 0x2E, NVM_PROD_SIG_IDX_TEMPSENSE1 = 0x2F, NVM_PROD_SIG_IDX_DACAOFFCAL = 0x30, NVM_PROD_SIG_IDX_DACAINCAL = 0x31, NVM_PROD_SIG_IDX_DACBOFFCAL = 0x32, NVM_PROD_SIG_IDX_DACBINCAL = 0x33 } NVM_PROD_SIG_IDX_t a function for reading the signature data could look like: /* static inline */ uint8_t SystemReadCalibrationByte(NVM_PROD_SIG_IDX_t Index) { uint8_t Result; __asm__ volatile ( "mov r30, %[Idx]" "nt" "ldi r31, 0" "nt" "ldi %[Idx], %[Rd]" "nt" "sts %[Cmd], %[Idx]" "nt" "lpm %[Res], Z" "nt" : [Res] "=r" (Result) : [Idx] "a" ((uint8_t) Index), [Rd] "M" (NVM_CMD_READ_CALIB_ROW_gc), [Cmd] "m" (NVM_CMD) ); return Result; } _______________________________________________________ Reply to this item at: <http://savannah.nongnu.org/bugs/?27198> _______________________________________________ Nachricht geschickt von/durch Savannah http://savannah.nongnu.org/ _______________________________________________ AVR-libc-dev mailing list AVR-libc-dev@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-libc-dev