[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[avr-chat] EEprom functions on Tiny13
From: |
Robert von Knobloch |
Subject: |
[avr-chat] EEprom functions on Tiny13 |
Date: |
Fri, 05 Oct 2007 16:47:52 +0200 |
User-agent: |
Thunderbird 1.5.0.12 (X11/20060911) |
I am using a Tiny 13 in a control application and have written all my
code in assembler.
Because we want to do some clever(er) things with it, I decided to
recode it in C (the application is small enough that it fits).
I have struggled to get a piece of code running that reads the eeprom
using a pointer.
Code like "x = eeprom_read_byte(&eevalue)" appears to work,
but "uint8_t * ptr; x=eeprom_read_byte(ptr)" does not.
It appears to be a problem in that these functions pass a 16-bit address
to the asm call for the function, whreas the hardware only supports an
8-bit address (I conclude).
Why the read of "&var" works and the pointer doesn't - I do not know.
I have re-written the function using direct 'bit-twiddling' on the
hardware and this works fine.
Has anyone else had similar experiences?? Is it perhaps a bug in the
library (said quietly), or have I misunderstood the function??
Best regards,
Robert von Knobloch
- [avr-chat] EEprom functions on Tiny13,
Robert von Knobloch <=