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 mailing list AVR-chat@nongnu.org http://lists.nongnu.org/mailman/listinfo/avr-chat