45 lines
1.1 KiB
Plaintext
45 lines
1.1 KiB
Plaintext
' ########### start ###########
|
|
' pic:PIC16F628A
|
|
' ########### end ###########
|
|
'
|
|
' ******************************************************************
|
|
' A program to flash LED on PORTB5
|
|
' 2014-08-18 (c) Paolo Iocco
|
|
' ******************************************************************
|
|
'
|
|
' Circuit diagram
|
|
' ---------------
|
|
' +--\/--+
|
|
' nc-----|1° 18|-----nc
|
|
' nc-----|2 17|-----nc
|
|
' nc-----|3 16|<--------H
|
|
' +5V--|50K|-->|4 15|<--------H = 4 MHz chrystal+ capacitors
|
|
' GND-------->|5 14|<--------+5V
|
|
' nc-----|6 13|-----nc
|
|
' nc-----|7 12|-----nc
|
|
' nc-----|8 11|-------->LED
|
|
' nc-----|9 10|-----nc
|
|
' +------+
|
|
'
|
|
' ******************************************************************
|
|
|
|
'Chip model
|
|
#chip 16f628a, 20
|
|
#config OSC = XT, WDT = OFF, PWRTE = ON, CP = OFF
|
|
#define led PORTB.5
|
|
|
|
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
|
|
|