| Motore di ricerca datesheet componenti elettronici |
|
ATmega162V-8AI Scheda tecnica(PDF) 23 Page - ATMEL Corporation |
|
|
|||||||||||||||||||||||||||||
ATmega162V-8AI Scheda tecnica(HTML) 23 Page - ATMEL Corporation |
|
23 / 324 page ![]() 23 2513K–AVR–07/09 ATmega162/V The following code examples show one assembly and one C function for writing to the EEPROM. The examples assume that interrupts are controlled (e.g., by disabling interrupts globally) so that no interrupts will occur during execution of these functions. The examples also assume that no Flash Boot Loader is present in the software. If such code is present, the EEPROM write function must also wait for any ongoing SPM command to finish. Assembly Code Example EEPROM_write: ; Wait for completion of?previous write sbic EECR,EEWE rjmp EEPROM_write ; Set up address (r18:r1?) in address register out EEARH, r18 out EEARL, r17 ; Write data (r16) to da?a register out EEDR,r16 ; Write logical one to E?MWE sbi EECR,EEMWE ; Start eeprom write by ?etting EEWE sbi EECR,EEWE ret C Code Example void EEPROM_write(unsigned int uiAddress, unsigned char ucData) { /* Wait for complet?on of previous write */ while(EECR & (1<<EEWE)) ; /* Set up address and da?a registers */ EEAR = uiAddress; EEDR = ucData; /* Write logical on? to EEMWE */ EECR |= (1<<EEMWE); /* Start eeprom write by?setting EEWE */ EECR |= (1<<EEWE); } |
|
Link URL |
| Lei ha avuto il aiuto da alldatasheet? [ DONATE ] |
Di alldatasheet | Richest di pubblicita | contatti | Privacy Policy | Collegamento alla scheda tecnica | scambio Link | Ricerca produttore 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 |