diff --git a/Microcontrollers/.vs/Microcontrollers/v14/.atsuo b/Microcontrollers/.vs/Microcontrollers/v14/.atsuo index 3dabb46..da6127f 100644 Binary files a/Microcontrollers/.vs/Microcontrollers/v14/.atsuo and b/Microcontrollers/.vs/Microcontrollers/v14/.atsuo differ diff --git a/Microcontrollers/Eindopdracht/main.c b/Microcontrollers/Eindopdracht/main.c index 1bd21ec..2cd9d2e 100644 --- a/Microcontrollers/Eindopdracht/main.c +++ b/Microcontrollers/Eindopdracht/main.c @@ -15,7 +15,7 @@ #include "ultrasonic_sensor.h" -ISR(INT0_vect) +ISR(INT2_vect) { ultrasonic_handle_interrupt(); } diff --git a/Microcontrollers/Eindopdracht/ultrasonic_sensor.c b/Microcontrollers/Eindopdracht/ultrasonic_sensor.c index 430a118..2a5c6cb 100644 --- a/Microcontrollers/Eindopdracht/ultrasonic_sensor.c +++ b/Microcontrollers/Eindopdracht/ultrasonic_sensor.c @@ -40,9 +40,9 @@ void ultrasonic_init() DDRG = 0xFF; // port g all output. pin 0 is trig, the rest is for debug DDRD = 0x00; // port D pin 0 on input. 0 is echo and also interrupt - EICRA = 0x03; // interrupt PORTD on pin 0, rising edge + EICRA = 0x30; // interrupt PORTD on pin 2, rising edge - EIMSK |= 0x01; // enable interrupt on pin 0 (INT0) + EIMSK |= 0x04; // enable interrupt on pin 2 (INT2) TCCR1A = 0b00000000; // initialize timer1, prescaler=256 TCCR1B = 0b00001100; // CTC compare A, RUN @@ -63,7 +63,7 @@ void ultrasonic_handle_interrupt() if (int_stat == INTERRUPT_RISING) { // set interrupt pin 0 on PORTD to falling edge - EICRA = 0x02; + EICRA = 0x20; // reset the time in timer1 TCNT1 = 0x00; @@ -74,7 +74,7 @@ void ultrasonic_handle_interrupt() // else if it was generated on a falling edge (end sending echo) { // set interrupt pin 0 on PORTD to rising edge - EICRA = 0x03; + EICRA = 0x30; // interrupt PORTD on pin 2, rising edge // read timer1 into time_dist timer_dist = TCNT1; diff --git a/Microcontrollers/GLCD/Debug/GLCD.elf b/Microcontrollers/GLCD/Debug/GLCD.elf index 38d09ae..f3c4726 100644 Binary files a/Microcontrollers/GLCD/Debug/GLCD.elf and b/Microcontrollers/GLCD/Debug/GLCD.elf differ diff --git a/Microcontrollers/GLCD/Debug/GLCD.hex b/Microcontrollers/GLCD/Debug/GLCD.hex index bd240f2..369b05f 100644 --- a/Microcontrollers/GLCD/Debug/GLCD.hex +++ b/Microcontrollers/GLCD/Debug/GLCD.hex @@ -7,14 +7,12 @@ :100060001DC000001BC0000019C0000017C0000028 :1000700015C0000013C0000011C000000FC0000038 :100080000DC000000BC0000009C0000011241FBEFD -:10009000CFEFD0E1DEBFCDBF40D048C0B1CF20E030 +:10009000CFEFD0E1DEBFCDBF36D038C0B1CF20E04A :1000A00030E008C0E3ECF9E03197F1F700C0000060 -:1000B0002F5F3F4F28173907ACF3089588B380624C -:1000C00088BB81E28A95F1F7000088B38F7D88BBF9 -:1000D00081E28A95F1F70000089588B38E7F88BB8E -:1000E00088B38D7F88BB88B38B7F88BB88B3877FBD -:1000F00088BB8FE385BBE2CF089588B38E7F88BB32 -:1001000088B38D7F88BB88B38B7F88BB88B3877F9C -:1001100088BB8EE385BBD2CF0895DFDF80ED97E00B -:10012000BEDFEBDF80ED97E0BADFF7CFF894FFCFCB +:1000B0002F5F3F4F28173907ACF308958FEF84BBAC +:1000C00087BB88B38B6088BB84E190E0E8CF08955C +:1000D00088B3806188BB81E28A95F1F7000088B31C +:1000E0008F7E88BB81E28A95F1F70000089588B37E +:1000F0008E7F88BB88B38D7F88BB8FEF88BB8EE1F6 +:1001000085BBE6CF0895DADFF2DFFFCFF894FFCFAB :00000001FF diff --git a/Microcontrollers/GLCD/Debug/GLCD.lss b/Microcontrollers/GLCD/Debug/GLCD.lss index acce94c..b739cfe 100644 --- a/Microcontrollers/GLCD/Debug/GLCD.lss +++ b/Microcontrollers/GLCD/Debug/GLCD.lss @@ -3,29 +3,29 @@ GLCD.elf: file format elf32-avr Sections: Idx Name Size VMA LMA File off Algn - 0 .data 00000000 00800100 00800100 00000184 2**0 + 0 .data 00000000 00800100 00800100 00000164 2**0 CONTENTS, ALLOC, LOAD, DATA - 1 .text 00000130 00000000 00000000 00000054 2**1 + 1 .text 00000110 00000000 00000000 00000054 2**1 CONTENTS, ALLOC, LOAD, READONLY, CODE - 2 .comment 00000030 00000000 00000000 00000184 2**0 + 2 .comment 00000030 00000000 00000000 00000164 2**0 CONTENTS, READONLY - 3 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 000001b4 2**2 + 3 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 00000194 2**2 CONTENTS, READONLY - 4 .debug_aranges 00000040 00000000 00000000 000001f0 2**0 + 4 .debug_aranges 00000058 00000000 00000000 000001d0 2**0 CONTENTS, READONLY, DEBUGGING - 5 .debug_info 00000a18 00000000 00000000 00000230 2**0 + 5 .debug_info 00000aeb 00000000 00000000 00000228 2**0 CONTENTS, READONLY, DEBUGGING - 6 .debug_abbrev 00000882 00000000 00000000 00000c48 2**0 + 6 .debug_abbrev 00000891 00000000 00000000 00000d13 2**0 CONTENTS, READONLY, DEBUGGING - 7 .debug_line 00000369 00000000 00000000 000014ca 2**0 + 7 .debug_line 000003e0 00000000 00000000 000015a4 2**0 CONTENTS, READONLY, DEBUGGING - 8 .debug_frame 00000064 00000000 00000000 00001834 2**2 + 8 .debug_frame 00000094 00000000 00000000 00001984 2**2 CONTENTS, READONLY, DEBUGGING - 9 .debug_str 00000463 00000000 00000000 00001898 2**0 + 9 .debug_str 0000045b 00000000 00000000 00001a18 2**0 CONTENTS, READONLY, DEBUGGING - 10 .debug_loc 000000f4 00000000 00000000 00001cfb 2**0 + 10 .debug_loc 00000189 00000000 00000000 00001e73 2**0 CONTENTS, READONLY, DEBUGGING - 11 .debug_ranges 00000030 00000000 00000000 00001def 2**0 + 11 .debug_ranges 00000048 00000000 00000000 00001ffc 2**0 CONTENTS, READONLY, DEBUGGING Disassembly of section .text: @@ -109,28 +109,22 @@ Disassembly of section .text: 92: d0 e1 ldi r29, 0x10 ; 16 94: de bf out 0x3e, r29 ; 62 96: cd bf out 0x3d, r28 ; 61 - 98: 40 d0 rcall .+128 ; 0x11a
- 9a: 48 c0 rjmp .+144 ; 0x12c <_exit> + 98: 36 d0 rcall .+108 ; 0x106
+ 9a: 38 c0 rjmp .+112 ; 0x10c <_exit> 0000009c <__bad_interrupt>: 9c: b1 cf rjmp .-158 ; 0x0 <__vectors> 0000009e : - //is active low (refer to datasheet) - - -void wait( int ms ) -{ - for (int i=0; i command + DATAPORT = 0b0011111; //OFF command + trigger(); 9e: 20 e0 ldi r18, 0x00 ; 0 a0: 30 e0 ldi r19, 0x00 ; 0 a2: 08 c0 rjmp .+16 ; 0xb4 - #else - //round up by default - __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); - #endif - - __builtin_avr_delay_cycles(__ticks_dc); a4: e3 ec ldi r30, 0xC3 ; 195 a6: f9 e0 ldi r31, 0x09 ; 9 a8: 31 97 sbiw r30, 0x01 ; 1 @@ -142,129 +136,79 @@ void wait( int ms ) b4: 28 17 cp r18, r24 b6: 39 07 cpc r19, r25 b8: ac f3 brlt .-22 ; 0xa4 - { - _delay_ms( 1 ); // library function (max 30 ms at 8MHz) - } -} ba: 08 95 ret -000000bc : +000000bc : + bc: 8f ef ldi r24, 0xFF ; 255 + be: 84 bb out 0x14, r24 ; 20 + c0: 87 bb out 0x17, r24 ; 23 + c2: 88 b3 in r24, 0x18 ; 24 + c4: 8b 60 ori r24, 0x0B ; 11 + c6: 88 bb out 0x18, r24 ; 24 + c8: 84 e1 ldi r24, 0x14 ; 20 + ca: 90 e0 ldi r25, 0x00 ; 0 + cc: e8 cf rjmp .-48 ; 0x9e + ce: 08 95 ret -void trigger() -{ - CONTROLPORT |= GLCD_EN; //EN high - bc: 88 b3 in r24, 0x18 ; 24 - be: 80 62 ori r24, 0x20 ; 32 - c0: 88 bb out 0x18, r24 ; 24 - #else - //round up by default - __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); - #endif +000000d0 : + d0: 88 b3 in r24, 0x18 ; 24 + d2: 80 61 ori r24, 0x10 ; 16 + d4: 88 bb out 0x18, r24 ; 24 + d6: 81 e2 ldi r24, 0x21 ; 33 + d8: 8a 95 dec r24 + da: f1 f7 brne .-4 ; 0xd8 + dc: 00 00 nop + de: 88 b3 in r24, 0x18 ; 24 + e0: 8f 7e andi r24, 0xEF ; 239 + e2: 88 bb out 0x18, r24 ; 24 + e4: 81 e2 ldi r24, 0x21 ; 33 + e6: 8a 95 dec r24 + e8: f1 f7 brne .-4 ; 0xe6 + ea: 00 00 nop + ec: 08 95 ret - __builtin_avr_delay_cycles(__ticks_dc); - c2: 81 e2 ldi r24, 0x21 ; 33 - c4: 8a 95 dec r24 - c6: f1 f7 brne .-4 ; 0xc4 - c8: 00 00 nop - _delay_us(E_DELAY); - CONTROLPORT &= ~GLCD_EN; //EN low - ca: 88 b3 in r24, 0x18 ; 24 - cc: 8f 7d andi r24, 0xDF ; 223 - ce: 88 bb out 0x18, r24 ; 24 - d0: 81 e2 ldi r24, 0x21 ; 33 - d2: 8a 95 dec r24 - d4: f1 f7 brne .-4 ; 0xd2 - d6: 00 00 nop - d8: 08 95 ret - -000000da : -} -//---------------------- -void glcd_on() -{ - #ifdef GLCD_CS_ACTIVE_LOW - CONTROLPORT &= ~CS1; //Activate both chips - da: 88 b3 in r24, 0x18 ; 24 - dc: 8e 7f andi r24, 0xFE ; 254 - de: 88 bb out 0x18, r24 ; 24 - CONTROLPORT &= ~CS2; - e0: 88 b3 in r24, 0x18 ; 24 - e2: 8d 7f andi r24, 0xFD ; 253 - e4: 88 bb out 0x18, r24 ; 24 - #else - CONTROLPORT |= CS1; //Activate both chips - CONTROLPORT |= CS2; - #endif - CONTROLPORT &= ~GLCD_RS; //RS low --> command - e6: 88 b3 in r24, 0x18 ; 24 - e8: 8b 7f andi r24, 0xFB ; 251 - ea: 88 bb out 0x18, r24 ; 24 - CONTROLPORT &= ~GLCD_RW; //RW low --> write - ec: 88 b3 in r24, 0x18 ; 24 - ee: 87 7f andi r24, 0xF7 ; 247 - f0: 88 bb out 0x18, r24 ; 24 - DATAPORT = 0x3F; //ON command - f2: 8f e3 ldi r24, 0x3F ; 63 - f4: 85 bb out 0x15, r24 ; 21 - trigger(); - f6: e2 cf rjmp .-60 ; 0xbc - f8: 08 95 ret - -000000fa : +000000ee : } //---------------------- void glcd_off() { #ifdef GLCD_CS_ACTIVE_LOW CONTROLPORT &= ~CS1; //Activate both chips - fa: 88 b3 in r24, 0x18 ; 24 - fc: 8e 7f andi r24, 0xFE ; 254 - fe: 88 bb out 0x18, r24 ; 24 + ee: 88 b3 in r24, 0x18 ; 24 + f0: 8e 7f andi r24, 0xFE ; 254 + f2: 88 bb out 0x18, r24 ; 24 CONTROLPORT &= ~CS2; - 100: 88 b3 in r24, 0x18 ; 24 - 102: 8d 7f andi r24, 0xFD ; 253 - 104: 88 bb out 0x18, r24 ; 24 + f4: 88 b3 in r24, 0x18 ; 24 + f6: 8d 7f andi r24, 0xFD ; 253 + f8: 88 bb out 0x18, r24 ; 24 #else CONTROLPORT |= CS1; //Activate both chips CONTROLPORT |= CS2; #endif - CONTROLPORT &= ~GLCD_RS; //DI low --> command - 106: 88 b3 in r24, 0x18 ; 24 - 108: 8b 7f andi r24, 0xFB ; 251 - 10a: 88 bb out 0x18, r24 ; 24 - CONTROLPORT &= ~GLCD_RW; //RW low --> write - 10c: 88 b3 in r24, 0x18 ; 24 - 10e: 87 7f andi r24, 0xF7 ; 247 - 110: 88 bb out 0x18, r24 ; 24 - DATAPORT = 0x3E; //OFF command - 112: 8e e3 ldi r24, 0x3E ; 62 - 114: 85 bb out 0x15, r24 ; 21 + CONTROLPORT = ~GLCD_RST | ~GLCD_RW; //RS low --> command + fa: 8f ef ldi r24, 0xFF ; 255 + fc: 88 bb out 0x18, r24 ; 24 + DATAPORT = 0b0011110; //OFF command + fe: 8e e1 ldi r24, 0x1E ; 30 + 100: 85 bb out 0x15, r24 ; 21 trigger(); - 116: d2 cf rjmp .-92 ; 0xbc - 118: 08 95 ret + 102: e6 cf rjmp .-52 ; 0xd0 + 104: 08 95 ret + +00000106
: +} + -0000011a
: int main(void) { - while (1) - { - - glcd_on(); - 11a: df df rcall .-66 ; 0xda - wait(2000); - 11c: 80 ed ldi r24, 0xD0 ; 208 - 11e: 97 e0 ldi r25, 0x07 ; 7 - glcd_off(); - 120: be df rcall .-132 ; 0x9e - wait(2000); - 122: eb df rcall .-42 ; 0xfa - 124: 80 ed ldi r24, 0xD0 ; 208 - 126: 97 e0 ldi r25, 0x07 ; 7 - 128: ba df rcall .-140 ; 0x9e - 12a: f7 cf rjmp .-18 ; 0x11a
+ GLCD_init(); + 106: da df rcall .-76 ; 0xbc + glcd_off(); + 108: f2 df rcall .-28 ; 0xee + 10a: ff cf rjmp .-2 ; 0x10a -0000012c <_exit>: - 12c: f8 94 cli +0000010c <_exit>: + 10c: f8 94 cli -0000012e <__stop_program>: - 12e: ff cf rjmp .-2 ; 0x12e <__stop_program> +0000010e <__stop_program>: + 10e: ff cf rjmp .-2 ; 0x10e <__stop_program> diff --git a/Microcontrollers/GLCD/Debug/GLCD.map b/Microcontrollers/GLCD/Debug/GLCD.map index 0bb156f..ea6822a 100644 --- a/Microcontrollers/GLCD/Debug/GLCD.map +++ b/Microcontrollers/GLCD/Debug/GLCD.map @@ -10,6 +10,10 @@ Discarded input sections .text 0x00000000 0x0 main.o .data 0x00000000 0x0 main.o .bss 0x00000000 0x0 main.o + .text.wait_us 0x00000000 0x1a main.o + .text.GLCD_command + 0x00000000 0x2c main.o + .text.glcd_on 0x00000000 0x1a main.o .text 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) .data 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) .bss 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) @@ -153,7 +157,7 @@ END GROUP .rela.plt *(.rela.plt) -.text 0x00000000 0x130 +.text 0x00000000 0x110 *(.vectors) .vectors 0x00000000 0x8c C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o 0x00000000 __vector_default @@ -247,20 +251,21 @@ END GROUP *(.text.*) .text.wait 0x0000009e 0x1e main.o 0x0000009e wait - .text.trigger 0x000000bc 0x1e main.o - 0x000000bc trigger - .text.glcd_on 0x000000da 0x20 main.o - 0x000000da glcd_on + .text.GLCD_init + 0x000000bc 0x14 main.o + 0x000000bc GLCD_init + .text.trigger 0x000000d0 0x1e main.o + 0x000000d0 trigger .text.glcd_off - 0x000000fa 0x20 main.o - 0x000000fa glcd_off - .text.main 0x0000011a 0x12 main.o - 0x0000011a main - 0x0000012c . = ALIGN (0x2) + 0x000000ee 0x18 main.o + 0x000000ee glcd_off + .text.main 0x00000106 0x6 main.o + 0x00000106 main + 0x0000010c . = ALIGN (0x2) *(.fini9) - .fini9 0x0000012c 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) - 0x0000012c _exit - 0x0000012c exit + .fini9 0x0000010c 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) + 0x0000010c _exit + 0x0000010c exit *(.fini9) *(.fini8) *(.fini8) @@ -279,11 +284,11 @@ END GROUP *(.fini1) *(.fini1) *(.fini0) - .fini0 0x0000012c 0x4 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) + .fini0 0x0000010c 0x4 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) *(.fini0) - 0x00000130 _etext = . + 0x00000110 _etext = . -.data 0x00800100 0x0 load address 0x00000130 +.data 0x00800100 0x0 load address 0x00000110 [!provide] PROVIDE (__data_start, .) *(.data) *(.data*) @@ -301,8 +306,8 @@ END GROUP *(.bss*) *(COMMON) [!provide] PROVIDE (__bss_end, .) - 0x00000130 __data_load_start = LOADADDR (.data) - 0x00000130 __data_load_end = (__data_load_start + SIZEOF (.data)) + 0x00000110 __data_load_start = LOADADDR (.data) + 0x00000110 __data_load_end = (__data_load_start + SIZEOF (.data)) .noinit 0x00800100 0x0 [!provide] PROVIDE (__noinit_start, .) @@ -373,42 +378,42 @@ END GROUP .debug_sfnames *(.debug_sfnames) -.debug_aranges 0x00000000 0x40 +.debug_aranges 0x00000000 0x58 *(.debug_aranges) .debug_aranges - 0x00000000 0x40 main.o + 0x00000000 0x58 main.o .debug_pubnames *(.debug_pubnames) -.debug_info 0x00000000 0xa18 +.debug_info 0x00000000 0xaeb *(.debug_info .gnu.linkonce.wi.*) .debug_info 0x00000000 0x780 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o - .debug_info 0x00000780 0x298 main.o + .debug_info 0x00000780 0x36b main.o -.debug_abbrev 0x00000000 0x882 +.debug_abbrev 0x00000000 0x891 *(.debug_abbrev) .debug_abbrev 0x00000000 0x718 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o - .debug_abbrev 0x00000718 0x16a main.o + .debug_abbrev 0x00000718 0x179 main.o -.debug_line 0x00000000 0x369 +.debug_line 0x00000000 0x3e0 *(.debug_line .debug_line.* .debug_line_end) .debug_line 0x00000000 0x16a C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o - .debug_line 0x0000016a 0x1ff main.o + .debug_line 0x0000016a 0x276 main.o -.debug_frame 0x00000000 0x64 +.debug_frame 0x00000000 0x94 *(.debug_frame) - .debug_frame 0x00000000 0x64 main.o + .debug_frame 0x00000000 0x94 main.o -.debug_str 0x00000000 0x463 +.debug_str 0x00000000 0x45b *(.debug_str) .debug_str 0x00000000 0x27d C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o - .debug_str 0x0000027d 0x1e6 main.o - 0x21a (size before relaxing) + .debug_str 0x0000027d 0x1de main.o + 0x21f (size before relaxing) -.debug_loc 0x00000000 0xf4 +.debug_loc 0x00000000 0x189 *(.debug_loc) - .debug_loc 0x00000000 0xf4 main.o + .debug_loc 0x00000000 0x189 main.o .debug_macinfo *(.debug_macinfo) @@ -428,9 +433,9 @@ END GROUP .debug_pubtypes *(.debug_pubtypes) -.debug_ranges 0x00000000 0x30 +.debug_ranges 0x00000000 0x48 *(.debug_ranges) - .debug_ranges 0x00000000 0x30 main.o + .debug_ranges 0x00000000 0x48 main.o .debug_macro *(.debug_macro) diff --git a/Microcontrollers/GLCD/Debug/GLCD.srec b/Microcontrollers/GLCD/Debug/GLCD.srec index fecbe82..0e708a4 100644 --- a/Microcontrollers/GLCD/Debug/GLCD.srec +++ b/Microcontrollers/GLCD/Debug/GLCD.srec @@ -8,14 +8,12 @@ S113005025C0000023C0000021C000001FC0000014 S11300601DC000001BC0000019C0000017C0000024 S113007015C0000013C0000011C000000FC0000034 S11300800DC000000BC0000009C0000011241FBEF9 -S1130090CFEFD0E1DEBFCDBF40D048C0B1CF20E02C +S1130090CFEFD0E1DEBFCDBF36D038C0B1CF20E046 S11300A030E008C0E3ECF9E03197F1F700C000005C -S11300B02F5F3F4F28173907ACF3089588B3806248 -S11300C088BB81E28A95F1F7000088B38F7D88BBF5 -S11300D081E28A95F1F70000089588B38E7F88BB8A -S11300E088B38D7F88BB88B38B7F88BB88B3877FB9 -S11300F088BB8FE385BBE2CF089588B38E7F88BB2E -S113010088B38D7F88BB88B38B7F88BB88B3877F98 -S113011088BB8EE385BBD2CF0895DFDF80ED97E007 -S1130120BEDFEBDF80ED97E0BADFF7CFF894FFCFC7 +S11300B02F5F3F4F28173907ACF308958FEF84BBA8 +S11300C087BB88B38B6088BB84E190E0E8CF089558 +S11300D088B3806188BB81E28A95F1F7000088B318 +S11300E08F7E88BB81E28A95F1F70000089588B37A +S11300F08E7F88BB88B38D7F88BB8FEF88BB8EE1F2 +S113010085BBE6CF0895DADFF2DFFFCFF894FFCFA7 S9030000FC diff --git a/Microcontrollers/GLCD/Debug/main.o b/Microcontrollers/GLCD/Debug/main.o index d26a30a..a907234 100644 Binary files a/Microcontrollers/GLCD/Debug/main.o and b/Microcontrollers/GLCD/Debug/main.o differ diff --git a/Microcontrollers/GLCD/main.c b/Microcontrollers/GLCD/main.c index 4c975d1..03f94c5 100644 --- a/Microcontrollers/GLCD/main.c +++ b/Microcontrollers/GLCD/main.c @@ -34,13 +34,14 @@ typedef unsigned char byte; #define E_DELAY 10 #define DATAPORT PORTC #define CONTROLPORT PORTB +#define CONTTROLDDR DDRB #define DATADDR DDRC #define DATAPIN PINC #define GLCD_CS1 (1<<0) #define GLCD_CS2 (1<<1) -#define GLCD_RS (1<<2) -#define GLCD_RW (1<<3) -#define GLCD_EN (1<<5) +#define GLCD_RST (1<<3) +#define GLCD_RW (1<<2) +#define GLCD_EN (1<<4) #define GLCD_CS_ACTIVE_LOW 1 //Define this if your GLCD CS //is active low (refer to datasheet) @@ -53,6 +54,40 @@ void wait( int ms ) } } +void wait_us(int us) +{ + for (int i=0; i command - CONTROLPORT &= ~GLCD_RW; //RW low --> write - DATAPORT = 0x3F; //ON command + CONTROLPORT = ~GLCD_RST | ~GLCD_RW; //RS low --> command + DATAPORT = 0b0011111; //OFF command trigger(); } //---------------------- @@ -85,22 +119,20 @@ void glcd_off() CONTROLPORT |= CS1; //Activate both chips CONTROLPORT |= CS2; #endif - CONTROLPORT &= ~GLCD_RS; //DI low --> command - CONTROLPORT &= ~GLCD_RW; //RW low --> write - DATAPORT = 0x3E; //OFF command + CONTROLPORT = ~GLCD_RST | ~GLCD_RW; //RS low --> command + DATAPORT = 0b0011110; //OFF command trigger(); } int main(void) { + GLCD_init(); + glcd_off(); while (1) { - glcd_on(); - wait(2000); - glcd_off(); - wait(2000); + } } diff --git a/Microcontrollers/LCDMatrix/Debug/LCDMatrix.eep b/Microcontrollers/LCDMatrix/Debug/LCDMatrix.eep new file mode 100644 index 0000000..7c166a1 --- /dev/null +++ b/Microcontrollers/LCDMatrix/Debug/LCDMatrix.eep @@ -0,0 +1 @@ +:00000001FF diff --git a/Microcontrollers/LCDMatrix/Debug/LCDMatrix.elf b/Microcontrollers/LCDMatrix/Debug/LCDMatrix.elf new file mode 100644 index 0000000..a85c586 Binary files /dev/null and b/Microcontrollers/LCDMatrix/Debug/LCDMatrix.elf differ diff --git a/Microcontrollers/LCDMatrix/Debug/LCDMatrix.hex b/Microcontrollers/LCDMatrix/Debug/LCDMatrix.hex new file mode 100644 index 0000000..fe7141c --- /dev/null +++ b/Microcontrollers/LCDMatrix/Debug/LCDMatrix.hex @@ -0,0 +1,23 @@ +:1000000045C000004BC0000049C0000047C00000D0 +:1000100045C0000043C0000041C000003FC00000D8 +:100020003DC000003BC0000039C0000037C00000E8 +:1000300035C0000033C0000031C000002FC00000F8 +:100040002DC000002BC0000029C0000027C0000008 +:1000500025C0000023C0000021C000001FC0000018 +:100060001DC000001BC0000019C0000017C0000028 +:1000700015C0000013C0000011C000000FC0000038 +:100080000DC000000BC0000009C0000011241FBEFD +:10009000CFEFD0E1DEBFCDBF2DD05CC0B1CF10928D +:1000A000710080E280937000089584EA8093740068 +:1000B000809174008823E4F7089584E980937400A4 +:1000C00008958093730084E8809374008091740095 +:1000D0008823E4F7089520E030E008C0E9EFF0E07D +:1000E0003197F1F700C000002F5F3F4F2817390705 +:1000F000ACF30895D4DFD9DF80EEE3DF81E2E1DF06 +:10010000DCDFD3DF80EEDDDF80EADBDFD6DFCDDFD3 +:1001100080EED7DF83EED5DFD0DFC7DF80EED1DF23 +:1001200081E8CFDFCADFC1DF80EECBDF80E0C9DF4F +:1001300080E0C7DFC2DF84EF91E0CDDFB6DF80EE85 +:10014000C0DF80E0BEDF81E0BCDFB7DF84EF91E09D +:08015000C2DFE9CFF894FFCFF4 +:00000001FF diff --git a/Microcontrollers/LCDMatrix/Debug/LCDMatrix.lss b/Microcontrollers/LCDMatrix/Debug/LCDMatrix.lss new file mode 100644 index 0000000..25e07ba --- /dev/null +++ b/Microcontrollers/LCDMatrix/Debug/LCDMatrix.lss @@ -0,0 +1,306 @@ + +LCDMatrix.elf: file format elf32-avr + +Sections: +Idx Name Size VMA LMA File off Algn + 0 .data 00000000 00800100 00800100 000001ac 2**0 + CONTENTS, ALLOC, LOAD, DATA + 1 .text 00000158 00000000 00000000 00000054 2**1 + CONTENTS, ALLOC, LOAD, READONLY, CODE + 2 .comment 00000030 00000000 00000000 000001ac 2**0 + CONTENTS, READONLY + 3 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 000001dc 2**2 + CONTENTS, READONLY + 4 .debug_aranges 00000048 00000000 00000000 00000218 2**0 + CONTENTS, READONLY, DEBUGGING + 5 .debug_info 00000af1 00000000 00000000 00000260 2**0 + CONTENTS, READONLY, DEBUGGING + 6 .debug_abbrev 00000862 00000000 00000000 00000d51 2**0 + CONTENTS, READONLY, DEBUGGING + 7 .debug_line 0000040a 00000000 00000000 000015b3 2**0 + CONTENTS, READONLY, DEBUGGING + 8 .debug_frame 00000074 00000000 00000000 000019c0 2**2 + CONTENTS, READONLY, DEBUGGING + 9 .debug_str 00000441 00000000 00000000 00001a34 2**0 + CONTENTS, READONLY, DEBUGGING + 10 .debug_loc 00000097 00000000 00000000 00001e75 2**0 + CONTENTS, READONLY, DEBUGGING + 11 .debug_ranges 00000038 00000000 00000000 00001f0c 2**0 + CONTENTS, READONLY, DEBUGGING + +Disassembly of section .text: + +00000000 <__vectors>: + 0: 45 c0 rjmp .+138 ; 0x8c <__ctors_end> + 2: 00 00 nop + 4: 4b c0 rjmp .+150 ; 0x9c <__bad_interrupt> + 6: 00 00 nop + 8: 49 c0 rjmp .+146 ; 0x9c <__bad_interrupt> + a: 00 00 nop + c: 47 c0 rjmp .+142 ; 0x9c <__bad_interrupt> + e: 00 00 nop + 10: 45 c0 rjmp .+138 ; 0x9c <__bad_interrupt> + 12: 00 00 nop + 14: 43 c0 rjmp .+134 ; 0x9c <__bad_interrupt> + 16: 00 00 nop + 18: 41 c0 rjmp .+130 ; 0x9c <__bad_interrupt> + 1a: 00 00 nop + 1c: 3f c0 rjmp .+126 ; 0x9c <__bad_interrupt> + 1e: 00 00 nop + 20: 3d c0 rjmp .+122 ; 0x9c <__bad_interrupt> + 22: 00 00 nop + 24: 3b c0 rjmp .+118 ; 0x9c <__bad_interrupt> + 26: 00 00 nop + 28: 39 c0 rjmp .+114 ; 0x9c <__bad_interrupt> + 2a: 00 00 nop + 2c: 37 c0 rjmp .+110 ; 0x9c <__bad_interrupt> + 2e: 00 00 nop + 30: 35 c0 rjmp .+106 ; 0x9c <__bad_interrupt> + 32: 00 00 nop + 34: 33 c0 rjmp .+102 ; 0x9c <__bad_interrupt> + 36: 00 00 nop + 38: 31 c0 rjmp .+98 ; 0x9c <__bad_interrupt> + 3a: 00 00 nop + 3c: 2f c0 rjmp .+94 ; 0x9c <__bad_interrupt> + 3e: 00 00 nop + 40: 2d c0 rjmp .+90 ; 0x9c <__bad_interrupt> + 42: 00 00 nop + 44: 2b c0 rjmp .+86 ; 0x9c <__bad_interrupt> + 46: 00 00 nop + 48: 29 c0 rjmp .+82 ; 0x9c <__bad_interrupt> + 4a: 00 00 nop + 4c: 27 c0 rjmp .+78 ; 0x9c <__bad_interrupt> + 4e: 00 00 nop + 50: 25 c0 rjmp .+74 ; 0x9c <__bad_interrupt> + 52: 00 00 nop + 54: 23 c0 rjmp .+70 ; 0x9c <__bad_interrupt> + 56: 00 00 nop + 58: 21 c0 rjmp .+66 ; 0x9c <__bad_interrupt> + 5a: 00 00 nop + 5c: 1f c0 rjmp .+62 ; 0x9c <__bad_interrupt> + 5e: 00 00 nop + 60: 1d c0 rjmp .+58 ; 0x9c <__bad_interrupt> + 62: 00 00 nop + 64: 1b c0 rjmp .+54 ; 0x9c <__bad_interrupt> + 66: 00 00 nop + 68: 19 c0 rjmp .+50 ; 0x9c <__bad_interrupt> + 6a: 00 00 nop + 6c: 17 c0 rjmp .+46 ; 0x9c <__bad_interrupt> + 6e: 00 00 nop + 70: 15 c0 rjmp .+42 ; 0x9c <__bad_interrupt> + 72: 00 00 nop + 74: 13 c0 rjmp .+38 ; 0x9c <__bad_interrupt> + 76: 00 00 nop + 78: 11 c0 rjmp .+34 ; 0x9c <__bad_interrupt> + 7a: 00 00 nop + 7c: 0f c0 rjmp .+30 ; 0x9c <__bad_interrupt> + 7e: 00 00 nop + 80: 0d c0 rjmp .+26 ; 0x9c <__bad_interrupt> + 82: 00 00 nop + 84: 0b c0 rjmp .+22 ; 0x9c <__bad_interrupt> + 86: 00 00 nop + 88: 09 c0 rjmp .+18 ; 0x9c <__bad_interrupt> + ... + +0000008c <__ctors_end>: + 8c: 11 24 eor r1, r1 + 8e: 1f be out 0x3f, r1 ; 63 + 90: cf ef ldi r28, 0xFF ; 255 + 92: d0 e1 ldi r29, 0x10 ; 16 + 94: de bf out 0x3e, r29 ; 62 + 96: cd bf out 0x3d, r28 ; 61 + 98: 2d d0 rcall .+90 ; 0xf4
+ 9a: 5c c0 rjmp .+184 ; 0x154 <_exit> + +0000009c <__bad_interrupt>: + 9c: b1 cf rjmp .-158 ; 0x0 <__vectors> + +0000009e : +outputs: +notes: TWI clock is set to 100 kHz +Version : DMK, Initial code +*******************************************************************/ +{ + TWSR = 0; + 9e: 10 92 71 00 sts 0x0071, r1 ; 0x800071 <__TEXT_REGION_LENGTH__+0x7e0071> + TWBR = 32; // TWI clock set to 100kHz, prescaler = 0 + a2: 80 e2 ldi r24, 0x20 ; 32 + a4: 80 93 70 00 sts 0x0070, r24 ; 0x800070 <__TEXT_REGION_LENGTH__+0x7e0070> + a8: 08 95 ret + +000000aa : +outputs: +notes: +Version : DMK, Initial code +*******************************************************************/ +{ + TWCR = (0x80 | 0x20 | 0x04); + aa: 84 ea ldi r24, 0xA4 ; 164 + ac: 80 93 74 00 sts 0x0074, r24 ; 0x800074 <__TEXT_REGION_LENGTH__+0x7e0074> + while( 0x00 == (TWCR & 0x80) ); + b0: 80 91 74 00 lds r24, 0x0074 ; 0x800074 <__TEXT_REGION_LENGTH__+0x7e0074> + b4: 88 23 and r24, r24 + b6: e4 f7 brge .-8 ; 0xb0 +} + b8: 08 95 ret + +000000ba : +outputs: +notes: +Version : DMK, Initial code +*******************************************************************/ +{ + TWCR = (0x80 | 0x10 | 0x04); + ba: 84 e9 ldi r24, 0x94 ; 148 + bc: 80 93 74 00 sts 0x0074, r24 ; 0x800074 <__TEXT_REGION_LENGTH__+0x7e0074> + c0: 08 95 ret + +000000c2 : +outputs: +notes: +Version : DMK, Initial code +*******************************************************************/ +{ + TWDR = data; + c2: 80 93 73 00 sts 0x0073, r24 ; 0x800073 <__TEXT_REGION_LENGTH__+0x7e0073> + TWCR = (0x80 | 0x04); + c6: 84 e8 ldi r24, 0x84 ; 132 + c8: 80 93 74 00 sts 0x0074, r24 ; 0x800074 <__TEXT_REGION_LENGTH__+0x7e0074> + while( 0 == (TWCR & 0x80) ); + cc: 80 91 74 00 lds r24, 0x0074 ; 0x800074 <__TEXT_REGION_LENGTH__+0x7e0074> + d0: 88 23 and r24, r24 + d2: e4 f7 brge .-8 ; 0xcc +} + d4: 08 95 ret + +000000d6 : + clock value is set. This is used by _delay_ms inside + util/delay.h +Version : DMK, Initial code +*******************************************************************/ +{ + for (int i=0; i + #else + //round up by default + __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); + #endif + + __builtin_avr_delay_cycles(__ticks_dc); + dc: e9 ef ldi r30, 0xF9 ; 249 + de: f0 e0 ldi r31, 0x00 ; 0 + e0: 31 97 sbiw r30, 0x01 ; 1 + e2: f1 f7 brne .-4 ; 0xe0 + e4: 00 c0 rjmp .+0 ; 0xe6 + e6: 00 00 nop + e8: 2f 5f subi r18, 0xFF ; 255 + ea: 3f 4f sbci r19, 0xFF ; 255 + ec: 28 17 cp r18, r24 + ee: 39 07 cpc r19, r25 + f0: ac f3 brlt .-22 ; 0xdc + { + _delay_ms( 1 ); // library function (max 30 ms at 8MHz) + } +} + f2: 08 95 ret + +000000f4
: +notes: Looping forever, trashing the HT16K33 +Version : DMK, Initial code +*******************************************************************/ +{ + + twi_init(); // Init TWI interface + f4: d4 df rcall .-88 ; 0x9e + + // Init HT16K22. Page 32 datasheet + twi_start(); + f6: d9 df rcall .-78 ; 0xaa + twi_tx(0xE0); // Display I2C addres + R/W bit + f8: 80 ee ldi r24, 0xE0 ; 224 + fa: e3 df rcall .-58 ; 0xc2 + twi_tx(0x21); // Internal osc on (page 10 HT16K33) + fc: 81 e2 ldi r24, 0x21 ; 33 + fe: e1 df rcall .-62 ; 0xc2 + twi_stop(); + 100: dc df rcall .-72 ; 0xba + + twi_start(); + 102: d3 df rcall .-90 ; 0xaa + twi_tx(0xE0); // Display I2C address + R/W bit + 104: 80 ee ldi r24, 0xE0 ; 224 + 106: dd df rcall .-70 ; 0xc2 + twi_tx(0xA0); // HT16K33 pins all output + 108: 80 ea ldi r24, 0xA0 ; 160 + twi_stop(); + 10a: db df rcall .-74 ; 0xc2 + + twi_start(); + 10c: d6 df rcall .-84 ; 0xba + twi_tx(0xE0); // Display I2C address + R/W bit + 10e: cd df rcall .-102 ; 0xaa + twi_tx(0xE3); // Display Dimming 4/16 duty cycle + 110: 80 ee ldi r24, 0xE0 ; 224 + 112: d7 df rcall .-82 ; 0xc2 + twi_stop(); + 114: 83 ee ldi r24, 0xE3 ; 227 + + twi_start(); + 116: d5 df rcall .-86 ; 0xc2 + twi_tx(0xE0); // Display I2C address + R/W bit + 118: d0 df rcall .-96 ; 0xba + 11a: c7 df rcall .-114 ; 0xaa + twi_tx(0x81); // Display OFF - Blink On + 11c: 80 ee ldi r24, 0xE0 ; 224 + 11e: d1 df rcall .-94 ; 0xc2 + twi_stop(); + 120: 81 e8 ldi r24, 0x81 ; 129 + + while (1) + { + twi_start(); + 122: cf df rcall .-98 ; 0xc2 + twi_tx(0xE0); // Display I2C addres + R/W bit + 124: ca df rcall .-108 ; 0xba + 126: c1 df rcall .-126 ; 0xaa + twi_tx(0x00); // Address + 128: 80 ee ldi r24, 0xE0 ; 224 + 12a: cb df rcall .-106 ; 0xc2 + 12c: 80 e0 ldi r24, 0x00 ; 0 + twi_tx(0x00); // data + 12e: c9 df rcall .-110 ; 0xc2 + 130: 80 e0 ldi r24, 0x00 ; 0 + 132: c7 df rcall .-114 ; 0xc2 + twi_stop(); + 134: c2 df rcall .-124 ; 0xba + 136: 84 ef ldi r24, 0xF4 ; 244 + + wait(500); + 138: 91 e0 ldi r25, 0x01 ; 1 + 13a: cd df rcall .-102 ; 0xd6 + 13c: b6 df rcall .-148 ; 0xaa + 13e: 80 ee ldi r24, 0xE0 ; 224 + + twi_start(); + 140: c0 df rcall .-128 ; 0xc2 + 142: 80 e0 ldi r24, 0x00 ; 0 + twi_tx(0xE0); // Display I2C addres + R/W bit + 144: be df rcall .-132 ; 0xc2 + 146: 81 e0 ldi r24, 0x01 ; 1 + 148: bc df rcall .-136 ; 0xc2 + twi_tx(0x00); // Address + 14a: b7 df rcall .-146 ; 0xba + 14c: 84 ef ldi r24, 0xF4 ; 244 + 14e: 91 e0 ldi r25, 0x01 ; 1 + twi_tx(0x01); // data + 150: c2 df rcall .-124 ; 0xd6 + 152: e9 cf rjmp .-46 ; 0x126 + +00000154 <_exit>: + 154: f8 94 cli + +00000156 <__stop_program>: + twi_stop(); + 156: ff cf rjmp .-2 ; 0x156 <__stop_program> diff --git a/Microcontrollers/LCDMatrix/Debug/LCDMatrix.map b/Microcontrollers/LCDMatrix/Debug/LCDMatrix.map new file mode 100644 index 0000000..73b41bc --- /dev/null +++ b/Microcontrollers/LCDMatrix/Debug/LCDMatrix.map @@ -0,0 +1,442 @@ +Archive member included to satisfy reference by file (symbol) + +c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) + C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o (exit) + +Discarded input sections + + .data 0x00000000 0x0 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o + .bss 0x00000000 0x0 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o + .text 0x00000000 0x0 main.o + .data 0x00000000 0x0 main.o + .bss 0x00000000 0x0 main.o + .text 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) + .data 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) + .bss 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) + .text.libgcc.mul + 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) + .text.libgcc.div + 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) + .text.libgcc 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) + .text.libgcc.prologue + 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) + .text.libgcc.builtins + 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) + .text.libgcc.fmul + 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) + .text.libgcc.fixed + 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) + +Memory Configuration + +Name Origin Length Attributes +text 0x00000000 0x00020000 xr +data 0x00800100 0x00001000 rw !x +eeprom 0x00810000 0x00001000 rw !x +fuse 0x00820000 0x00000003 rw !x +lock 0x00830000 0x00000400 rw !x +signature 0x00840000 0x00000400 rw !x +user_signatures 0x00850000 0x00000400 rw !x +*default* 0x00000000 0xffffffff + +Linker script and memory map + +Address of section .data set to 0x800100 +LOAD C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o +LOAD main.o +START GROUP +LOAD c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avr51\libm.a +END GROUP +START GROUP +LOAD c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a +LOAD c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avr51\libm.a +LOAD c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/../../../../avr/lib/avr51\libc.a +LOAD C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51\libatmega128.a +END GROUP + 0x00000000 __TEXT_REGION_ORIGIN__ = DEFINED (__TEXT_REGION_ORIGIN__)?__TEXT_REGION_ORIGIN__:0x0 + [0x00800100] __DATA_REGION_ORIGIN__ = DEFINED (__DATA_REGION_ORIGIN__)?__DATA_REGION_ORIGIN__:0x800100 + [0x00020000] __TEXT_REGION_LENGTH__ = DEFINED (__TEXT_REGION_LENGTH__)?__TEXT_REGION_LENGTH__:0x20000 + [0x00001000] __DATA_REGION_LENGTH__ = DEFINED (__DATA_REGION_LENGTH__)?__DATA_REGION_LENGTH__:0xff00 + [0x00001000] __EEPROM_REGION_LENGTH__ = DEFINED (__EEPROM_REGION_LENGTH__)?__EEPROM_REGION_LENGTH__:0x10000 + [0x00000003] __FUSE_REGION_LENGTH__ = DEFINED (__FUSE_REGION_LENGTH__)?__FUSE_REGION_LENGTH__:0x400 + 0x00000400 __LOCK_REGION_LENGTH__ = DEFINED (__LOCK_REGION_LENGTH__)?__LOCK_REGION_LENGTH__:0x400 + 0x00000400 __SIGNATURE_REGION_LENGTH__ = DEFINED (__SIGNATURE_REGION_LENGTH__)?__SIGNATURE_REGION_LENGTH__:0x400 + 0x00000400 __USER_SIGNATURE_REGION_LENGTH__ = DEFINED (__USER_SIGNATURE_REGION_LENGTH__)?__USER_SIGNATURE_REGION_LENGTH__:0x400 + +.hash + *(.hash) + +.dynsym + *(.dynsym) + +.dynstr + *(.dynstr) + +.gnu.version + *(.gnu.version) + +.gnu.version_d + *(.gnu.version_d) + +.gnu.version_r + *(.gnu.version_r) + +.rel.init + *(.rel.init) + +.rela.init + *(.rela.init) + +.rel.text + *(.rel.text) + *(.rel.text.*) + *(.rel.gnu.linkonce.t*) + +.rela.text + *(.rela.text) + *(.rela.text.*) + *(.rela.gnu.linkonce.t*) + +.rel.fini + *(.rel.fini) + +.rela.fini + *(.rela.fini) + +.rel.rodata + *(.rel.rodata) + *(.rel.rodata.*) + *(.rel.gnu.linkonce.r*) + +.rela.rodata + *(.rela.rodata) + *(.rela.rodata.*) + *(.rela.gnu.linkonce.r*) + +.rel.data + *(.rel.data) + *(.rel.data.*) + *(.rel.gnu.linkonce.d*) + +.rela.data + *(.rela.data) + *(.rela.data.*) + *(.rela.gnu.linkonce.d*) + +.rel.ctors + *(.rel.ctors) + +.rela.ctors + *(.rela.ctors) + +.rel.dtors + *(.rel.dtors) + +.rela.dtors + *(.rela.dtors) + +.rel.got + *(.rel.got) + +.rela.got + *(.rela.got) + +.rel.bss + *(.rel.bss) + +.rela.bss + *(.rela.bss) + +.rel.plt + *(.rel.plt) + +.rela.plt + *(.rela.plt) + +.text 0x00000000 0x158 + *(.vectors) + .vectors 0x00000000 0x8c C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o + 0x00000000 __vector_default + 0x00000000 __vectors + *(.vectors) + *(.progmem.gcc*) + 0x0000008c . = ALIGN (0x2) + 0x0000008c __trampolines_start = . + *(.trampolines) + .trampolines 0x0000008c 0x0 linker stubs + *(.trampolines*) + 0x0000008c __trampolines_end = . + *libprintf_flt.a:*(.progmem.data) + *libc.a:*(.progmem.data) + *(.progmem*) + 0x0000008c . = ALIGN (0x2) + *(.jumptables) + *(.jumptables*) + *(.lowtext) + *(.lowtext*) + 0x0000008c __ctors_start = . + *(.ctors) + 0x0000008c __ctors_end = . + 0x0000008c __dtors_start = . + *(.dtors) + 0x0000008c __dtors_end = . + SORT(*)(.ctors) + SORT(*)(.dtors) + *(.init0) + .init0 0x0000008c 0x0 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o + 0x0000008c __init + *(.init0) + *(.init1) + *(.init1) + *(.init2) + .init2 0x0000008c 0xc C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o + *(.init2) + *(.init3) + *(.init3) + *(.init4) + *(.init4) + *(.init5) + *(.init5) + *(.init6) + *(.init6) + *(.init7) + *(.init7) + *(.init8) + *(.init8) + *(.init9) + .init9 0x00000098 0x4 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o + *(.init9) + *(.text) + .text 0x0000009c 0x2 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o + 0x0000009c __vector_22 + 0x0000009c __vector_28 + 0x0000009c __vector_1 + 0x0000009c __vector_32 + 0x0000009c __vector_34 + 0x0000009c __vector_24 + 0x0000009c __vector_12 + 0x0000009c __bad_interrupt + 0x0000009c __vector_6 + 0x0000009c __vector_31 + 0x0000009c __vector_3 + 0x0000009c __vector_23 + 0x0000009c __vector_30 + 0x0000009c __vector_25 + 0x0000009c __vector_11 + 0x0000009c __vector_13 + 0x0000009c __vector_17 + 0x0000009c __vector_19 + 0x0000009c __vector_7 + 0x0000009c __vector_27 + 0x0000009c __vector_5 + 0x0000009c __vector_33 + 0x0000009c __vector_4 + 0x0000009c __vector_9 + 0x0000009c __vector_2 + 0x0000009c __vector_21 + 0x0000009c __vector_15 + 0x0000009c __vector_29 + 0x0000009c __vector_8 + 0x0000009c __vector_26 + 0x0000009c __vector_14 + 0x0000009c __vector_10 + 0x0000009c __vector_16 + 0x0000009c __vector_18 + 0x0000009c __vector_20 + 0x0000009e . = ALIGN (0x2) + *(.text.*) + .text.twi_init + 0x0000009e 0xc main.o + 0x0000009e twi_init + .text.twi_start + 0x000000aa 0x10 main.o + 0x000000aa twi_start + .text.twi_stop + 0x000000ba 0x8 main.o + 0x000000ba twi_stop + .text.twi_tx 0x000000c2 0x14 main.o + 0x000000c2 twi_tx + .text.wait 0x000000d6 0x1e main.o + 0x000000d6 wait + .text.main 0x000000f4 0x60 main.o + 0x000000f4 main + 0x00000154 . = ALIGN (0x2) + *(.fini9) + .fini9 0x00000154 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) + 0x00000154 _exit + 0x00000154 exit + *(.fini9) + *(.fini8) + *(.fini8) + *(.fini7) + *(.fini7) + *(.fini6) + *(.fini6) + *(.fini5) + *(.fini5) + *(.fini4) + *(.fini4) + *(.fini3) + *(.fini3) + *(.fini2) + *(.fini2) + *(.fini1) + *(.fini1) + *(.fini0) + .fini0 0x00000154 0x4 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o) + *(.fini0) + 0x00000158 _etext = . + +.data 0x00800100 0x0 load address 0x00000158 + [!provide] PROVIDE (__data_start, .) + *(.data) + *(.data*) + *(.gnu.linkonce.d*) + *(.rodata) + *(.rodata*) + *(.gnu.linkonce.r*) + 0x00800100 . = ALIGN (0x2) + 0x00800100 _edata = . + [!provide] PROVIDE (__data_end, .) + +.bss 0x00800100 0x0 + [!provide] PROVIDE (__bss_start, .) + *(.bss) + *(.bss*) + *(COMMON) + [!provide] PROVIDE (__bss_end, .) + 0x00000158 __data_load_start = LOADADDR (.data) + 0x00000158 __data_load_end = (__data_load_start + SIZEOF (.data)) + +.noinit 0x00800100 0x0 + [!provide] PROVIDE (__noinit_start, .) + *(.noinit*) + [!provide] PROVIDE (__noinit_end, .) + 0x00800100 _end = . + [!provide] PROVIDE (__heap_start, .) + +.eeprom 0x00810000 0x0 + *(.eeprom*) + 0x00810000 __eeprom_end = . + +.fuse + *(.fuse) + *(.lfuse) + *(.hfuse) + *(.efuse) + +.lock + *(.lock*) + +.signature + *(.signature*) + +.user_signatures + *(.user_signatures*) + +.stab + *(.stab) + +.stabstr + *(.stabstr) + +.stab.excl + *(.stab.excl) + +.stab.exclstr + *(.stab.exclstr) + +.stab.index + *(.stab.index) + +.stab.indexstr + *(.stab.indexstr) + +.comment 0x00000000 0x30 + *(.comment) + .comment 0x00000000 0x30 main.o + 0x31 (size before relaxing) + +.note.gnu.avr.deviceinfo + 0x00000000 0x3c + .note.gnu.avr.deviceinfo + 0x00000000 0x3c C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o + +.note.gnu.build-id + *(.note.gnu.build-id) + +.debug + *(.debug) + +.line + *(.line) + +.debug_srcinfo + *(.debug_srcinfo) + +.debug_sfnames + *(.debug_sfnames) + +.debug_aranges 0x00000000 0x48 + *(.debug_aranges) + .debug_aranges + 0x00000000 0x48 main.o + +.debug_pubnames + *(.debug_pubnames) + +.debug_info 0x00000000 0xaf1 + *(.debug_info .gnu.linkonce.wi.*) + .debug_info 0x00000000 0x780 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o + .debug_info 0x00000780 0x371 main.o + +.debug_abbrev 0x00000000 0x862 + *(.debug_abbrev) + .debug_abbrev 0x00000000 0x718 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o + .debug_abbrev 0x00000718 0x14a main.o + +.debug_line 0x00000000 0x40a + *(.debug_line .debug_line.* .debug_line_end) + .debug_line 0x00000000 0x16a C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o + .debug_line 0x0000016a 0x2a0 main.o + +.debug_frame 0x00000000 0x74 + *(.debug_frame) + .debug_frame 0x00000000 0x74 main.o + +.debug_str 0x00000000 0x441 + *(.debug_str) + .debug_str 0x00000000 0x27d C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o + .debug_str 0x0000027d 0x1c4 main.o + 0x1f8 (size before relaxing) + +.debug_loc 0x00000000 0x97 + *(.debug_loc) + .debug_loc 0x00000000 0x97 main.o + +.debug_macinfo + *(.debug_macinfo) + +.debug_weaknames + *(.debug_weaknames) + +.debug_funcnames + *(.debug_funcnames) + +.debug_typenames + *(.debug_typenames) + +.debug_varnames + *(.debug_varnames) + +.debug_pubtypes + *(.debug_pubtypes) + +.debug_ranges 0x00000000 0x38 + *(.debug_ranges) + .debug_ranges 0x00000000 0x38 main.o + +.debug_macro + *(.debug_macro) +OUTPUT(LCDMatrix.elf elf32-avr) +LOAD linker stubs diff --git a/Microcontrollers/LCDMatrix/Debug/LCDMatrix.srec b/Microcontrollers/LCDMatrix/Debug/LCDMatrix.srec new file mode 100644 index 0000000..a081bbe --- /dev/null +++ b/Microcontrollers/LCDMatrix/Debug/LCDMatrix.srec @@ -0,0 +1,24 @@ +S01100004C43444D61747269782E73726563CB +S113000045C000004BC0000049C0000047C00000CC +S113001045C0000043C0000041C000003FC00000D4 +S11300203DC000003BC0000039C0000037C00000E4 +S113003035C0000033C0000031C000002FC00000F4 +S11300402DC000002BC0000029C0000027C0000004 +S113005025C0000023C0000021C000001FC0000014 +S11300601DC000001BC0000019C0000017C0000024 +S113007015C0000013C0000011C000000FC0000034 +S11300800DC000000BC0000009C0000011241FBEF9 +S1130090CFEFD0E1DEBFCDBF2DD05CC0B1CF109289 +S11300A0710080E280937000089584EA8093740064 +S11300B0809174008823E4F7089584E980937400A0 +S11300C008958093730084E8809374008091740091 +S11300D08823E4F7089520E030E008C0E9EFF0E079 +S11300E03197F1F700C000002F5F3F4F2817390701 +S11300F0ACF30895D4DFD9DF80EEE3DF81E2E1DF02 +S1130100DCDFD3DF80EEDDDF80EADBDFD6DFCDDFCF +S113011080EED7DF83EED5DFD0DFC7DF80EED1DF1F +S113012081E8CFDFCADFC1DF80EECBDF80E0C9DF4B +S113013080E0C7DFC2DF84EF91E0CDDFB6DF80EE81 +S1130140C0DF80E0BEDF81E0BCDFB7DF84EF91E099 +S10B0150C2DFE9CFF894FFCFF0 +S9030000FC diff --git a/Microcontrollers/LCDMatrix/Debug/Makefile b/Microcontrollers/LCDMatrix/Debug/Makefile new file mode 100644 index 0000000..2590bde --- /dev/null +++ b/Microcontrollers/LCDMatrix/Debug/Makefile @@ -0,0 +1,127 @@ +################################################################################ +# Automatically-generated file. Do not edit! +################################################################################ + +SHELL := cmd.exe +RM := rm -rf + +USER_OBJS := + +LIBS := +PROJ := + +O_SRCS := +C_SRCS := +S_SRCS := +S_UPPER_SRCS := +OBJ_SRCS := +ASM_SRCS := +PREPROCESSING_SRCS := +OBJS := +OBJS_AS_ARGS := +C_DEPS := +C_DEPS_AS_ARGS := +EXECUTABLES := +OUTPUT_FILE_PATH := +OUTPUT_FILE_PATH_AS_ARGS := +AVR_APP_PATH :=$$$AVR_APP_PATH$$$ +QUOTE := " +ADDITIONAL_DEPENDENCIES:= +OUTPUT_FILE_DEP:= +LIB_DEP:= +LINKER_SCRIPT_DEP:= + +# Every subdirectory with source files must be described here +SUBDIRS := + + +# Add inputs and outputs from these tool invocations to the build variables +C_SRCS += \ +../main.c + + +PREPROCESSING_SRCS += + + +ASM_SRCS += + + +OBJS += \ +main.o + +OBJS_AS_ARGS += \ +main.o + +C_DEPS += \ +main.d + +C_DEPS_AS_ARGS += \ +main.d + +OUTPUT_FILE_PATH +=LCDMatrix.elf + +OUTPUT_FILE_PATH_AS_ARGS +=LCDMatrix.elf + +ADDITIONAL_DEPENDENCIES:= + +OUTPUT_FILE_DEP:= ./makedep.mk + +LIB_DEP+= + +LINKER_SCRIPT_DEP+= + + +# AVR32/GNU C Compiler +./main.o: .././main.c + @echo Building file: $< + @echo Invoking: AVR/GNU C Compiler : 5.4.0 + $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -x c -funsigned-char -funsigned-bitfields -DDEBUG -I"C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\include" -Og -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -mrelax -g2 -Wall -mmcu=atmega128 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega128" -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<" + @echo Finished building: $< + + + + + +# AVR32/GNU Preprocessing Assembler + + + +# AVR32/GNU Assembler + + + + +ifneq ($(MAKECMDGOALS),clean) +ifneq ($(strip $(C_DEPS)),) +-include $(C_DEPS) +endif +endif + +# Add inputs and outputs from these tool invocations to the build variables + +# All Target +all: $(OUTPUT_FILE_PATH) $(ADDITIONAL_DEPENDENCIES) + +$(OUTPUT_FILE_PATH): $(OBJS) $(USER_OBJS) $(OUTPUT_FILE_DEP) $(LIB_DEP) $(LINKER_SCRIPT_DEP) + @echo Building target: $@ + @echo Invoking: AVR/GNU Linker : 5.4.0 + $(QUOTE)C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-gcc.exe$(QUOTE) -o$(OUTPUT_FILE_PATH_AS_ARGS) $(OBJS_AS_ARGS) $(USER_OBJS) $(LIBS) -Wl,-Map="LCDMatrix.map" -Wl,--start-group -Wl,-lm -Wl,--end-group -Wl,--gc-sections -mrelax -mmcu=atmega128 -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega128" + @echo Finished building target: $@ + "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O ihex -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "LCDMatrix.elf" "LCDMatrix.hex" + "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -j .eeprom --set-section-flags=.eeprom=alloc,load --change-section-lma .eeprom=0 --no-change-warnings -O ihex "LCDMatrix.elf" "LCDMatrix.eep" || exit 0 + "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objdump.exe" -h -S "LCDMatrix.elf" > "LCDMatrix.lss" + "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-objcopy.exe" -O srec -R .eeprom -R .fuse -R .lock -R .signature -R .user_signatures "LCDMatrix.elf" "LCDMatrix.srec" + "C:\Program Files (x86)\Atmel\Studio\7.0\toolchain\avr8\avr8-gnu-toolchain\bin\avr-size.exe" "LCDMatrix.elf" + + + + + + + +# Other Targets +clean: + -$(RM) $(OBJS_AS_ARGS) $(EXECUTABLES) + -$(RM) $(C_DEPS_AS_ARGS) + rm -rf "LCDMatrix.elf" "LCDMatrix.a" "LCDMatrix.hex" "LCDMatrix.lss" "LCDMatrix.eep" "LCDMatrix.map" "LCDMatrix.srec" "LCDMatrix.usersignatures" + \ No newline at end of file diff --git a/Microcontrollers/LCDMatrix/Debug/main.d b/Microcontrollers/LCDMatrix/Debug/main.d new file mode 100644 index 0000000..61b4897 --- /dev/null +++ b/Microcontrollers/LCDMatrix/Debug/main.d @@ -0,0 +1,43 @@ +main.d main.o: .././main.c \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\io.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\sfr_defs.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\inttypes.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\5.4.0\include\stdint.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdint.h \ + C:\Program\ Files\ (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\include/avr/iom128.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\portpins.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\common.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\version.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\fuse.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\lock.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay_basic.h \ + c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\math.h + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\io.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\sfr_defs.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\inttypes.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\lib\gcc\avr\5.4.0\include\stdint.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\stdint.h: + +C:\Program\ Files\ (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\include/avr/iom128.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\portpins.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\common.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\version.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\fuse.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\lock.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\util\delay_basic.h: + +c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\math.h: diff --git a/Microcontrollers/LCDMatrix/Debug/main.o b/Microcontrollers/LCDMatrix/Debug/main.o new file mode 100644 index 0000000..a6d661e Binary files /dev/null and b/Microcontrollers/LCDMatrix/Debug/main.o differ diff --git a/Microcontrollers/LCDMatrix/Debug/makedep.mk b/Microcontrollers/LCDMatrix/Debug/makedep.mk new file mode 100644 index 0000000..6a14fde --- /dev/null +++ b/Microcontrollers/LCDMatrix/Debug/makedep.mk @@ -0,0 +1,6 @@ +################################################################################ +# Automatically-generated file. Do not edit or delete the file +################################################################################ + +main.c + diff --git a/Microcontrollers/LCDMatrix/LCDMatrix.componentinfo.xml b/Microcontrollers/LCDMatrix/LCDMatrix.componentinfo.xml new file mode 100644 index 0000000..6df69e8 --- /dev/null +++ b/Microcontrollers/LCDMatrix/LCDMatrix.componentinfo.xml @@ -0,0 +1,86 @@ + + + + + + + Device + Startup + + + Atmel + 1.6.0 + C:/Program Files (x86)\Atmel\Studio\7.0\Packs + + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\include\ + + include + C + + + include/ + + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\include\avr\iom128.h + + header + C + JdJ7J9I/SJh965SEyyyVYw== + + include/avr/iom128.h + + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\templates\main.c + template + source + C Exe + 6mHOoYAUNxBqAyAmwd7zvA== + + templates/main.c + Main file (.c) + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\templates\main.cpp + template + source + C Exe + mkKaE95TOoATsuBGv6jmxg== + + templates/main.cpp + Main file (.cpp) + + + + C:/Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega128 + + libraryPrefix + GCC + + + gcc/dev/atmega128 + + + + + ATmega_DFP + C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/Atmel.ATmega_DFP.pdsc + 1.6.364 + true + ATmega128 + + + + Resolved + Fixed + true + + + \ No newline at end of file diff --git a/Microcontrollers/LCDMatrix/LCDMatrix.cproj b/Microcontrollers/LCDMatrix/LCDMatrix.cproj new file mode 100644 index 0000000..6b2586c --- /dev/null +++ b/Microcontrollers/LCDMatrix/LCDMatrix.cproj @@ -0,0 +1,130 @@ + + + + 2.0 + 7.0 + com.Atmel.AVRGCC8.C + {b8250aad-aa24-4f1e-8f84-52b104f66735} + ATmega128 + none + Executable + C + $(MSBuildProjectName) + .elf + $(MSBuildProjectDirectory)\$(Configuration) + LCDMatrix + LCDMatrix + LCDMatrix + Native + true + false + true + true + + + true + + 2 + 0 + 0 + + + + + + + + + + + + + + + + + + -mmcu=atmega128 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega128" + True + True + True + True + True + False + True + True + + + NDEBUG + + + + + %24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\ + + + Optimize for size (-Os) + True + True + True + + + libm + + + + + %24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\ + + + + + + + + + -mmcu=atmega128 -B "%24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\gcc\dev\atmega128" + True + True + True + True + True + False + True + True + + + DEBUG + + + + + %24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\ + + + Optimize debugging experience (-Og) + True + True + Default (-g2) + True + + + libm + + + + + %24(PackRepoDir)\atmel\ATmega_DFP\1.6.364\include\ + + + Default (-Wa,-g) + + + + + + compile + + + + \ No newline at end of file diff --git a/Microcontrollers/LCDMatrix/main.c b/Microcontrollers/LCDMatrix/main.c new file mode 100644 index 0000000..b455520 --- /dev/null +++ b/Microcontrollers/LCDMatrix/main.c @@ -0,0 +1,149 @@ +/* --------------------------------------------------------------------------- +** This software is in the public domain, furnished "as is", without technical +** support, and with no warranty, express or implied, as to its usefulness for +** any purpose. +** +** ledmatrix.c +** +** Beschrijving: Simple HT16K33 Ledmatix demo. +** Target: AVR mcu +** Build: avr-gcc -std=c99 -Wall -O3 -mmcu=atmega128 -D F_CPU=8000000UL -c ledmatrix.c +** avr-gcc -g -mmcu=atmega128 -o ledmatrix.elf ledmatrix.o +** avr-objcopy -O ihex ledmatrix.elf ledmatrix.hex +** or type 'make' +** Author: dkroeske@gmail.com +** -------------------------------------------------------------------------*/ + + +#include +#include + +/******************************************************************/ +void twi_init(void) +/* +short: Init AVR TWI interface and set bitrate +inputs: +outputs: +notes: TWI clock is set to 100 kHz +Version : DMK, Initial code +*******************************************************************/ +{ + TWSR = 0; + TWBR = 32; // TWI clock set to 100kHz, prescaler = 0 +} + +/******************************************************************/ +void twi_start(void) +/* +short: Generate TWI start condition +inputs: +outputs: +notes: +Version : DMK, Initial code +*******************************************************************/ +{ + TWCR = (0x80 | 0x20 | 0x04); + while( 0x00 == (TWCR & 0x80) ); +} + +/******************************************************************/ +void twi_stop(void) +/* +short: Generate TWI stop condition +inputs: +outputs: +notes: +Version : DMK, Initial code +*******************************************************************/ +{ + TWCR = (0x80 | 0x10 | 0x04); +} + +/******************************************************************/ +void twi_tx(unsigned char data) +/* +short: transmit 8 bits data +inputs: +outputs: +notes: +Version : DMK, Initial code +*******************************************************************/ +{ + TWDR = data; + TWCR = (0x80 | 0x04); + while( 0 == (TWCR & 0x80) ); +} + +/******************************************************************/ +void wait( int ms ) +/* +short: Busy wait number of millisecs +inputs: int ms (Number of millisecs to busy wait) +outputs: +notes: Busy wait, not very accurate. Make sure (external) + clock value is set. This is used by _delay_ms inside + util/delay.h +Version : DMK, Initial code +*******************************************************************/ +{ + for (int i=0; i>>>>>> fcffefbb7e2c6dd1fafecca07bf84ecaf04b4fd4 + {BBFA8A24-6283-45FE-A253-1F0C6111B1F0}.Debug|AVR.ActiveCfg = Debug|AVR + {BBFA8A24-6283-45FE-A253-1F0C6111B1F0}.Debug|AVR.Build.0 = Debug|AVR + {BBFA8A24-6283-45FE-A253-1F0C6111B1F0}.Release|AVR.ActiveCfg = Release|AVR + {BBFA8A24-6283-45FE-A253-1F0C6111B1F0}.Release|AVR.Build.0 = Release|AVR + {B8250AAD-AA24-4F1E-8F84-52B104F66735}.Debug|AVR.ActiveCfg = Debug|AVR + {B8250AAD-AA24-4F1E-8F84-52B104F66735}.Debug|AVR.Build.0 = Debug|AVR + {B8250AAD-AA24-4F1E-8F84-52B104F66735}.Release|AVR.ActiveCfg = Release|AVR + {B8250AAD-AA24-4F1E-8F84-52B104F66735}.Release|AVR.Build.0 = Release|AVR EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE