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
'Embedded' 카테고리의 다른 글
보안을 구현하기 위한 중요한 3요소 (0) | 2022.08.02 |
---|---|
MCU Flash memory and EEPROM read/write (0) | 2021.06.23 |
Cyclic Redundancy Check (CRC) Module with Memory Scanner example code (0) | 2019.04.19 |
ATSAMV71 X plained board schematic (Circuit diagram) (0) | 2019.04.16 |
ATSAMV71Q21 - Example code(External Interrupt and LED Toggle) (0) | 2019.04.16 |