'************************************************* ***************
'* Name : 18f2320 *
'* Author : [set under view...options] *
'* Notice : Copyright (c) 2005 [set under view...options] *
'* : All Rights Reserved *
'* Date : 2/14/2005 *
'* Version : 1.0 *
'* Notes : *
'* : *
'************************************************* ***************
DEFINE OSC 4
OSCTUNE = 0 ' at calibrated frequency so not offset
OSCCON = %01100000 'OSC at 4Mhz
@ __CONFIG _CONFIG1H, _INTIO2_OSC_1H & _IESO_OFF_1H ' use internal osc
@ __CONFIG _CONFIG2L, _PWRT_ON_2L & _BOR_ON_2L
@ __CONFIG _CONFIG2H, _WDT_ON_2H & _WDTPS_512_2H
@ __CONFIG _CONFIG3H, _MCLRE_OFF_3H & _PBAD_DIG_3H & _CCP2MX_OFF_3H
@ __CONFIG _CONFIG4L, _LVP_OFF_4L
ADCON0.0 = 0
ADCON1 = %11001111
CMCON = 7 'comparators off
CVRCON = 0
LVDCON = 0
'set pins for output
trisb = 0
trisc = 0
trisa = 0
LED var portb.7 ' could be any pin you want here all configured for outputs
'varible declarations
'constants
'set variable and misc.
goto endsub
endsub:
main:
high led
pause 200
low led
pause 200
end
Bookmarks