50 lines
1.3 KiB
Plaintext
50 lines
1.3 KiB
Plaintext
' ########### start ###########
|
|
' avr:tiny13
|
|
' ########### end ###########
|
|
'
|
|
' ******************************************************************
|
|
' A program to oscillate a pin
|
|
' 2022-03-08 (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
|
|
' +------+
|
|
'
|
|
' -------------------------------------------------------------
|
|
' 9.6MHz:
|
|
' LFuse: 0x7A; HFuse: 0x1F;
|
|
' AVRDude: avrdude -B 10 -c USBasp -p attiny13 -U lfuse:w:0x7a:m -U hfuse:w:0x1f:m
|
|
'
|
|
' ******************************************************************
|
|
|
|
' Chip model
|
|
#chip tiny13, 9.6
|
|
#define q0 PORTB.3
|
|
#define q1 PORTB.4
|
|
dir q0 out
|
|
dir q1 out
|
|
|
|
'Startup routine
|
|
Startup:
|
|
|
|
'Main routine
|
|
Loop:
|
|
'Turn one output on, the other off
|
|
SET q0 ON
|
|
SET q1 OFF
|
|
Wait 33 ms
|
|
'Now toggle the outputs
|
|
|
|
SET q0 OFF
|
|
SET q1 ON
|
|
Wait 33 ms
|
|
'Jump back to the start of the program
|
|
goto Loop
|