- Timestamp:
- Apr 30, 2011, 9:37:02 AM (13 years ago)
- Branches:
- main
- Children:
- 13b28d3
- Parents:
- de0f65f
- Location:
- blinkled
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
blinkled/Makefile
rde0f65f rdf91872 1 1 #Set vars 2 COMPILE = avr-gcc -Wall -Os -std=c99 -mmcu=atmega8535 -DF_CPU=4000000 2 MCU=attiny2313 3 COMPILE = avr-gcc -Wall -Os -std=c99 -mmcu=$(MCU) -DF_CPU=20000000 3 4 4 5 #Rules … … 20 21 21 22 flash: 22 avrdude -c usbasp -p atmega8535-Uflash:w:blinkdel.hex23 avrdude -c usbasp -p $(MCU) -Uflash:w:blinkdel.hex 23 24 24 25 clean: -
blinkled/blinkdel.hex
rde0f65f rdf91872 1 :1000000014C01BC01AC019C018C017C016C015C034 2 :1000100014C013C012C011C010C00FC00EC00DC05C 3 :100020000CC00BC00AC009C008C011241FBECFE518 4 :10003000D2E0DEBFCDBF02D01BC0E2CF2FE088E10F 5 :1000400090E00FB6F894A89581BD0FBE21BD84E065 6 :1000500083BF87B38FEF87BB8AEA88BB91E0A895FF 7 :1000600008B600FEFCCF98BF88B38F5F88BBF7CF80 8 :04007000F894FFCF32 1 :1000000012C017C016C015C014C013C012C011C052 2 :1000100010C00FC00EC00DC00CC00BC00AC009C07C 3 :1000200008C007C006C011241FBECFEDCDBF02D04F 4 :100030001CC0E6CF2FE088E190E00FB6F894A895B9 5 :1000400081BD0FBE21BD10BE84E083BF81B38FEFA1 6 :1000500081BB8AEA82BB92E0A89508B601FEFCCF7C 7 :0E00600098BF82B38F5F82BBF7CFF894FFCFBB 9 8 :00000001FF -
blinkled/main.c
rde0f65f rdf91872 11 11 wdt_enable(WDTO_2S); 12 12 // configure timer 0 for a rate of 16M/(256 * 256) = ~244Hz 13 TCCR0 = 4; // timer 0 prescaler: 256 13 TCCR0A = 0; // timer 0 prescaler: 256 14 TCCR0B = 4; 14 15 15 16 //debug LED - output 16 DDR B|= 255;17 DDRD |= 255; 17 18 18 PORT B= 0xAA;19 PORTD = 0xAA; 19 20 20 21 while(1) { … … 25 26 if (TIFR & (1 << TOV0)) { 26 27 TIFR = (1 << TOV0); // reset flag 27 PORT B++;28 PORTD++; 28 29 } 29 30 }
Note:
See TracChangeset
for help on using the changeset viewer.