Try this:
Code:
@ DEVICE PIC12F675, INTRC_OSC_NOCLKOUT
' System Clock Options (Internal)
@ DEVICE PIC12F675, WDT_ON
' Watchdog Timer
@ DEVICE PIC12F675, PWRT_ON
' Power-On Timer
@ DEVICE PIC12F675, MCLR_OFF
' Master Clear Options (Internal)
@ DEVICE PIC12F675, BOD_ON
' Brown-Out Detect
@ DEVICE PIC12F675, CPD_OFF
' Data Memory Code Protect
@ DEVICE PIC12F675, PROTECT_OFF
' Program Code Protection
DEFINE ADC_BITS 10 ' Set resolution of conversion
DEFINE ADC_CLOCK 3 ' Set clock source (x/FOSC or FRC)
DEFINE ADC_SAMPLEUS 50 ' Set sampling time (in uS)
DEFINE OSCCAL_1K 1
DEFINE OSCCAL_2K 1
ANSEL = %00000000 ' Set analog ports to digital mode
ADCON0 = %10000001 ' Configure A/D channel
CMCON = %00000111 ' Turn off comparator
WPU = %00000000 ' Disable pull-ups
TRISIO = %00000 ' Set all I/O's to outputs
i var byte ' Counter variable
test_led var gpio.1
led var gpio.2
test_led = 0
led = 0
main:
for i = 0 to 59
test_led = 1
pause 500
test_led = 0
pause 500
next i
toggle led
goto main
Bookmarks