46 lines
1.1 KiB
Plaintext
46 lines
1.1 KiB
Plaintext
' ########### start ###########
|
|
' avr:tiny24
|
|
' ########### end ###########
|
|
'
|
|
' ******************************************************************
|
|
' A program to flash LED on PORTA.4 (SCK)
|
|
' 2016-06-30 (c) Paolo Iocco
|
|
' ******************************************************************
|
|
'
|
|
' Circuit diagram
|
|
' ---------------
|
|
' +--\/--+
|
|
' VCC-------->|1° 14|<--------GND
|
|
' PB0-------->|2 13|<--------PA0
|
|
' PB1-------->|3 12|<--------PA1
|
|
' PB3/Reset-->|4 11|---------PA2
|
|
' PB2---------|5 10|---------PA3
|
|
' PA7---------|6 9|---------PA4 SCK
|
|
' PA6 MOSI----|7 8|---------PA5 MISO
|
|
' +-------+
|
|
'
|
|
' 8MHz, internal RC Oscillator
|
|
' Fuses:
|
|
' AVRDude: avrdude -B 10 -c USBasp -p attiny24 -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
|
|
|
|
|
|
'Chip model
|
|
#chip tiny24, 8
|
|
#define led PORTA.4
|
|
dir led out
|
|
|
|
Startup:
|
|
|
|
'Main routine
|
|
Loop:
|
|
'Turn one LED on, the other off
|
|
SET led ON
|
|
Wait 500 ms
|
|
|
|
'Now toggle the LEDs
|
|
SET led OFF
|
|
Wait 500 ms
|
|
|
|
'Jump back to the start of the program
|
|
goto Loop
|