Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

pic16f676 programming warning

Status
Not open for further replies.

zeroskj1988

Member level 2
Joined
Jul 7, 2011
Messages
46
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,588
i am using pic programmer from nsk electronics
micro pro
**broken link removed**
when i am programming pic16f676,i am getting a warning
OSCAL value should be in the form of retlw instruction(0x34XX)
currently in the 0x3fXX form
would you like to change it?
yes no cancal
dear friends any body knows what is the real problem.
is it the reason for this error
https://www.edaboard.com/threads/232950/
thanks in advance.
 

Oscal value is for calibration of internal RC oscillator. Its value is porgammed in controller. Change the calling adress for oscal for pic16f676 (value on 3FFH) and select retain oscal value.Your original programme may be having adress for other pic.
An example,
.
call 0x3FF ; retrieve factory calibration value
bsf STATUS,RP0 ; set file register bank to 1 (it is better to use BANKSEL)
movwf OSCCAL ; update register with factory cal value
bcf STATUS,RP0 ; set file register bank to 0 (it is better to use BANKSEL)
 
Last edited:

if you are using the internal rc oscillator remember that the internal RC oscillator is not as accurate as crystal. To compensate for the inherent inaccuracy, microchip uses a calibration scheme. The speed of the internal RC oscillator can be varied over a small range by changing the value of the OSCCAL register (refer register map in datasheet). Microchip tests every ic in factory, and calculates the value which , if loaded into OSCAAL, will make the oscillator run as close as possible to promising value. This calibration value is inserted into an instruction placed at the top of the program memory (0x3FF). The instruction placed there is:
Code:
mowlw k
'k' is the calibration value inserted in the factory.
so you could use this value to calibrate your pic.
try this code at the first line of your program.
Code:
call    0x3FF             ; retrieve factory calibration value
bsf     STATUS,RP0        ; set file register bank to 1 
movwf   OSCCAL            ; update register with factory cal value 
bcf     STATUS,RP0        ; set file register bank to 0

here i dont know if you are using assambly/c but if you are a newbie to microchip here is the link of powerfull tutorial for pic:
**broken link removed**
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top