41 lines
913 B
Plaintext
41 lines
913 B
Plaintext
' ########### start ###########
|
|
' pic:PIC12F675
|
|
' ########### end ###########
|
|
'
|
|
'
|
|
' ******************************************************************
|
|
' A program to flash LED on GPIO.0
|
|
' 2015-05-18 (c) Paolo Iocco
|
|
' ******************************************************************
|
|
'
|
|
' Circuit diagram
|
|
' ---------------
|
|
' +--\/--+
|
|
' +5V ------>|1° 8|<------ GND
|
|
' NC -----|2 7|------> LED
|
|
' NC -----|3 6|----- NC
|
|
' MCLR ---->|4 5|----- NC
|
|
' +------+
|
|
'
|
|
' ******************************************************************
|
|
|
|
'Chip model
|
|
#chip 12f675, 4
|
|
#config OSC = XT, WDT = OFF, PWRTE = ON, CP = OFF
|
|
#define led GPIO.0
|
|
|
|
Startup:
|
|
|
|
'Main routine
|
|
Loop:
|
|
'Turn one LED on, the other off
|
|
SET led ON
|
|
wait 1 sec
|
|
'Now toggle the LEDs
|
|
|
|
SET led OFF
|
|
wait 1 sec
|
|
'Jump back to the start of the program
|
|
goto Loop
|
|
|