53 lines
1.5 KiB
Plaintext
53 lines
1.5 KiB
Plaintext
' ########### start ###########
|
|
' avr:tiny88
|
|
' ########### end ###########
|
|
'
|
|
' ******************************************************************
|
|
' A program to flash LED on PORTC.0
|
|
' 2016-06-30 (c) Paolo Iocco
|
|
' ******************************************************************
|
|
'
|
|
' Circuit diagram
|
|
' ---------------
|
|
' ATtiny 88 / Mega 168 / Mega 328 Pin map
|
|
' +-\/-+
|
|
' /Reset 1|o |28 PC5 ADC5
|
|
' RXD PD0 2| |27 PC4 ADC4
|
|
' TXD PD1 3| |26 PC3 ADC3
|
|
' PD2 4| |25 PC2 ADC2
|
|
' PD3 5| |24 PC1 ADC1
|
|
' PD4 6| |23--PC0-ADC0----->LED
|
|
' VCC 7| |22 GND
|
|
' GND 8| |21 AREF
|
|
' OSC1------------->9| |20 VCC
|
|
' OSC2------------>10| |19 PB5 SCK
|
|
' PD5 11| |18 PB4 MISO
|
|
' PD6 12| |17 PB3 OC2A MOSI
|
|
' PD7 13| |16 PB2 OC1B
|
|
' PB0 14| |15 PB1 OC1A
|
|
' +----+
|
|
' -------------------------------------------------------------
|
|
'
|
|
' 8MHz, internal RC Oscillator
|
|
' Fuses:
|
|
' AVRDude: avrdude -B 10 -c USBasp -p attiny88 -U lfuse:w:0xee:m -U hfuse:w:0xdf:m -U efuse:w:0xff:m
|
|
|
|
'Chip model
|
|
#chip tiny88, 8
|
|
#define led PORTC.0
|
|
|
|
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
|