Read Flash MC9S08QE8

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Read Flash MC9S08QE8

1,199 次查看
DavidoBG
Contributor II
I found a sample code to read flash octet. Here under the sample code
 
// Read the content of a memory address
char flash_read(unsigned int address)
{
  unsigned char *pointer;
  pointer = (char*) address;
  return (*pointer);
}
 
I don't understand why there is no action, no register modification to read a contain of specific adress.
For me, the second line of the previous function do: pointer receiver adress of adress parameter (for example E000 = first octet of flash. That all!!! But there is not flash register has been modified before!!!?
 
Somebody have any explanation about this sample
 
Thanks
 
David
标签 (1)
0 项奖励
回复
1 回复

468 次查看
bigmac
Specialist III
Hello David,

Your function seems to work correctly for me under simulation.  I called the function using the following test code -

unsigned char value;

value = flash_read( 0xFFFE);


The upper byte of the reset vector was returned.

Regards,
Mac

0 项奖励
回复