diff --git a/V2/Programm/Programm.atsuo b/V2/Programm/Programm.atsuo index f1cf4af..cc74cdf 100644 Binary files a/V2/Programm/Programm.atsuo and b/V2/Programm/Programm.atsuo differ diff --git a/V2/Programm/Programm/Debug/Programm.d b/V2/Programm/Programm/Debug/Programm.d index b637bce..a9bc163 100644 --- a/V2/Programm/Programm/Debug/Programm.d +++ b/V2/Programm/Programm/Debug/Programm.d @@ -12,10 +12,14 @@ Programm.d Programm.o: .././Programm.cpp .././peripheral.h \ c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/version.h \ c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/fuse.h \ c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/lock.h \ - .././io/hardware/porth.hpp .././io/Led.hpp .././io/hardware/pin.hpp \ + .././io/hardware/portc.hpp .././io/hardware/portd.hpp \ + .././io/hardware/portg.hpp .././io/hardware/porth.hpp \ + .././io/hardware/portl.hpp .././io/Led.hpp .././io/hardware/pin.hpp \ + .././io/mcp4151.hpp \ c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/util/delay.h \ c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/util/delay_basic.h \ - c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/math.h + c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/math.h \ + .././io/Display.hpp .././peripheral.h: @@ -45,14 +49,26 @@ c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8- c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/avr/lock.h: +.././io/hardware/portc.hpp: + +.././io/hardware/portd.hpp: + +.././io/hardware/portg.hpp: + .././io/hardware/porth.hpp: +.././io/hardware/portl.hpp: + .././io/Led.hpp: .././io/hardware/pin.hpp: +.././io/mcp4151.hpp: + c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/util/delay.h: c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/util/delay_basic.h: c:\program\ files\ (x86)\atmel\atmel\ toolchain\avr8\ gcc\native\3.4.2.876\avr8-gnu-toolchain\bin\../lib/gcc/avr/4.7.2/../../../../avr/include/math.h: + +.././io/Display.hpp: diff --git a/V2/Programm/Programm/Debug/Programm.elf b/V2/Programm/Programm/Debug/Programm.elf index 0a441de..adada67 100644 Binary files a/V2/Programm/Programm/Debug/Programm.elf and b/V2/Programm/Programm/Debug/Programm.elf differ diff --git a/V2/Programm/Programm/Debug/Programm.hex b/V2/Programm/Programm/Debug/Programm.hex index f65cbf1..5f8df92 100644 --- a/V2/Programm/Programm/Debug/Programm.hex +++ b/V2/Programm/Programm/Debug/Programm.hex @@ -12,20 +12,71 @@ :1000B0000C9499000C9499000C9499000C9499005C :1000C0000C9499000C9499000C9499000C9499004C :1000D0000C9499000C9499000C9499000C9499003C -:1000E0000C9499000C94D600D60011241FBECFEFBB +:1000E0000C9499000C946702670211241FBECFEF95 :1000F000D1E2DEBFCDBF00E00CBF22E0A0E0B2E065 -:1001000001C01D92A030B207E1F710E0CAEED0E0C6 -:1001100000E006C022970109FE010BBF0E94E90022 +:1001000001C01D92A530B207E1F710E0CAEED0E0C1 +:1001100000E006C022970109FE010BBF0E947E028B :10012000C83ED10780E00807A9F70E949B000C9405 -:10013000ED000C940000E2E0F1E0289A2FEF83E25A -:1001400094EF215080409040E1F700C000002898D3 -:100150008081806480832FEF83ED90E32150804085 -:100160009040E1F700C0000080818F7B8083808118 -:10017000806280832FEF83E294EF21508040904093 -:10018000E1F700C000008081806480832FEF83ED61 -:1001900090E3215080409040E1F700C00000808152 -:1001A0008F7B808380818F7D8083C7CFA1E0B1E08A -:1001B0008C9180628C93E2E0F1E080818F7D80837E -:1001C000209A28988C9180648C9380818F7B808387 -:0E01D00008950790F691E02D1994F894FFCF52 +:1001300082020C940000409888E0A098989AA19AB6 +:10014000999A00C000C00000A198999A8150A9F71F +:1001500098E08DEC88231CF4A09A989A02C0A0988D +:10016000989AA19A999A880F00C000C00000A1989F +:10017000999A915079F7409AEBE0F1E0808188609C +:10018000808380818F7B80838081806280831BB8A5 +:100190008081806880838FE99FE00197F1F700C03C +:1001A000000080818F7780830F2EF0E5FF2EF02DE9 +:1001B00005E61EE6D9E6C3E76894EE24E5F874E4A4 +:1001C00065E753E541E633E60F2EFBE6DF2EF02D23 +:1001D000A2E0B1E090819F7B9083908190629083B8 +:1001E000FBB89081906890838FE99FE00197F1F7C9 +:1001F00000C0000090819F77908390819F7B9083C7 +:100200009081906290830BB99081906890838FE980 +:100210009FE00197F1F700C0000090819F779083E5 +:1002200090819F7B90839081906290831BB9908195 +:10023000906890838FE99FE00197F1F700C000007C +:1002400090819F77908390819F7B90839081906233 +:100250009083DBB99081906890838FE99FE001974C +:10026000F1F700C0000090819F77908390819F7B81 +:100270009083908190629083CBB9908190689083B5 +:100280008FE99FE00197F1F700C0000090819F7710 +:10029000908390819F7B9083908190629083EBB854 +:1002A0009081906890838FE99FE00197F1F700C0FB +:1002B000000090819F77908390819F7B90839081B5 +:1002C000906290837BB99081906890838FE99FE0E2 +:1002D0000197F1F700C0000090819F779083908193 +:1002E0009F7B90839081906290836BB9908190689E +:1002F00090838FE99FE00197F1F700C000009081A3 +:100300009F77908390819F7B908390819062908370 +:10031000EBB89081906890838FE99FE00197F1F7A7 +:1003200000C0000090819F77908390819F7B908395 +:100330009081906290835BB99081906890838FE9FF +:100340009FE00197F1F700C0000090819F779083B4 +:1003500090819F7B90839081906290834BB9908134 +:10036000906890838FE99FE00197F1F700C000004B +:1003700090819F77908390819F7B90839081906202 +:1003800090833BB99081906890838FE99FE00197BB +:10039000F1F700C0000090819F77908390819F7B50 +:1003A0009083908190629083DBB890819068908375 +:1003B0008FE99FE00197F1F700C0000090819F77DF +:1003C0009083289A9FEF27EA81E691502040804051 +:1003D000E1F700C0000028989C9190649C939FEFE7 +:1003E00023ED80E3915020408040E1F700C0000001 +:1003F0009C919F7B9C939C9190629C939FEF27EA9A +:1004000081E6915020408040E1F700C000009C91BF +:1004100090649C939FEF23ED80E3915020408040B7 +:10042000E1F700C000009C919F7B9C939C919F7D75 +:100430009C93D0CEA198999A409A389AA098989A6D +:10044000AAE0B1E08C9188608C93EBE0F1E08081D0 +:10045000877F80838C9180688C938C9180648C934F +:100460008C9180628C938FEF8AB92FEF81EE94E0AC +:10047000215080409040E1F700C0000080818F7BD8 +:10048000808380818F7D80838CE08BB980818068C0 +:1004900080838FE99FE00197F1F700C00000808121 +:1004A0008F77808380818F7B808380818F7D808325 +:1004B00081E08BB98081806880838FE99FE001971C +:1004C000F1F700C0000080818F7780830895A1E05C +:1004D000B1E08C9180628C93E2E0F1E080818F7DCD +:1004E0008083209A28988C9180648C9380818F7B64 +:1004F000808380E092E00E941A0208950790F691AE +:08050000E02D1994F894FFCFDF :00000001FF diff --git a/V2/Programm/Programm/Debug/Programm.lss b/V2/Programm/Programm/Debug/Programm.lss index efe17e1..a9076cb 100644 --- a/V2/Programm/Programm/Debug/Programm.lss +++ b/V2/Programm/Programm/Debug/Programm.lss @@ -3,31 +3,33 @@ Programm.elf: file format elf32-avr Sections: Idx Name Size VMA LMA File off Algn - 0 .data 00000000 00800200 000001de 00000252 2**0 + 0 .data 00000000 00800200 00000508 0000059c 2**0 CONTENTS, ALLOC, LOAD, DATA - 1 .text 000001de 00000000 00000000 00000074 2**1 + 1 .text 00000508 00000000 00000000 00000094 2**1 CONTENTS, ALLOC, LOAD, READONLY, CODE - 2 .stab 000006e4 00000000 00000000 00000254 2**2 + 2 .bss 00000005 00800200 00800200 0000059c 2**0 + ALLOC + 3 .stab 000006e4 00000000 00000000 0000059c 2**2 CONTENTS, READONLY, DEBUGGING - 3 .stabstr 00000082 00000000 00000000 00000938 2**0 + 4 .stabstr 00000082 00000000 00000000 00000c80 2**0 CONTENTS, READONLY, DEBUGGING - 4 .comment 0000002f 00000000 00000000 000009ba 2**0 + 5 .comment 0000002f 00000000 00000000 00000d02 2**0 CONTENTS, READONLY - 5 .debug_aranges 00000028 00000000 00000000 000009e9 2**0 + 6 .debug_aranges 00000030 00000000 00000000 00000d31 2**0 CONTENTS, READONLY, DEBUGGING - 6 .debug_info 00000ee2 00000000 00000000 00000a11 2**0 + 7 .debug_info 00004170 00000000 00000000 00000d61 2**0 CONTENTS, READONLY, DEBUGGING - 7 .debug_abbrev 000002e1 00000000 00000000 000018f3 2**0 + 8 .debug_abbrev 000003c6 00000000 00000000 00004ed1 2**0 CONTENTS, READONLY, DEBUGGING - 8 .debug_line 000002cd 00000000 00000000 00001bd4 2**0 + 9 .debug_line 00000977 00000000 00000000 00005297 2**0 CONTENTS, READONLY, DEBUGGING - 9 .debug_frame 00000034 00000000 00000000 00001ea4 2**2 + 10 .debug_frame 00000044 00000000 00000000 00005c10 2**2 CONTENTS, READONLY, DEBUGGING - 10 .debug_str 00000693 00000000 00000000 00001ed8 2**0 + 11 .debug_str 00001866 00000000 00000000 00005c54 2**0 CONTENTS, READONLY, DEBUGGING - 11 .debug_loc 000000f0 00000000 00000000 0000256b 2**0 + 12 .debug_loc 0000090d 00000000 00000000 000074ba 2**0 CONTENTS, READONLY, DEBUGGING - 12 .debug_ranges 00000060 00000000 00000000 0000265b 2**0 + 13 .debug_ranges 000002a8 00000000 00000000 00007dc7 2**0 CONTENTS, READONLY, DEBUGGING Disassembly of section .text: @@ -92,10 +94,10 @@ Disassembly of section .text: e0: 0c 94 99 00 jmp 0x132 ; 0x132 <__bad_interrupt> 000000e4 <__trampolines_start>: - e4: 0c 94 d6 00 jmp 0x1ac ; 0x1ac <_GLOBAL__sub_I_rot> + e4: 0c 94 67 02 jmp 0x4ce ; 0x4ce <_GLOBAL__sub_I_rot> 000000e8 <__ctors_start>: - e8: d6 00 .word 0x00d6 ; ???? + e8: 67 02 muls r22, r23 000000ea <__ctors_end>: ea: 11 24 eor r1, r1 @@ -117,7 +119,7 @@ Disassembly of section .text: 102: 1d 92 st X+, r1 00000104 <.do_clear_bss_start>: - 104: a0 30 cpi r26, 0x00 ; 0 + 104: a5 30 cpi r26, 0x05 ; 5 106: b2 07 cpc r27, r18 108: e1 f7 brne .-8 ; 0x102 <.do_clear_bss_loop> @@ -131,240 +133,1464 @@ Disassembly of section .text: 116: 01 09 sbc r16, r1 118: fe 01 movw r30, r28 11a: 0b bf out 0x3b, r16 ; 59 - 11c: 0e 94 e9 00 call 0x1d2 ; 0x1d2 <__tablejump_elpm__> + 11c: 0e 94 7e 02 call 0x4fc ; 0x4fc <__tablejump_elpm__> 120: c8 3e cpi r28, 0xE8 ; 232 122: d1 07 cpc r29, r17 124: 80 e0 ldi r24, 0x00 ; 0 126: 08 07 cpc r16, r24 128: a9 f7 brne .-22 ; 0x114 <__do_global_ctors+0xa> 12a: 0e 94 9b 00 call 0x136 ; 0x136
- 12e: 0c 94 ed 00 jmp 0x1da ; 0x1da <_exit> + 12e: 0c 94 82 02 jmp 0x504 ; 0x504 <_exit> 00000132 <__bad_interrupt>: 132: 0c 94 00 00 jmp 0 ; 0x0 <__vectors> 00000136
: - namespace avrlib { - struct porth + struct portc { - static uint8_t port() { return PORTH; } - 136: e2 e0 ldi r30, 0x02 ; 2 - 138: f1 e0 ldi r31, 0x01 ; 1 + static uint8_t port() { return PORTC; } + static void port(uint8_t v) { PORTC = v; } + 136: 40 98 cbi 0x08, 0 ; 8 + 138: 88 e0 ldi r24, 0x08 ; 8 namespace avrlib { - struct portb + struct portg { - static uint8_t port() { return PORTB; } - static void port(uint8_t v) { PORTB = v; } - 13a: 28 9a sbi 0x05, 0 ; 5 + static uint8_t port() { return PORTG; } + static void port(uint8_t v) { PORTG = v; } + 13a: a0 98 cbi 0x14, 0 ; 20 + + static uint8_t pin() { return PING; } + static void pin(uint8_t v) { PING = v; } + + static uint8_t dir() { return DDRG; } + static void dir(uint8_t v) { DDRG = v; } + 13c: 98 9a sbi 0x13, 0 ; 19 +namespace avrlib { + + struct portg + { + static uint8_t port() { return PORTG; } + static void port(uint8_t v) { PORTG = v; } + 13e: a1 9a sbi 0x14, 1 ; 20 + + static uint8_t pin() { return PING; } + static void pin(uint8_t v) { PING = v; } + + static uint8_t dir() { return DDRG; } + static void dir(uint8_t v) { DDRG = v; } + 140: 99 9a sbi 0x13, 1 ; 19 #else //round up by default __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); #endif __builtin_avr_delay_cycles(__ticks_dc); - 13c: 2f ef ldi r18, 0xFF ; 255 - 13e: 83 e2 ldi r24, 0x23 ; 35 - 140: 94 ef ldi r25, 0xF4 ; 244 - 142: 21 50 subi r18, 0x01 ; 1 - 144: 80 40 sbci r24, 0x00 ; 0 - 146: 90 40 sbci r25, 0x00 ; 0 - 148: e1 f7 brne .-8 ; 0x142 - 14a: 00 c0 rjmp .+0 ; 0x14c - 14c: 00 00 nop - 14e: 28 98 cbi 0x05, 0 ; 5 - 150: 80 81 ld r24, Z + 142: 00 c0 rjmp .+0 ; 0x144 + 144: 00 c0 rjmp .+0 ; 0x146 + 146: 00 00 nop +namespace avrlib { + + struct portg + { + static uint8_t port() { return PORTG; } + static void port(uint8_t v) { PORTG = v; } + 148: a1 98 cbi 0x14, 1 ; 20 + + static uint8_t pin() { return PING; } + static void pin(uint8_t v) { PING = v; } + + static uint8_t dir() { return DDRG; } + static void dir(uint8_t v) { DDRG = v; } + 14a: 99 9a sbi 0x13, 1 ; 19 + 14c: 81 50 subi r24, 0x01 ; 1 + sck::make_low(); //output und low; + cs::make_high(); //output und low; + sdi::make_low(); //output und low; + } + void send_soft(uint8_t data) { + for (uint8_t i=0; i<8; i++) + 14e: a9 f7 brne .-22 ; 0x13a + 150: 98 e0 ldi r25, 0x08 ; 8 + 152: 8d ec ldi r24, 0xCD ; 205 + { + if (data & 0x80) { + 154: 88 23 and r24, r24 + 156: 1c f4 brge .+6 ; 0x15e +namespace avrlib { + + struct portg + { + static uint8_t port() { return PORTG; } + static void port(uint8_t v) { PORTG = v; } + 158: a0 9a sbi 0x14, 0 ; 20 + + static uint8_t pin() { return PING; } + static void pin(uint8_t v) { PING = v; } + + static uint8_t dir() { return DDRG; } + static void dir(uint8_t v) { DDRG = v; } + 15a: 98 9a sbi 0x13, 0 ; 19 + 15c: 02 c0 rjmp .+4 ; 0x162 +namespace avrlib { + + struct portg + { + static uint8_t port() { return PORTG; } + static void port(uint8_t v) { PORTG = v; } + 15e: a0 98 cbi 0x14, 0 ; 20 + + static uint8_t pin() { return PING; } + static void pin(uint8_t v) { PING = v; } + + static uint8_t dir() { return DDRG; } + static void dir(uint8_t v) { DDRG = v; } + 160: 98 9a sbi 0x13, 0 ; 19 +namespace avrlib { + + struct portg + { + static uint8_t port() { return PORTG; } + static void port(uint8_t v) { PORTG = v; } + 162: a1 9a sbi 0x14, 1 ; 20 + + static uint8_t pin() { return PING; } + static void pin(uint8_t v) { PING = v; } + + static uint8_t dir() { return DDRG; } + static void dir(uint8_t v) { DDRG = v; } + 164: 99 9a sbi 0x13, 1 ; 19 + } + else { + sdi::make_low(); + } + sck::make_high(); + data<<=1; + 166: 88 0f add r24, r24 + 168: 00 c0 rjmp .+0 ; 0x16a + 16a: 00 c0 rjmp .+0 ; 0x16c + 16c: 00 00 nop +namespace avrlib { + + struct portg + { + static uint8_t port() { return PORTG; } + static void port(uint8_t v) { PORTG = v; } + 16e: a1 98 cbi 0x14, 1 ; 20 + + static uint8_t pin() { return PING; } + static void pin(uint8_t v) { PING = v; } + + static uint8_t dir() { return DDRG; } + static void dir(uint8_t v) { DDRG = v; } + 170: 99 9a sbi 0x13, 1 ; 19 + 172: 91 50 subi r25, 0x01 ; 1 + sck::make_low(); //output und low; + cs::make_high(); //output und low; + sdi::make_low(); //output und low; + } + void send_soft(uint8_t data) { + for (uint8_t i=0; i<8; i++) + 174: 79 f7 brne .-34 ; 0x154 + 176: 40 9a sbi 0x08, 0 ; 8 + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 178: eb e0 ldi r30, 0x0B ; 11 + 17a: f1 e0 ldi r31, 0x01 ; 1 + 17c: 80 81 ld r24, Z struct pin { static void set(bool value = true) { if (value) Port::port(Port::port() | (1< - 164: 00 c0 rjmp .+0 ; 0x166 - 166: 00 00 nop + 17e: 88 60 ori r24, 0x08 ; 8 + static void port(uint8_t v) { PORTL = v; } + 180: 80 83 st Z, r24 namespace avrlib { - struct porth + struct portl { - static uint8_t port() { return PORTH; } - 168: 80 81 ld r24, Z + static uint8_t port() { return PORTL; } + 182: 80 81 ld r24, Z else Port::port(Port::port() & ~(1< - 182: 00 c0 rjmp .+0 ; 0x184 - 184: 00 00 nop + 18a: 80 62 ori r24, 0x20 ; 32 + static void port(uint8_t v) { PORTL = v; } + 18c: 80 83 st Z, r24 +namespace avrlib { + + struct portd + { + static uint8_t port() { return PORTD; } + static void port(uint8_t v) { PORTD = v; } + 18e: 1b b8 out 0x0b, r1 ; 11 namespace avrlib { - struct porth + struct portl { - static uint8_t port() { return PORTH; } - 186: 80 81 ld r24, Z - 188: 80 64 ori r24, 0x40 ; 64 - static void port(uint8_t v) { PORTH = v; } - 18a: 80 83 st Z, r24 - 18c: 2f ef ldi r18, 0xFF ; 255 - 18e: 83 ed ldi r24, 0xD3 ; 211 - 190: 90 e3 ldi r25, 0x30 ; 48 - 192: 21 50 subi r18, 0x01 ; 1 - 194: 80 40 sbci r24, 0x00 ; 0 - 196: 90 40 sbci r25, 0x00 ; 0 - 198: e1 f7 brne .-8 ; 0x192 - 19a: 00 c0 rjmp .+0 ; 0x19c - 19c: 00 00 nop + static uint8_t port() { return PORTL; } + 190: 80 81 ld r24, Z + 192: 80 68 ori r24, 0x80 ; 128 + static void port(uint8_t v) { PORTL = v; } + 194: 80 83 st Z, r24 + #else + //round up by default + __ticks_dc = (uint32_t)(ceil(fabs(__tmp))); + #endif + + __builtin_avr_delay_cycles(__ticks_dc); + 196: 8f e9 ldi r24, 0x9F ; 159 + 198: 9f e0 ldi r25, 0x0F ; 15 + 19a: 01 97 sbiw r24, 0x01 ; 1 + 19c: f1 f7 brne .-4 ; 0x19a + 19e: 00 c0 rjmp .+0 ; 0x1a0 + 1a0: 00 00 nop namespace avrlib { - struct porth + struct portl { - static uint8_t port() { return PORTH; } - 19e: 80 81 ld r24, Z + static uint8_t port() { return PORTL; } + 1a2: 80 81 ld r24, Z else Port::port(Port::port() & ~(1< - -000001ac <_GLOBAL__sub_I_rot>: - - static uint8_t pin() { return PINH; } - static void pin(uint8_t v) { PINH = v; } - - static uint8_t dir() { return DDRH; } - 1ac: a1 e0 ldi r26, 0x01 ; 1 - 1ae: b1 e0 ldi r27, 0x01 ; 1 - 1b0: 8c 91 ld r24, X - static bool value() { return (Port::pin() & (1< + 1f0: 00 c0 rjmp .+0 ; 0x1f2 + 1f2: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 1f4: 90 81 ld r25, Z else Port::port(Port::port() & ~(1< + 216: 00 c0 rjmp .+0 ; 0x218 + 218: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 21a: 90 81 ld r25, Z + else + Port::port(Port::port() & ~(1< + 23c: 00 c0 rjmp .+0 ; 0x23e + 23e: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 240: 90 81 ld r25, Z + else + Port::port(Port::port() & ~(1< + 262: 00 c0 rjmp .+0 ; 0x264 + 264: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 266: 90 81 ld r25, Z + else + Port::port(Port::port() & ~(1< + 288: 00 c0 rjmp .+0 ; 0x28a + 28a: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 28c: 90 81 ld r25, Z + else + Port::port(Port::port() & ~(1< + 2ae: 00 c0 rjmp .+0 ; 0x2b0 + 2b0: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 2b2: 90 81 ld r25, Z + else + Port::port(Port::port() & ~(1< + 2d4: 00 c0 rjmp .+0 ; 0x2d6 + 2d6: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 2d8: 90 81 ld r25, Z + else + Port::port(Port::port() & ~(1< + 2fa: 00 c0 rjmp .+0 ; 0x2fc + 2fc: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 2fe: 90 81 ld r25, Z + else + Port::port(Port::port() & ~(1< + 320: 00 c0 rjmp .+0 ; 0x322 + 322: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 324: 90 81 ld r25, Z + else + Port::port(Port::port() & ~(1< + 346: 00 c0 rjmp .+0 ; 0x348 + 348: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 34a: 90 81 ld r25, Z + else + Port::port(Port::port() & ~(1< + 36c: 00 c0 rjmp .+0 ; 0x36e + 36e: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 370: 90 81 ld r25, Z + else + Port::port(Port::port() & ~(1< + 392: 00 c0 rjmp .+0 ; 0x394 + 394: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 396: 90 81 ld r25, Z + else + Port::port(Port::port() & ~(1< + 3b8: 00 c0 rjmp .+0 ; 0x3ba + 3ba: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 3bc: 90 81 ld r25, Z + else + Port::port(Port::port() & ~(1< + 3d2: 00 c0 rjmp .+0 ; 0x3d4 + 3d4: 00 00 nop + 3d6: 28 98 cbi 0x05, 0 ; 5 + 3d8: 9c 91 ld r25, X + struct pin + { + static void set(bool value = true) { if (value) - Port::dir(Port::dir() | (1< + 3ec: 00 c0 rjmp .+0 ; 0x3ee + 3ee: 00 00 nop namespace avrlib { struct porth { static uint8_t port() { return PORTH; } - 1ca: 80 81 ld r24, Z + 3f0: 9c 91 ld r25, X + else + Port::port(Port::port() & ~(1< + 40a: 00 c0 rjmp .+0 ; 0x40c + 40c: 00 00 nop + +namespace avrlib { + + struct porth + { + static uint8_t port() { return PORTH; } + 40e: 9c 91 ld r25, X + 410: 90 64 ori r25, 0x40 ; 64 + static void port(uint8_t v) { PORTH = v; } + 412: 9c 93 st X, r25 + 414: 9f ef ldi r25, 0xFF ; 255 + 416: 23 ed ldi r18, 0xD3 ; 211 + 418: 80 e3 ldi r24, 0x30 ; 48 + 41a: 91 50 subi r25, 0x01 ; 1 + 41c: 20 40 sbci r18, 0x00 ; 0 + 41e: 80 40 sbci r24, 0x00 ; 0 + 420: e1 f7 brne .-8 ; 0x41a + 422: 00 c0 rjmp .+0 ; 0x424 + 424: 00 00 nop + +namespace avrlib { + + struct porth + { + static uint8_t port() { return PORTH; } + 426: 9c 91 ld r25, X + else + Port::port(Port::port() & ~(1< + +00000434 <_ZN7DisplayI7Mcp4151IN6avrlib5portcELi0ENS1_5portgELi0ES3_Li1EE3LedINS1_5portlELi3EENS1_5portdES6_Li7ELi6ELi5EEC1Ev>: +namespace avrlib { + + struct portg + { + static uint8_t port() { return PORTG; } + static void port(uint8_t v) { PORTG = v; } + 434: a1 98 cbi 0x14, 1 ; 20 + + static uint8_t pin() { return PING; } + static void pin(uint8_t v) { PING = v; } + + static uint8_t dir() { return DDRG; } + static void dir(uint8_t v) { DDRG = v; } + 436: 99 9a sbi 0x13, 1 ; 19 + 438: 40 9a sbi 0x08, 0 ; 8 + + static uint8_t pin() { return PINC; } + static void pin(uint8_t v) { PINC = v; } + + static uint8_t dir() { return DDRC; } + static void dir(uint8_t v) { DDRC = v; } + 43a: 38 9a sbi 0x07, 0 ; 7 +namespace avrlib { + + struct portg + { + static uint8_t port() { return PORTG; } + static void port(uint8_t v) { PORTG = v; } + 43c: a0 98 cbi 0x14, 0 ; 20 + + static uint8_t pin() { return PING; } + static void pin(uint8_t v) { PING = v; } + + static uint8_t dir() { return DDRG; } + static void dir(uint8_t v) { DDRG = v; } + 43e: 98 9a sbi 0x13, 0 ; 19 + + static uint8_t pin() { return PINL; } + static void pin(uint8_t v) { PINL = v; } + + static uint8_t dir() { return DDRL; } + 440: aa e0 ldi r26, 0x0A ; 10 + 442: b1 e0 ldi r27, 0x01 ; 1 + 444: 8c 91 ld r24, X + static bool value() { return (Port::pin() & (1< + 478: 00 c0 rjmp .+0 ; 0x47a <_ZN7DisplayI7Mcp4151IN6avrlib5portcELi0ENS1_5portgELi0ES3_Li1EE3LedINS1_5portlELi3EENS1_5portdES6_Li7ELi6ELi5EEC1Ev+0x46> + 47a: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 47c: 80 81 ld r24, Z + static void set(bool value = true) + { + if (value) + Port::port(Port::port() | (1< + 49a: 00 c0 rjmp .+0 ; 0x49c <_ZN7DisplayI7Mcp4151IN6avrlib5portcELi0ENS1_5portgELi0ES3_Li1EE3LedINS1_5portlELi3EENS1_5portdES6_Li7ELi6ELi5EEC1Ev+0x68> + 49c: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 49e: 80 81 ld r24, Z + else + Port::port(Port::port() & ~(1< + 4c2: 00 c0 rjmp .+0 ; 0x4c4 <_ZN7DisplayI7Mcp4151IN6avrlib5portcELi0ENS1_5portgELi0ES3_Li1EE3LedINS1_5portlELi3EENS1_5portdES6_Li7ELi6ELi5EEC1Ev+0x90> + 4c4: 00 00 nop + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + 4c6: 80 81 ld r24, Z + else + Port::port(Port::port() & ~(1<: + + static uint8_t pin() { return PINH; } + static void pin(uint8_t v) { PINH = v; } + + static uint8_t dir() { return DDRH; } + 4ce: a1 e0 ldi r26, 0x01 ; 1 + 4d0: b1 e0 ldi r27, 0x01 ; 1 + 4d2: 8c 91 ld r24, X + static bool value() { return (Port::pin() & (1<: - 1d2: 07 90 elpm r0, Z+ - 1d4: f6 91 elpm r31, Z - 1d6: e0 2d mov r30, r0 - 1d8: 19 94 eijmp + static uint8_t pin() { return PINB; } + static void pin(uint8_t v) { PINB = v; } -000001da <_exit>: - 1da: f8 94 cli + static uint8_t dir() { return DDRB; } + static void dir(uint8_t v) { DDRB = v; } + 4e2: 20 9a sbi 0x04, 0 ; 4 +namespace avrlib { -000001dc <__stop_program>: - 1dc: ff cf rjmp .-2 ; 0x1dc <__stop_program> + struct portb + { + static uint8_t port() { return PORTB; } + static void port(uint8_t v) { PORTB = v; } + 4e4: 28 98 cbi 0x05, 0 ; 5 + + static uint8_t pin() { return PINH; } + static void pin(uint8_t v) { PINH = v; } + + static uint8_t dir() { return DDRH; } + 4e6: 8c 91 ld r24, X + static bool value() { return (Port::pin() & (1< + +ledrotclass rot; +ledgruenclass gruen; +ledgelbclass gelb; +displayclass d; + 4f2: 80 e0 ldi r24, 0x00 ; 0 + 4f4: 92 e0 ldi r25, 0x02 ; 2 + 4f6: 0e 94 1a 02 call 0x434 ; 0x434 <_ZN7DisplayI7Mcp4151IN6avrlib5portcELi0ENS1_5portgELi0ES3_Li1EE3LedINS1_5portlELi3EENS1_5portdES6_Li7ELi6ELi5EEC1Ev> + 4fa: 08 95 ret + +000004fc <__tablejump_elpm__>: + 4fc: 07 90 elpm r0, Z+ + 4fe: f6 91 elpm r31, Z + 500: e0 2d mov r30, r0 + 502: 19 94 eijmp + +00000504 <_exit>: + 504: f8 94 cli + +00000506 <__stop_program>: + 506: ff cf rjmp .-2 ; 0x506 <__stop_program> diff --git a/V2/Programm/Programm/Debug/Programm.map b/V2/Programm/Programm/Debug/Programm.map index c912c3d..549223e 100644 --- a/V2/Programm/Programm/Debug/Programm.map +++ b/V2/Programm/Programm/Debug/Programm.map @@ -12,8 +12,8 @@ c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu- Discarded input sections .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avr6/crtm2560.o + .group 0x00000000 0x8 Programm.o .text 0x00000000 0x0 Programm.o - .bss 0x00000000 0x3 Programm.o .text 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_exit.o) .bss 0x00000000 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_exit.o) .text.libgcc.mul @@ -182,7 +182,7 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 .rela.plt *(.rela.plt) -.text 0x00000000 0x1de +.text 0x00000000 0x508 *(.vectors) .vectors 0x00000000 0xe4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avr6/crtm2560.o 0x00000000 __vector_default @@ -298,17 +298,21 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 0x00000132 __vector_42 0x00000136 . = ALIGN (0x2) *(.text.*) - .text.main 0x00000136 0x76 Programm.o + .text.main 0x00000136 0x2fe Programm.o 0x00000136 main + .text._ZN7DisplayI7Mcp4151IN6avrlib5portcELi0ENS1_5portgELi0ES3_Li1EE3LedINS1_5portlELi3EENS1_5portdES6_Li7ELi6ELi5EEC2Ev + 0x00000434 0x9a Programm.o + 0x00000434 _ZN7DisplayI7Mcp4151IN6avrlib5portcELi0ENS1_5portgELi0ES3_Li1EE3LedINS1_5portlELi3EENS1_5portdES6_Li7ELi6ELi5EEC2Ev + 0x00000434 _ZN7DisplayI7Mcp4151IN6avrlib5portcELi0ENS1_5portgELi0ES3_Li1EE3LedINS1_5portlELi3EENS1_5portdES6_Li7ELi6ELi5EEC1Ev .text._GLOBAL__sub_I_rot - 0x000001ac 0x26 Programm.o - .text.libgcc 0x000001d2 0x8 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_tablejump_elpm.o) - 0x000001d2 __tablejump_elpm__ - 0x000001da . = ALIGN (0x2) + 0x000004ce 0x2e Programm.o + .text.libgcc 0x000004fc 0x8 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_tablejump_elpm.o) + 0x000004fc __tablejump_elpm__ + 0x00000504 . = ALIGN (0x2) *(.fini9) - .fini9 0x000001da 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_exit.o) - 0x000001da _exit - 0x000001da exit + .fini9 0x00000504 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_exit.o) + 0x00000504 _exit + 0x00000504 exit *(.fini9) *(.fini8) *(.fini8) @@ -327,11 +331,11 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 *(.fini1) *(.fini1) *(.fini0) - .fini0 0x000001da 0x4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_exit.o) + .fini0 0x00000504 0x4 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/avr6\libgcc.a(_exit.o) *(.fini0) - 0x000001de _etext = . + 0x00000508 _etext = . -.data 0x00800200 0x0 load address 0x000001de +.data 0x00800200 0x0 load address 0x00000508 0x00800200 PROVIDE (__data_start, .) *(.data) .data 0x00800200 0x0 c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8-gnu-toolchain/bin/../lib/gcc/avr/4.7.2/../../../../avr/lib/avr6/crtm2560.o @@ -348,21 +352,26 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 0x00800200 _edata = . 0x00800200 PROVIDE (__data_end, .) -.bss 0x00800200 0x0 +.bss 0x00800200 0x5 0x00800200 PROVIDE (__bss_start, .) *(.bss) + .bss 0x00800200 0x5 Programm.o + 0x00800200 d + 0x00800202 gelb + 0x00800203 gruen + 0x00800204 rot *(.bss*) *(COMMON) - 0x00800200 PROVIDE (__bss_end, .) - 0x000001de __data_load_start = LOADADDR (.data) - 0x000001de __data_load_end = (__data_load_start + SIZEOF (.data)) + 0x00800205 PROVIDE (__bss_end, .) + 0x00000508 __data_load_start = LOADADDR (.data) + 0x00000508 __data_load_end = (__data_load_start + SIZEOF (.data)) -.noinit 0x00800200 0x0 - 0x00800200 PROVIDE (__noinit_start, .) +.noinit 0x00800205 0x0 + 0x00800205 PROVIDE (__noinit_start, .) *(.noinit*) - 0x00800200 PROVIDE (__noinit_end, .) - 0x00800200 _end = . - 0x00800200 PROVIDE (__heap_start, .) + 0x00800205 PROVIDE (__noinit_end, .) + 0x00800205 _end = . + 0x00800205 PROVIDE (__heap_start, .) .eeprom 0x00810000 0x0 *(.eeprom*) @@ -420,39 +429,39 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 .debug_sfnames *(.debug_sfnames) -.debug_aranges 0x00000000 0x28 +.debug_aranges 0x00000000 0x30 *(.debug_aranges) .debug_aranges - 0x00000000 0x28 Programm.o + 0x00000000 0x30 Programm.o .debug_pubnames *(.debug_pubnames) -.debug_info 0x00000000 0xee2 +.debug_info 0x00000000 0x4170 *(.debug_info) - .debug_info 0x00000000 0xee2 Programm.o + .debug_info 0x00000000 0x4170 Programm.o *(.gnu.linkonce.wi.*) -.debug_abbrev 0x00000000 0x2e1 +.debug_abbrev 0x00000000 0x3c6 *(.debug_abbrev) - .debug_abbrev 0x00000000 0x2e1 Programm.o + .debug_abbrev 0x00000000 0x3c6 Programm.o -.debug_line 0x00000000 0x2cd +.debug_line 0x00000000 0x977 *(.debug_line) - .debug_line 0x00000000 0x2cd Programm.o + .debug_line 0x00000000 0x977 Programm.o -.debug_frame 0x00000000 0x34 +.debug_frame 0x00000000 0x44 *(.debug_frame) - .debug_frame 0x00000000 0x34 Programm.o + .debug_frame 0x00000000 0x44 Programm.o -.debug_str 0x00000000 0x693 +.debug_str 0x00000000 0x1866 *(.debug_str) - .debug_str 0x00000000 0x693 Programm.o - 0x6ce (size before relaxing) + .debug_str 0x00000000 0x1866 Programm.o + 0x18a6 (size before relaxing) -.debug_loc 0x00000000 0xf0 +.debug_loc 0x00000000 0x90d *(.debug_loc) - .debug_loc 0x00000000 0xf0 Programm.o + .debug_loc 0x00000000 0x90d Programm.o .debug_macinfo *(.debug_macinfo) @@ -460,9 +469,9 @@ LOAD c:/program files (x86)/atmel/atmel toolchain/avr8 gcc/native/3.4.2.876/avr8 .debug_pubtypes *(.debug_pubtypes) -.debug_ranges 0x00000000 0x60 +.debug_ranges 0x00000000 0x2a8 *(.debug_ranges) - .debug_ranges 0x00000000 0x60 Programm.o + .debug_ranges 0x00000000 0x2a8 Programm.o .debug_macro *(.debug_macro) diff --git a/V2/Programm/Programm/Debug/Programm.srec b/V2/Programm/Programm/Debug/Programm.srec index 267f6ed..5acbd7a 100644 --- a/V2/Programm/Programm/Debug/Programm.srec +++ b/V2/Programm/Programm/Debug/Programm.srec @@ -13,20 +13,71 @@ S11300A00C9499000C9499000C9499000C94990068 S11300B00C9499000C9499000C9499000C94990058 S11300C00C9499000C9499000C9499000C94990048 S11300D00C9499000C9499000C9499000C94990038 -S11300E00C9499000C94D600D60011241FBECFEFB7 +S11300E00C9499000C946702670211241FBECFEF91 S11300F0D1E2DEBFCDBF00E00CBF22E0A0E0B2E061 -S113010001C01D92A030B207E1F710E0CAEED0E0C2 -S113011000E006C022970109FE010BBF0E94E9001E +S113010001C01D92A530B207E1F710E0CAEED0E0BD +S113011000E006C022970109FE010BBF0E947E0287 S1130120C83ED10780E00807A9F70E949B000C9401 -S1130130ED000C940000E2E0F1E0289A2FEF83E256 -S113014094EF215080409040E1F700C000002898CF -S11301508081806480832FEF83ED90E32150804081 -S11301609040E1F700C0000080818F7B8083808114 -S1130170806280832FEF83E294EF2150804090408F -S1130180E1F700C000008081806480832FEF83ED5D -S113019090E3215080409040E1F700C0000080814E -S11301A08F7B808380818F7D8083C7CFA1E0B1E086 -S11301B08C9180628C93E2E0F1E080818F7D80837A -S11301C0209A28988C9180648C9380818F7B808383 -S11101D008950790F691E02D1994F894FFCF4E +S113013082020C940000409888E0A098989AA19AB2 +S1130140999A00C000C00000A198999A8150A9F71B +S113015098E08DEC88231CF4A09A989A02C0A09889 +S1130160989AA19A999A880F00C000C00000A1989B +S1130170999A915079F7409AEBE0F1E08081886098 +S1130180808380818F7B80838081806280831BB8A1 +S11301908081806880838FE99FE00197F1F700C038 +S11301A0000080818F7780830F2EF0E5FF2EF02DE5 +S11301B005E61EE6D9E6C3E76894EE24E5F874E4A0 +S11301C065E753E541E633E60F2EFBE6DF2EF02D1F +S11301D0A2E0B1E090819F7B9083908190629083B4 +S11301E0FBB89081906890838FE99FE00197F1F7C5 +S11301F000C0000090819F77908390819F7B9083C3 +S11302009081906290830BB99081906890838FE97C +S11302109FE00197F1F700C0000090819F779083E1 +S113022090819F7B90839081906290831BB9908191 +S1130230906890838FE99FE00197F1F700C0000078 +S113024090819F77908390819F7B9083908190622F +S11302509083DBB99081906890838FE99FE0019748 +S1130260F1F700C0000090819F77908390819F7B7D +S11302709083908190629083CBB9908190689083B1 +S11302808FE99FE00197F1F700C0000090819F770C +S1130290908390819F7B9083908190629083EBB850 +S11302A09081906890838FE99FE00197F1F700C0F7 +S11302B0000090819F77908390819F7B90839081B1 +S11302C0906290837BB99081906890838FE99FE0DE +S11302D00197F1F700C0000090819F77908390818F +S11302E09F7B90839081906290836BB9908190689A +S11302F090838FE99FE00197F1F700C0000090819F +S11303009F77908390819F7B90839081906290836C +S1130310EBB89081906890838FE99FE00197F1F7A3 +S113032000C0000090819F77908390819F7B908391 +S11303309081906290835BB99081906890838FE9FB +S11303409FE00197F1F700C0000090819F779083B0 +S113035090819F7B90839081906290834BB9908130 +S1130360906890838FE99FE00197F1F700C0000047 +S113037090819F77908390819F7B908390819062FE +S113038090833BB99081906890838FE99FE00197B7 +S1130390F1F700C0000090819F77908390819F7B4C +S11303A09083908190629083DBB890819068908371 +S11303B08FE99FE00197F1F700C0000090819F77DB +S11303C09083289A9FEF27EA81E69150204080404D +S11303D0E1F700C0000028989C9190649C939FEFE3 +S11303E023ED80E3915020408040E1F700C00000FD +S11303F09C919F7B9C939C9190629C939FEF27EA96 +S113040081E6915020408040E1F700C000009C91BB +S113041090649C939FEF23ED80E3915020408040B3 +S1130420E1F700C000009C919F7B9C939C919F7D71 +S11304309C93D0CEA198999A409A389AA098989A69 +S1130440AAE0B1E08C9188608C93EBE0F1E08081CC +S1130450877F80838C9180688C938C9180648C934B +S11304608C9180628C938FEF8AB92FEF81EE94E0A8 +S1130470215080409040E1F700C0000080818F7BD4 +S1130480808380818F7D80838CE08BB980818068BC +S113049080838FE99FE00197F1F700C0000080811D +S11304A08F77808380818F7B808380818F7D808321 +S11304B081E08BB98081806880838FE99FE0019718 +S11304C0F1F700C0000080818F7780830895A1E058 +S11304D0B1E08C9180628C93E2E0F1E080818F7DC9 +S11304E08083209A28988C9180648C9380818F7B60 +S11304F0808380E092E00E941A0208950790F691AA +S10B0500E02D1994F894FFCFDB S9030000FC diff --git a/V2/Programm/Programm/Programm.cpp b/V2/Programm/Programm/Programm.cpp index 270ac5e..391facf 100644 --- a/V2/Programm/Programm/Programm.cpp +++ b/V2/Programm/Programm/Programm.cpp @@ -12,28 +12,43 @@ ledrotclass rot; ledgruenclass gruen; ledgelbclass gelb; +displayclass d; int main(void) { + d.setContrast(20); + d.setBacklight(true); + d.write_char(0); while(1) { - gruen.on(); - _delay_ms(5000); - gruen.off(); + d.write_char('P'); + d.write_char('e'); + d.write_char('n'); + d.write_char('i'); + d.write_char('s'); + d.write_char(' '); + d.write_char('D'); + d.write_char('u'); + d.write_char(' '); + d.write_char('S'); + d.write_char('a'); + d.write_char('c'); + d.write_char('k'); + gruen.on(); + _delay_ms(2000); + gruen.off(); + gelb.on(); _delay_ms(1000); gelb.off(); rot.on(); - _delay_ms(5000); + _delay_ms(2000); gelb.on(); _delay_ms(1000); gelb.off(); rot.off(); - - - } } \ No newline at end of file diff --git a/V2/Programm/Programm/Programm.cppproj b/V2/Programm/Programm/Programm.cppproj index eca4b45..16c031e 100644 --- a/V2/Programm/Programm/Programm.cppproj +++ b/V2/Programm/Programm/Programm.cppproj @@ -144,6 +144,9 @@ + + compile + compile @@ -156,12 +159,21 @@ compile + + compile + compile + + compile + compile + + compile + compile diff --git a/V2/Programm/Programm/io/Display.hpp b/V2/Programm/Programm/io/Display.hpp new file mode 100644 index 0000000..c71f9a8 --- /dev/null +++ b/V2/Programm/Programm/io/Display.hpp @@ -0,0 +1,81 @@ +/* + * Display.hpp + * + * Created: 11.05.2014 22:47:23 + * Author: netz + */ + + +#ifndef DISPLAY_H_ +#define DISPLAY_H_ + +template +class Display { + public: + Display() { + + pen::make_output(); + prw::make_output(); + prs::make_output(); + PortData::dir(0xFF); + _delay_ms(100); + this->on(); + this->clear(); + } + void setContrast(uint8_t level) { + poti.set(level); + } + void setBacklight(bool level) { + if(level) { + backlight.on(); + } else { + backlight.off(); + } + } + void write_char(uint8_t data) { + prw::clear(); + prs::set(); + PortData::port(data); + pen::set(); + _delay_ms(1); + pen::clear(); + } + void clear() { + prw::clear(); + prs::clear(); + PortData::port(0b00000001); + pen::set(); + _delay_ms(1); + pen::clear(); + } + void on() { + prw::clear(); + prs::clear(); + PortData::port(0b00001100); + pen::set(); + _delay_ms(1); + pen::clear(); + } + private: + Mcp4151 poti; + Led backlight; + const typedef avrlib::pin pen; + const typedef avrlib::pin prw; + const typedef avrlib::pin prs; + void ramenablemode() { + prs::set(); + } + void ramdisablemode() { + prs::clear(); + } + void writemode() { + prw::clear(); + } + void readmode() { + prw::set(); + } +}; + + + +#endif /* DISPLAY_H_ */ \ No newline at end of file diff --git a/V2/Programm/Programm/io/hardware/portg.hpp b/V2/Programm/Programm/io/hardware/portg.hpp new file mode 100644 index 0000000..28396f1 --- /dev/null +++ b/V2/Programm/Programm/io/hardware/portg.hpp @@ -0,0 +1,22 @@ +#ifndef AVRLIB_PORTG_HPP +#define AVRLIB_PORTG_HPP + +#include + +namespace avrlib { + + struct portg + { + static uint8_t port() { return PORTG; } + static void port(uint8_t v) { PORTG = v; } + + static uint8_t pin() { return PING; } + static void pin(uint8_t v) { PING = v; } + + static uint8_t dir() { return DDRG; } + static void dir(uint8_t v) { DDRG = v; } + }; + +} + +#endif diff --git a/V2/Programm/Programm/io/hardware/portl.hpp b/V2/Programm/Programm/io/hardware/portl.hpp new file mode 100644 index 0000000..ab6f3b2 --- /dev/null +++ b/V2/Programm/Programm/io/hardware/portl.hpp @@ -0,0 +1,22 @@ +#ifndef AVRLIB_PORTL_HPP +#define AVRLIB_PORTL_HPP + +#include + +namespace avrlib { + + struct portl + { + static uint8_t port() { return PORTL; } + static void port(uint8_t v) { PORTL = v; } + + static uint8_t pin() { return PINL; } + static void pin(uint8_t v) { PINL = v; } + + static uint8_t dir() { return DDRL; } + static void dir(uint8_t v) { DDRL = v; } + }; + +} + +#endif diff --git a/V2/Programm/Programm/io/mcp4151.hpp b/V2/Programm/Programm/io/mcp4151.hpp new file mode 100644 index 0000000..2e94d0f --- /dev/null +++ b/V2/Programm/Programm/io/mcp4151.hpp @@ -0,0 +1,92 @@ +/* + * Spi.h + * + * Created: 06.11.2013 15:41:34 + * Author: netz + */ + + +#ifndef MCP4151_H_ +#define MCP4151_H_ + +#include +#include "hardware/pin.hpp" + +template +class Mcp4151 { + public: + const static uint16_t MAX = 256; + const static uint16_t MIN = 185; + Mcp4151() { + this->init(); + } + void CSOn() { + cs::clear(); + } + void CSOff() { + cs::set(); + } + void digitalPotWrite(uint16_t value) { + this->CSOn(); + this->send_soft((value>>8)&0b00000001); //high byte least significant bit + this->send_soft(value & 0xff); + this->CSOff(); + } + void set(uint8_t v) { + this->digitalPotWrite(MIN+v); + } + void set_max() { + this->digitalPotWrite(MAX); + } + void set_min() { + this->digitalPotWrite(MIN); + } + uint8_t read() { + sdi::make_input(); + return this->read_soft(); + } + private: + const typedef avrlib::pin cs; + const typedef avrlib::pin sdi; + const typedef avrlib::pin sck; + void init() { + this->init_port(); + //this->wiper_pos(0, 200); //Clear Poti + } + void init_port() { + sck::make_low(); //output und low; + cs::make_high(); //output und low; + sdi::make_low(); //output und low; + } + void send_soft(uint8_t data) { + for (uint8_t i=0; i<8; i++) + { + if (data & 0x80) { + sdi::make_high(); + } + else { + sdi::make_low(); + } + sck::make_high(); + data<<=1; + _delay_us(0.3); + sck::make_low(); + } + } + uint8_t read_soft() { + uint8_t datain=0; + for (uint8_t i=0; i<8; i++) + { + datain <<= 1; + if(sdi::read()) { + datain |= 1; + } + sck::make_high(); + _delay_us(0.3); + sck::make_low(); + } + return datain; + } +}; + +#endif /* MCP4151_H_ */ \ No newline at end of file diff --git a/V2/Programm/Programm/peripheral.h b/V2/Programm/Programm/peripheral.h index 9db5eaa..1929dfc 100644 --- a/V2/Programm/Programm/peripheral.h +++ b/V2/Programm/Programm/peripheral.h @@ -12,7 +12,11 @@ #define F_CPU 16000000 #include "io/hardware/portb.hpp" +#include "io/hardware/portc.hpp" +#include "io/hardware/portd.hpp" +#include "io/hardware/portg.hpp" #include "io/hardware/porth.hpp" +#include "io/hardware/portl.hpp" #include "io/Led.hpp" typedef Led< @@ -27,7 +31,30 @@ typedef Led< avrlib::porth, //LED an PORTB PINH5 //Rot > ledrotclass; +typedef Led< + avrlib::portl, + PINL3 +> ledlcdclass; +#include "io/mcp4151.hpp" +typedef Mcp4151< // + avrlib::portc, + PINC0, + avrlib::portg, + PING0, + avrlib::portg, + PING1 +> lcdpoticlass; +#include "io/Display.hpp" +typedef Display< // + lcdpoticlass, + ledlcdclass, + avrlib::portd, + avrlib::portl, + PINL7, + PINL6, + PINL5 +> displayclass; #endif /* PERIPHERAL_H_ */ \ No newline at end of file