![]() ![]() So by the time you have reached the start of your own program, the calibration value is already in the W register, it's up to you whether you then load it into the OSCCAL register (movwf OSCCAL) or not. ![]() Because it is the final address, as the program counter increments, it rolls over to address 0x000 where you normally start your own code from. When the PIC resets (or powers up) it goes to the reset vector and executes that instruction, leaving the calibration value in the W register. The reset vector is hard coded to point to that address. The way calibration works is the very last address in the program memory contains the instruction "movlw xx" where xx is the OSCCAL value. The danger you face is due to the value being stored in the main program memory. ![]() The settings are in the 'Tools/OSCCAL' menu of the Pickit2 software, not in XC8 or MPLABX. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |