Hey guys, in one of my programs, i need to read the my program in the flash memory. its really simple and i have done it earlier: generally i use the following code:
lpm tr,z+ call transmit ; transmits the contents of tr via uart
But this time it just doesnt read correctly. it returns 0xff. I know there is something other than ff coz i read it from ponyprog.
This happens to the starting section of flash. If i set the z pointer to point to my bootloader, it reads that properly.
I've tried this for different atmega16s and that is not a problem.
Anyone ever come across this problem?