51 lines
1.3 KiB
Plaintext
51 lines
1.3 KiB
Plaintext
' ########### start ###########
|
|
' avr:tiny2313
|
|
' ########### end ###########
|
|
'
|
|
' ******************************************************************
|
|
' A program to flash LED on PORTB.0
|
|
' 2016-06-30 (c) Paolo Iocco
|
|
' ******************************************************************
|
|
'
|
|
' Circuit diagram
|
|
' ---------------
|
|
'
|
|
' +-\/-+
|
|
' /Reset PA2 1|o |20 Vcc
|
|
' RXD PD0 2| |19 PB7 SCK
|
|
' TXD PD1 3| |18 PB6 MISO
|
|
' PA1 4| |17 PB5 MOSI
|
|
' PA0 5| |16 PB4 OC1B
|
|
' PD2 6| |15 PB3 OC1A
|
|
' PD3 7| |14 PB2 OC0A
|
|
' PD4 8| |13 PB1 AIN1
|
|
' OC0B PD5 9| |12--PB0-AIN0---->LED
|
|
' GND 10| |11 PD6
|
|
' +----+
|
|
'
|
|
' -------------------------------------------------------------
|
|
' 9.6MHz:
|
|
' LFuse: 0xxx; HFuse: 0xxx;
|
|
' AVRDude: -U lfuse:w:0xxx:m -U hfuse:w:0xxx:m
|
|
'
|
|
' ******************************************************************
|
|
|
|
'Chip model
|
|
#chip tiny2313a,8
|
|
#define led PORTB.0
|
|
|
|
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
|
|
|