51 lines
1.2 KiB
Plaintext
51 lines
1.2 KiB
Plaintext
' ########### start ###########
|
|
' pic:PIC16C84
|
|
' ########### end ###########
|
|
'
|
|
' ******************************************************************
|
|
' Mixer with a PIC16C84
|
|
' 2022-10-03 (c) Paolo Iocco
|
|
' ******************************************************************
|
|
'
|
|
' Circuit diagram
|
|
' ---------------
|
|
' +--\/--+
|
|
' nc-----|1° 18|-------->LED
|
|
' 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|-----nc
|
|
' nc-----|9 10|-----nc
|
|
' +------+
|
|
'
|
|
' ******************************************************************
|
|
|
|
#Chip 16C84, 4
|
|
#Config OSC = XT, WDT = OFF, PWRTE = ON, CP = OFF
|
|
|
|
#define led PORTB.3
|
|
|
|
dir PORTB out
|
|
dir PORTA out
|
|
|
|
Startup:
|
|
|
|
'Main routine
|
|
Loop:
|
|
'Turn one LED on, the other off
|
|
SET led ON
|
|
'PORTB = 255
|
|
'PORTA = 255
|
|
wait 500 ms
|
|
'Now toggle the LEDs
|
|
|
|
SET led OFF
|
|
'PORTB = 0
|
|
'PORTA = 0
|
|
wait 500 ms
|
|
'Jump back to the start of the program
|
|
goto Loop
|