Hopkins wrote : > I noted that the oscilator calibration command was write at > the end of the code. What is the "command" ? The RETLW that Microchip puts in place ? Or *your* code calling the RETLW ? > My question is does it matter if this code Again, which code ? The RETLW that Microchip puts in place ? Or *your* code calling the RETLW ? > is at the start of the program > and can I put it after I state org etc as shown here or does > it need to be > after the "Start" of the program ie as part of the main programs code? I'm not realy sure of what you are asking here. Of course you have to put your call to 3FF anyplace that will be *run* through by your code ! How could it be executed otherwise ? In your example : > org 0x00 ;Set program orgin (Start of code) > goto Start ;Start of program > ; org 0x04 > ; goto ISR ;Interrupt service routine > ; > ; XXX Get oscillator calibration bits and sav in the OSCCAL register. > bsf STATUS, RP0 > call 0x3FF > movwf OSCCAL > bcf STATUS, RP0 how is the PIC going to come to the part (that I have) marked XXX ? And where is the START label ? You actual call to 3FF to set the OSCCAL could be done anyware, I'd guess. And if you don't care about precision of the internal osc, you don't have to set OSCCAL at all... Jan-Erik. -- http://www.piclist.com hint: To leave the PICList mailto:piclist-unsubscribe-request@mitvma.mit.edu