2003-12-03 08:21 AM
2011-05-17 02:35 AM
It would be nice if the compiler supported an instruction like:
wData = (*((huge unsigned int *)(dwAddress))); The compiler doesn't support this so we've created a routine. Here it is. Obviously you would want to work on every address in a page before swapping to the next page when computing your CRC. BYTE byReadAddress(DWORD dwAddress) { BYTE byReturn; BYTE byPage; BYTE byOldPage; BYTE * pbyOffset; // Disable Interrupts so only this routine uses the DPP while it is changed. di(); SWITCH_TO_DPR_PAGE; // Find the 16k page boundary byPage = (BYTE)(dwAddress / 0x4000); byOldPage = DPR0; // Calculate 14bit (16k) offset pbyOffset =(BYTE *)(dwAddress & 0x3FFF); // set the page, Read the byte & restore the page DPR0 = byPage; byReturn = *pbyOffset; DPR0 = byOldPage; ei(); return byReturn; }2011-05-17 02:35 AM
I would use ST9 to write a C program to check RAM and ROM (crc check). How could I direct the software to check absolut addresses? Could I have a little related example?