|
| 1 | +#include "p18f4520.inc" |
| 2 | + |
| 3 | +; CONFIG1H |
| 4 | + CONFIG OSC = INTIO67 ; Oscillator Selection bits (Internal oscillator block, port function on RA6 and RA7) |
| 5 | + CONFIG FCMEN = OFF ; Fail-Safe Clock Monitor Enable bit (Fail-Safe Clock Monitor disabled) |
| 6 | + CONFIG IESO = OFF ; Internal/External Oscillator Switchover bit (Oscillator Switchover mode disabled) |
| 7 | + |
| 8 | +; CONFIG2L |
| 9 | + CONFIG PWRT = ON ; Power-up Timer Enable bit (PWRT enabled) |
| 10 | + CONFIG BOREN = OFF ; Brown-out Reset Enable bits (Brown-out Reset disabled in hardware and software) |
| 11 | + CONFIG BORV = 3 ; Brown Out Reset Voltage bits (Minimum setting) |
| 12 | + |
| 13 | +; CONFIG2H |
| 14 | + CONFIG WDT = OFF ; Watchdog Timer Enable bit (WDT disabled (control is placed on the SWDTEN bit)) |
| 15 | + CONFIG WDTPS = 32768 ; Watchdog Timer Postscale Select bits (1:32768) |
| 16 | + |
| 17 | +; CONFIG3H |
| 18 | + CONFIG CCP2MX = PORTBE ; CCP2 MUX bit (CCP2 input/output is multiplexed with RB3) |
| 19 | + CONFIG PBADEN = OFF ; PORTB A/D Enable bit (PORTB<4:0> pins are configured as digital I/O on Reset) |
| 20 | + CONFIG LPT1OSC = OFF ; Low-Power Timer1 Oscillator Enable bit (Timer1 configured for higher power operation) |
| 21 | + CONFIG MCLRE = OFF ; MCLR Pin Enable bit (RE3 input pin enabled; MCLR disabled) |
| 22 | + |
| 23 | +; CONFIG4L |
| 24 | + CONFIG STVREN = ON ; Stack Full/Underflow Reset Enable bit (Stack full/underflow will cause Reset) |
| 25 | + CONFIG LVP = OFF ; Single-Supply ICSP Enable bit (Single-Supply ICSP disabled) |
| 26 | + CONFIG XINST = OFF ; Extended Instruction Set Enable bit (Instruction set extension and Indexed Addressing mode disabled (Legacy mode)) |
| 27 | + |
| 28 | +; CONFIG5L |
| 29 | + CONFIG CP0 = ON ; Code Protection bit (Block 0 (000800-001FFFh) code-protected) |
| 30 | + CONFIG CP1 = ON ; Code Protection bit (Block 1 (002000-003FFFh) code-protected) |
| 31 | + CONFIG CP2 = ON ; Code Protection bit (Block 2 (004000-005FFFh) code-protected) |
| 32 | + CONFIG CP3 = ON ; Code Protection bit (Block 3 (006000-007FFFh) code-protected) |
| 33 | + |
| 34 | +; CONFIG5H |
| 35 | + CONFIG CPB = ON ; Boot Block Code Protection bit (Boot block (000000-0007FFh) code-protected) |
| 36 | + CONFIG CPD = OFF ; Data EEPROM Code Protection bit (Data EEPROM not code-protected) |
| 37 | + |
| 38 | +; CONFIG6L |
| 39 | + CONFIG WRT0 = OFF ; Write Protection bit (Block 0 (000800-001FFFh) not write-protected) |
| 40 | + CONFIG WRT1 = OFF ; Write Protection bit (Block 1 (002000-003FFFh) not write-protected) |
| 41 | + CONFIG WRT2 = OFF ; Write Protection bit (Block 2 (004000-005FFFh) not write-protected) |
| 42 | + CONFIG WRT3 = OFF ; Write Protection bit (Block 3 (006000-007FFFh) not write-protected) |
| 43 | + |
| 44 | +; CONFIG6H |
| 45 | + CONFIG WRTC = OFF ; Configuration Register Write Protection bit (Configuration registers (300000-3000FFh) not write-protected) |
| 46 | + CONFIG WRTB = OFF ; Boot Block Write Protection bit (Boot block (000000-0007FFh) not write-protected) |
| 47 | + CONFIG WRTD = OFF ; Data EEPROM Write Protection bit (Data EEPROM not write-protected) |
| 48 | + |
| 49 | +; CONFIG7L |
| 50 | + CONFIG EBTR0 = OFF ; Table Read Protection bit (Block 0 (000800-001FFFh) not protected from table reads executed in other blocks) |
| 51 | + CONFIG EBTR1 = OFF ; Table Read Protection bit (Block 1 (002000-003FFFh) not protected from table reads executed in other blocks) |
| 52 | + CONFIG EBTR2 = OFF ; Table Read Protection bit (Block 2 (004000-005FFFh) not protected from table reads executed in other blocks) |
| 53 | + CONFIG EBTR3 = OFF ; Table Read Protection bit (Block 3 (006000-007FFFh) not protected from table reads executed in other blocks) |
| 54 | + |
| 55 | +; CONFIG7H |
| 56 | + CONFIG EBTRB = OFF ; Boot Block Table Read Protection bit (Boot block (000000-0007FFh) not protected from table reads executed in other blocks) |
| 57 | + |
| 58 | + |
| 59 | +; Program Code |
| 60 | + org 0x00 ; Reset vector |
| 61 | + goto Main |
| 62 | + |
| 63 | + org 0x80 ; Interrupt vector |
| 64 | + |
| 65 | + |
| 66 | +Main |
| 67 | + MOVLW 0 |
| 68 | + MOVWF 12H |
| 69 | + MOVLW 22H |
| 70 | + ADDWF 12H,F |
| 71 | + ADDWF 12H,F |
| 72 | + ADDWF 36H,F |
| 73 | + ADDWF 36H,F |
| 74 | + |
| 75 | +HERE GOTO HERE |
| 76 | + |
| 77 | + |
| 78 | +END |
| 79 | + |
| 80 | + |
0 commit comments