From 87db9dbe16841225a558444cbffb0468fa8acf57 Mon Sep 17 00:00:00 2001 From: cnlohr Date: Mon, 5 Dec 2016 20:01:29 -0500 Subject: Update: Found out one of the things was reversed. --- tools/avr_codegen/test.c | 44 +++++++++++++++++++++++++++++++++++++++----- tools/avr_codegen/test.elf | Bin 6832 -> 7140 bytes tools/avr_codegen/test.hex | 14 +++++++++----- 3 files changed, 48 insertions(+), 10 deletions(-) (limited to 'tools/avr_codegen') diff --git a/tools/avr_codegen/test.c b/tools/avr_codegen/test.c index ad01747..95b0155 100644 --- a/tools/avr_codegen/test.c +++ b/tools/avr_codegen/test.c @@ -19,7 +19,7 @@ static void setup_clock( void ) CLKPR = 0x80; /*Setup CLKPCE to be receptive*/ CLKPR = 0x00; /*No scalar*/ - OSCCAL = 0x60; //B8 is bottom E8 is top. + OSCCAL = 0x30; //B8 is bottom E8 is top. //This is gonna be about 1.8 MHz, turns out that's probably better than the 2MHz suggestion from the lighthouse-redox people. } @@ -28,7 +28,7 @@ int main( ) { cli(); setup_clock(); - DDRB = _BV(4); + DDRB = _BV(4) | _BV(3) | _BV(1); uint8_t marker; while(1) @@ -50,19 +50,53 @@ int main( ) // 14 = 0x95 0x01 // 15 = 0xa1 0x01 //0x10 = 0xab 0x01 - marker = 10; + marker = 30; do{ - PORTB = _BV(4); + PORTB = _BV(3); //4 = 0x40 3 = 0x48 1 = 0x50 + marker--; + PORTB = 0; + } while( marker ); + marker = 30; + do{ + PORTB = _BV(3)|_BV(1); //4 = 0x40 3 = 0x48 1 = 0x50 + marker--; + PORTB = 0; + } while( marker ); + marker = 30; + do{ + PORTB = _BV(3); //4 = 0x40 3 = 0x48 1 = 0x50 + marker--; + PORTB = 0; + } while( marker ); + do{ + PORTB = _BV(3)|_BV(4); //4 = 0x40 3 = 0x48 1 = 0x50 + marker--; + PORTB = 0; + } while( marker ); + do{ + PORTB = _BV(3); //4 = 0x40 3 = 0x48 1 = 0x50 marker--; PORTB = 0; } while( marker ); _delay_us(80); + +/* + marker = 30; + do{ + PORTB = _BV(0); + marker--; + PORTB = 0; + } while( marker ); +// _delay_us(80); marker = 10; do{ - PORTB = _BV(4); + PORTB = _BV(3); marker--; PORTB = 0; } while( marker ); + +*/ + /* _delay_us(16); marker = 20; do{ diff --git a/tools/avr_codegen/test.elf b/tools/avr_codegen/test.elf index 458f910..c9716a7 100755 Binary files a/tools/avr_codegen/test.elf and b/tools/avr_codegen/test.elf differ diff --git a/tools/avr_codegen/test.hex b/tools/avr_codegen/test.hex index 7c9a4cb..fbe1725 100644 --- a/tools/avr_codegen/test.hex +++ b/tools/avr_codegen/test.hex @@ -1,11 +1,15 @@ :100000000EC015C014C013C012C011C010C00FC064 :100010000EC00DC00CC00BC00AC009C008C011241E -:100020001FBECFE5D2E0DEBFCDBF1AD037C0E8CFCC +:100020001FBECFE5D2E0DEBFCDBF1AD050C0E8CFB3 :100030000F931F9300E010E0980106171707280799 :10004000390759F0EFECF7E03197F1F700C0000005 :100050000F5F1F4F2F4F3F4FF0CF1F910F9108950C -:10006000F89480E886BD16BC80E681BF80E187BB3E -:1000700090E18AE098BB18BA8150E1F785ED8A9546 -:10008000F1F700008AE098BB18BA8150E1F7EFE180 -:10009000FEE43197F1F700C00000EBCFF894FFCFFA +:10006000F89480E886BD16BC80E381BF8AE187BB37 +:1000700098E02AE038E18EE198BB18BA8150E1F7A8 +:100080008EE128BB18BA8150E1F78EE198BB18BA0F +:100090008150E1F745ED4A95F1F7000038BB8150FA +:1000A00018BA8111FBCFE5EDEA95F1F7000098BB96 +:1000B000815018BA8111FBCFF5EDFA95F1F70000E8 +:1000C000EFE1FEE43197F1F700C00000D4CFF894DF +:0200D000FFCF60 :00000001FF -- cgit v1.2.3