[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [avr-gcc-list] Reading eeprom without using routines in eeprom.h,cau
From: |
Eric Weddington |
Subject: |
RE: [avr-gcc-list] Reading eeprom without using routines in eeprom.h,causes reset. |
Date: |
Tue, 02 Oct 2007 19:33:43 -0600 |
> -----Original Message-----
> From:
> address@hidden
> [mailto:address@hidden
> org] On Behalf Of Michael
> Sent: Tuesday, October 02, 2007 7:31 PM
> To: address@hidden
> Subject: [avr-gcc-list] Reading eeprom without using routines
> in eeprom.h,causes reset.
>
> Hi, when I was new to the avr-gcc (and still fairly new to
> C), I read the eeprom like this:
>
>
>
> unsigned char eeread(unsigned char address)
>
> {
>
> while(EECR & _BV(EEWE));
>
> EEAR = address;
>
> EECR |= _BV(EERE);
>
> return EEDR;
>
> }
>
>
Did you know that avr-libc has an EEPROM API?:
<http://www.nongnu.org/avr-libc/user-manual/group__avr__eeprom.html>
It's been there for quite some time.
Eric Weddington