PIC16F1828_StartUp.X.zip
0.10MB

 

Microchip

 

PIC16F1828 powerup.as powerup.S

Example code

 

I used the powerup.as or powerup.S below path

C:\Program Files\Microchip\xc8\v2.30\pic\sources\c90\pic

 

you can find the path when you install MPLAB XC8 Compiler

 

Below link will also help when you make powerup.as or powerup.S

 

microchipdeveloper.com/xc8:powerup-routine

 

 

Thank you!

 

 

 

 

; XC8 PIC powerup routine
;
; This module may be modified to include custom code to be executed 
; immediately after reset. After performing whatever powerup code
; is required, it should jump to "start"

#include "aspic.h"

global powerup,start
psect powerup,class=CODE,delta=2
powerup:

;
; Insert special powerup code here
;
;


; Now lets jump to start 
#if defined(_PIC14)
clrf STATUS
movlw start>>8
movwf PCLATH
goto start & 0x7FF | (powerup & not 0x7FF)
#endif
#if defined(_PIC14E) || defined(_PIC14EX)
clrf STATUS
movlp start>>8
goto start & 0x7FF | (powerup & not 0x7FF)
#endif
#if defined(_PIC16)
movlw start>>8
movwf PCLATH
movlw start & 0xFF
movwf PCL
#endif
end

Posted by KennyShin
,