44 lines
1.1 KiB
Plaintext
44 lines
1.1 KiB
Plaintext
' ########### start ###########
|
|
' avr:tiny45
|
|
' ########### end ###########
|
|
'
|
|
' ******************************************************************
|
|
' A program to flash LED on PORTB.0
|
|
' 2016-06-30 (c) Paolo Iocco
|
|
' ******************************************************************
|
|
'
|
|
' Circuit diagram
|
|
' ---------------
|
|
' ATtiny 13/45/85 Pin map
|
|
' +--\/--+
|
|
' +5V>--/Reset ADC0 PB5---|1° 8|---Vcc----------------<+5V
|
|
' ADC3 PB3 -|2 7|- PB2 ADC1 SCK
|
|
' ADC2 PB4 -|3 6|- PB1 OC0B MISO AIN1
|
|
' GND>--------------GND---|4 5|---PB0 OC0A MOSI AIN0->LED
|
|
' +------+
|
|
'
|
|
' -------------------------------------------------------------
|
|
'
|
|
' 8MHz, internal RC Oscillator
|
|
' Fuses:
|
|
' AVRDude: avrdude -B 10 -c USBasp -p attiny45 -U lfuse:w:0xe2:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
|
|
|
|
'Chip model
|
|
#chip tiny45, 8
|
|
#define led PORTB.0
|
|
dir led out
|
|
|
|
Startup:
|
|
|
|
'Main routine
|
|
Loop:
|
|
'Turn one LED on, the other off
|
|
SET led ON
|
|
Wait 100 ms
|
|
'Now toggle the LEDs
|
|
|
|
SET led OFF
|
|
Wait 100 ms
|
|
'Jump back to the start of the program
|
|
goto Loop
|