| Author |
Message |
fabrizio
Guest
|
Posted:
Sun Dec 12, 2004 5:21 am Post subject:
Reading EEPROM data, ATMEGA16, with imagecraft c-compiler |
|
|
Hei all,
The intension is to read out a table located in EEPROM using the imagecraft
C-compiler version 6.31A
Definition in C
---------------
#pragma data:eeprom
char Output_Ports_Table[] = { 0x38, 0x02};
#pragma data:data
...
...
In the program i write following code
....
....
unsigned char Table_Contents;
EEPROM_READ((int)&Output_Ports_Table[0], Table_Contents);
Table_Contents should get the value 0x38, however it keeps getting the value
FFFF ?
After compiling the c-file i get a file with extension eep and hex.
Both files are downloaded to the ATMEGA16 using the Ponyprog tool. When
reading the EEPROM data with Ponyprog, i can see the values 0x38 and 0x02.
The EEPROM should be programmed correctly.
Can you help me out with this please.
Regards,
Fabrizio, |
|
| Back to top |
|
 |
Gary Kato
Guest
|
Posted:
Sun Dec 12, 2004 6:51 am Post subject:
Re: Reading EEPROM data, ATMEGA16, with imagecraft c-compile |
|
|
| Quote: | EEPROM_READ((int)&Output_Ports_Table[0], Table_Contents);
|
I don't have a C compiler for AVR. What does EPROM_READ take as parameters?
That second paramter should probably be:
&Table_Contents
You want to pass the address of the variable, not the value. |
|
| Back to top |
|
 |
Richard M.
Guest
|
Posted:
Sun Dec 12, 2004 12:59 pm Post subject:
Re: Reading EEPROM data, ATMEGA16, with imagecraft c-compile |
|
|
fabrizio wrote:
| Quote: | Hei all,
The intension is to read out a table located in EEPROM using the imagecraft
C-compiler version 6.31A
Definition in C
---------------
#pragma data:eeprom
char Output_Ports_Table[] = { 0x38, 0x02};
#pragma data:data
That ought to work. Email me directly with the question and I will help |
you out.
--
// richard
http://www.imagecraft.com |
|
| Back to top |
|
 |
|
|
|
|