|
From: | Artur Lipowski |
Subject: | Re: [avr-gcc-list] using EEPROM |
Date: | Mon, 20 Oct 2003 08:04:10 +0200 |
User-agent: | Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.5) Gecko/20031013 Thunderbird/0.3 |
Jack Valmadre wrote:
As I understand it is exercise only and not for production purpose because avr-libc has build-in such functionality.What I want the program to do is write a single byte (localVar) to EEPROM address 0, then read it and output it to PORTB. However all the pin on PORTB are just going low. What have I done wrong and how can I fix it?
There are two bytes variables. If you wan one byte use unsigned char or (IMO preffered) uint8_t types.unsigned int eVar1 EEPROM = 0; unsigned int eVar2 EEPROM = 0;
... > eeprom_read_block(&a, ptr, 1); ^ | You write two bytes and read back only one (which is MSB) and equals 0. All is correct ;-) Regards, -- Artur Lipowski
[Prev in Thread] | Current Thread | [Next in Thread] |