Changeset f51aacc in avrstuff for test_2313_muserial/main.c
- Timestamp:
- Jul 29, 2014, 7:58:35 PM (10 years ago)
- Branches:
- main
- Children:
- 0db7c37
- Parents:
- b83dc2a
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
test_2313_muserial/main.c
rb83dc2a rf51aacc 8 8 #include <stdbool.h> 9 9 10 // muSerial: ATTiny2313 - LED = PD6 11 // K4KUSB: ATTiny2313 - LED = PB2 12 #define DDRLED DDRB 13 #define PORTLED PORTB 14 #define LEDBIT 1 << PB2 15 10 16 int main() { 11 17 wdt_enable(WDTO_2S); … … 15 21 16 22 //debug LED - output 17 DDR D |= 255;23 DDRLED |= 255; 18 24 19 PORT D = 0;25 PORTLED = 0; 20 26 21 27 // Serial PORT … … 24 30 25 31 UCSRB = (1<<RXEN) |(1<<TXEN); 26 UCSRC = (1 << UCSZ1) | (1 << UCSZ0); 32 UCSRC = (1 << UCSZ1) | (1 << UCSZ0); 27 33 28 34 while(1) { … … 33 39 if (TIFR & (1 << TOV0)) { 34 40 TIFR = (1 << TOV0); // reset flag 35 PORT D ^= (1<<PD6);41 PORTLED ^= LEDBIT; 36 42 37 43 UDR = 'H';
Note:
See TracChangeset
for help on using the changeset viewer.