Read Flash MC9S08QE8

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Read Flash MC9S08QE8

861 Views
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
Labels (1)
0 Kudos
1 Reply

130 Views
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 Kudos