![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
deepakomanna
Joined: 06 Mar 2007 Posts: 92 Location: Pune,India
|
copy OSCCAL value ? |
Posted: Mon Aug 06, 2007 9:58 pm |
|
|
Dear Sir,
here i am using 12f629, MPLAB 7.5 Ver. & CCS PCM C Compiler, Version 3.249, 34534.
I want to copy OSCCAL Value from 0x03ff to OSCCAL reg.
plz tell me how can i do this ?
Also while programming the IC ,if i used erase option, it will erase OSCCAL value from 0x03ff location? _________________ Thank You,
With Best Regards,
Deepak. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Mon Aug 06, 2007 11:02 pm |
|
|
Quote: | I want to copy OSCCAL Value from 0x03ff to OSCCAL reg. |
You have been on this forum long enough so that you should know how
to find this information.
1. Download the 12F675 data sheet and find the address of the OSCCAL
register. It's 0x90.
2. Make a small test program, like this:
Code: |
#include <12F675.h>
#use delay(clock=4000000)
#fuses INTRC_IO, NOWDT, NOMCLR, PUT, BROWNOUT
void main()
{
while(1);
}
|
3. Compile the program with vs. 3.249 of the PCM compiler, and then
look at the .LST file. Here you can see what it does.
Code: |
0000: MOVLW 00
0001: MOVWF 0A
0002: GOTO 004
0003: NOP
0004: CALL 3FF // Get the OSCCAL value in the W register.
0005: BSF 03.5 // Bank 1
0006: MOVWF 10 // Move W into the OSCCAL register at 0x90.
0007: MOVLW 00
0008: MOVWF 0A
0009: GOTO 00A |
Quote: | Also while programming the IC ,if i used erase option, it will erase OSCCAL value from 0x03ff location? |
Read the ICD2 help file in MPLAB. Do a search for the word 'calibrate'.
Then you find this:
Quote: |
Note: Internal oscillator and bandgap calibration bits are always
preserved by MPLAB ICD 2, for the erase cycle. Only during
programming may their values be changed |
Most questions like this can be answered by looking at the MPLAB ICD2
help file.
With this help, next time you should be able to do these things. |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|