> -----Original Message-----
> From:
> [EMAIL PROTECTED]
> [mailto:[EMAIL PROTECTED]
> org] On Behalf Of Michael
> Sent: Tuesday, October 02, 2007 7:31 PM
> To: avr-gcc-list@nongnu.org
> 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




_______________________________________________
AVR-GCC-list mailing list
AVR-GCC-list@nongnu.org
http://lists.nongnu.org/mailman/listinfo/avr-gcc-list

Reply via email to