1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169
|
opt nolist
;
; Device type defintions for PIC16F818
;
__progmem_size equ 1024
__data_eeprom_size equ 128
__config set 0x3fff
set_pic_type "PIC16F818", "14-bit"
__do_config macro ; keyword, value
if streqcase("\1", "osc") | streqcase("\1", "fosc")
if streqcase("\2", "lp")
__config set __config & 0b1111111111101100
exitm
endif
if streqcase("\2", "xt")
__config set (__config & 0b1111111111101100) | 0b00000001
exitm
endif
if streqcase("\2", "hs")
__config set (__config & 0b1111111111101100) | 0b00000010
exitm
endif
if streqcase("\2", "ec") | streqcase("\2", "extclk")
__config set (__config & 0b1111111111101100) | 0b00000011
exitm
endif
if streqcase("\2", "intoscio") | streqcase("\2", "intrcio")
__config set (__config & 0b1111111111101100) | 0b00010000
exitm
endif
if streqcase("\2", "intosc") | streqcase("\2", "intrc")
__config set (__config & 0b1111111111101100) | 0b00010001
exitm
endif
if streqcase("\2", "extrcio")
__config set (__config & 0b1111111111101100) | 0b00010010
exitm
endif
if streqcase("\2", "extrc")
__config set (__config & 0b1111111111101100) | 0b00010011
exitm
endif
error "Invalid oscillator setting"
exitm
endif
if streqcase("\1", "wdt") | streqcase("\1", "wdte")
if streqcase("\2", "on") | streqcase("\2", "yes")
__config set __config | 0b0000000000000100
exitm
endif
if streqcase("\2", "off") | streqcase("\2", "no")
__config set __config & 0b1111111111111011
exitm
endif
error "Invalid WDT setting"
exitm
endif
if streqcase("\1", "pwrt") | streqcase("\1", "pwrte")
if streqcase("\2", "on") | streqcase("\2", "yes")
__config set __config & 0b1111111111110111
exitm
endif
if streqcase("\2", "off") | streqcase("\2", "no")
__config set __config | 0b0000000000001000
exitm
endif
error "Invalid PWRT setting"
exitm
endif
if streqcase("\1", "mclr") | streqcase("\1", "mclre")
if streqcase("\2", "on") | streqcase("\2", "yes")
__config set __config | 0b0000000000100000
exitm
endif
if streqcase("\2", "off") | streqcase("\2", "no")
__config set __config & 0b1111111111011111
exitm
endif
error "Invalid MCLR setting"
exitm
endif
if streqcase("\1", "boden") | streqcase("\1", "boren")
if streqcase("\2", "on") | streqcase("\2", "yes")
__config set __config | 0b0000000001000000
exitm
endif
if streqcase("\2", "off") | streqcase("\2", "no")
__config set __config & 0b1111111110111111
exitm
endif
error "Invalid BODEN setting"
exitm
endif
if streqcase("\1", "lvp")
if streqcase("\2", "on") | streqcase("\2", "yes")
__config set __config | 0b0000000010000000
exitm
endif
if streqcase("\2", "off") | streqcase("\2", "no")
__config set __config & 0b1111111101111111
exitm
endif
error "Invalid BODEN setting"
exitm
endif
if streqcase("\1", "cpd")
if streqcase("\2", "on") | streqcase("\2", "yes")
__config set __config & 0b1111111011111111
exitm
endif
if streqcase("\2", "off") | streqcase("\2", "no")
__config set __config | 0b0000000100000000
exitm
endif
error "Invalid BODEN setting"
exitm
endif
if streqcase("\1", "wrt")
if ((\2) >= 0) & ((\2) <= 3)
__config set (__config & 0b1111100111111111) | ((\2) << 9)
exitm
endif
error "Invalid WRT setting"
exitm
endif
if streqcase("\1", "debug")
if streqcase("\2", "on") | streqcase("\2", "yes")
__config set __config & 0b1111011111111111
exitm
endif
if streqcase("\2", "off") | streqcase("\2", "no")
__config set __config | 0b0000100000000000
exitm
endif
error "Invalid BODEN setting"
exitm
endif
if streqcase("\1", "ccpmx")
if streqcase("\2", "on") | streqcase("\2", "yes")
__config set __config | 0b0001000000000000
exitm
endif
if streqcase("\2", "off") | streqcase("\2", "no")
__config set __config & 0b1110111111111111
exitm
endif
error "Invalid BODEN setting"
exitm
endif
if streqcase("\1", "cp")
if streqcase("\2", "on") | streqcase("\2", "yes")
__config set __config & 0b1101111111111111
exitm
endif
if streqcase("\2", "off") | streqcase("\2", "no")
__config set __config | 0b0010000000000000
exitm
endif
error "Invalid BODEN setting"
exitm
endif
error "Invalid config keyword"
endm
opt list
|