> On Tue, Apr 7, 2009 at 10:13 AM, jim wrote: > > I'm having some troubles getting a pic12f629 to start properly. > > The strangest part about it is in the batch I have 2 pics whose > > instruction at 3FFF is: > > sublw xx > > works fine. All the ones with the proper instruction retlw xx have > > reset problems. > > A bit strange. Are you using internal RC oscillator? Have you > followed the following example code from Microchip? > > C:\Program Files\Microchip\MPASM Suite\Template\Object\12F675TMPO.asm > ;------------------------------------------------------------------------------ > ; OSCCAL RESTORE (not required if internal OSC is not used) > ;------------------------------------------------------------------------------ > > errorlevel -302 > BSF STATUS,RP0 ; set file register bank to 1 > CALL 0x3FF ; retrieve factory calibration value > MOVWF OSCCAL ; update register with factory cal value > BCF STATUS,RP0 ; set file register bank to 0 > errorlevel +302 > > You can try this and see if it helps. Thanks everyone, this is a strange one indeed. Yes definitely on the two pics that work it is a sublw instruction not retlw in the 3FFF location. I am not however doing the OSCCAL Restore routine as shown above so not sure how it would affect anything. When I do the OSCCAL Restore on the PICS with retlw in 3FFF it doesn't help the reset problem. Very strange.. jim > > Xiaofan -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist