display test

This commit is contained in:
Dorian Zedler 2018-07-16 17:11:33 +02:00
parent fbb87d2772
commit 481546040f
21 changed files with 868 additions and 116 deletions

Binary file not shown.

View file

@ -120,6 +120,15 @@
</ToolchainSettings>
</PropertyGroup>
<ItemGroup>
<Compile Include="lcd4.c">
<SubType>compile</SubType>
</Compile>
<Compile Include="lcd4.h">
<SubType>compile</SubType>
</Compile>
<Compile Include="lcd_wait.c">
<SubType>compile</SubType>
</Compile>
<Compile Include="main.c">
<SubType>compile</SubType>
</Compile>

View file

@ -0,0 +1 @@
:00000001FF

Binary file not shown.

View file

@ -1,6 +1,25 @@
:1000000014C019C018C017C016C015C014C013C042
:1000100012C011C010C00FC00EC00DC00CC00BC06C
:100020000AC009C008C007C006C011241FBECFED1A
:10003000CDBF02D006C0E4CF8FEF87BB8AEA88BB72
:06004000FECFF894FFCF93
:1000000014C024C023C022C021C020C01FC01EC0F5
:100010001DC01CC01BC01AC019C018C017C016C014
:1000200015C014C013C012C011C011241FBECFEDE3
:10003000CDBF10E0A0E6B0E0E4E6F1E002C005903C
:100040000D92A236B107D9F780D08AC0D9CFCF930D
:10005000C2E362D0C150E9F7CF910895CF93C62F84
:10006000843038F4823048F4882371F0813049F0CC
:100070000CC0843051F4939808C04F73833009F456
:10008000405C842F806824D0939A929A929A98B375
:100090009F708C2F807F982B98BB98B39F70892B73
:1000A00088BB9298929838D087B3803F79F4929A1F
:1000B000929A88B3C295C07F8F708C2B88BB88B30F
:1000C0008F70C82BC8BB9298929826D0CF91089574
:1000D00040E0682F84E0C2DF08958FEF87BB8B9AE2
:1000E0008A9A88BB939A929AB2DFB1DFB0DF80E33D
:1000F000EFDFADDF80E3ECDF0FD080E3E9DF88E204
:10010000E7DF87B3807F87BB8CE0E2DF86E0E0DF5C
:1001100082E0DEDF9CDF0895CF93DF931F92CDB79F
:10012000DD2784E4898389819FEF980F9983882351
:1001300041F08981898189819FEF980F998381118D
:10014000F8CF0F90DF91CF9108958FEF87BBC5DF78
:1001500040E060E670E080E081DF8AEA88BBFECFA5
:04016000F894FFCF41
:02016400740025
:00000001FF

View file

@ -3,84 +3,341 @@ AtTiny_alarm_clock.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 00000046 00000000 00000000 00000054 2**1
0 .text 00000164 00000000 00000000 00000074 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 00000000 00800060 00800060 0000009a 2**0
1 .data 00000002 00800060 00000164 000001d8 2**0
CONTENTS, ALLOC, LOAD, DATA
2 .comment 00000030 00000000 00000000 0000009a 2**0
2 .comment 00000030 00000000 00000000 000001da 2**0
CONTENTS, READONLY
3 .note.gnu.avr.deviceinfo 00000040 00000000 00000000 000000cc 2**2
3 .note.gnu.avr.deviceinfo 00000040 00000000 00000000 0000020c 2**2
CONTENTS, READONLY
4 .debug_aranges 00000020 00000000 00000000 0000010c 2**0
4 .debug_aranges 00000088 00000000 00000000 0000024c 2**0
CONTENTS, READONLY, DEBUGGING
5 .debug_info 000004de 00000000 00000000 0000012c 2**0
5 .debug_info 0000090f 00000000 00000000 000002d4 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_abbrev 00000471 00000000 00000000 0000060a 2**0
6 .debug_abbrev 00000631 00000000 00000000 00000be3 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_line 000001be 00000000 00000000 00000a7b 2**0
7 .debug_line 00000522 00000000 00000000 00001214 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_frame 00000024 00000000 00000000 00000c3c 2**2
8 .debug_frame 000000f4 00000000 00000000 00001738 2**2
CONTENTS, READONLY, DEBUGGING
9 .debug_str 000002a3 00000000 00000000 00000c60 2**0
9 .debug_str 0000035c 00000000 00000000 0000182c 2**0
CONTENTS, READONLY, DEBUGGING
10 .debug_ranges 00000010 00000000 00000000 00000f03 2**0
10 .debug_loc 0000028c 00000000 00000000 00001b88 2**0
CONTENTS, READONLY, DEBUGGING
11 .debug_ranges 00000058 00000000 00000000 00001e14 2**0
CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:
00000000 <__vectors>:
0: 14 c0 rjmp .+40 ; 0x2a <__ctors_end>
2: 19 c0 rjmp .+50 ; 0x36 <__bad_interrupt>
4: 18 c0 rjmp .+48 ; 0x36 <__bad_interrupt>
6: 17 c0 rjmp .+46 ; 0x36 <__bad_interrupt>
8: 16 c0 rjmp .+44 ; 0x36 <__bad_interrupt>
a: 15 c0 rjmp .+42 ; 0x36 <__bad_interrupt>
c: 14 c0 rjmp .+40 ; 0x36 <__bad_interrupt>
e: 13 c0 rjmp .+38 ; 0x36 <__bad_interrupt>
10: 12 c0 rjmp .+36 ; 0x36 <__bad_interrupt>
12: 11 c0 rjmp .+34 ; 0x36 <__bad_interrupt>
14: 10 c0 rjmp .+32 ; 0x36 <__bad_interrupt>
16: 0f c0 rjmp .+30 ; 0x36 <__bad_interrupt>
18: 0e c0 rjmp .+28 ; 0x36 <__bad_interrupt>
1a: 0d c0 rjmp .+26 ; 0x36 <__bad_interrupt>
1c: 0c c0 rjmp .+24 ; 0x36 <__bad_interrupt>
1e: 0b c0 rjmp .+22 ; 0x36 <__bad_interrupt>
20: 0a c0 rjmp .+20 ; 0x36 <__bad_interrupt>
22: 09 c0 rjmp .+18 ; 0x36 <__bad_interrupt>
24: 08 c0 rjmp .+16 ; 0x36 <__bad_interrupt>
26: 07 c0 rjmp .+14 ; 0x36 <__bad_interrupt>
28: 06 c0 rjmp .+12 ; 0x36 <__bad_interrupt>
2: 24 c0 rjmp .+72 ; 0x4c <__bad_interrupt>
4: 23 c0 rjmp .+70 ; 0x4c <__bad_interrupt>
6: 22 c0 rjmp .+68 ; 0x4c <__bad_interrupt>
8: 21 c0 rjmp .+66 ; 0x4c <__bad_interrupt>
a: 20 c0 rjmp .+64 ; 0x4c <__bad_interrupt>
c: 1f c0 rjmp .+62 ; 0x4c <__bad_interrupt>
e: 1e c0 rjmp .+60 ; 0x4c <__bad_interrupt>
10: 1d c0 rjmp .+58 ; 0x4c <__bad_interrupt>
12: 1c c0 rjmp .+56 ; 0x4c <__bad_interrupt>
14: 1b c0 rjmp .+54 ; 0x4c <__bad_interrupt>
16: 1a c0 rjmp .+52 ; 0x4c <__bad_interrupt>
18: 19 c0 rjmp .+50 ; 0x4c <__bad_interrupt>
1a: 18 c0 rjmp .+48 ; 0x4c <__bad_interrupt>
1c: 17 c0 rjmp .+46 ; 0x4c <__bad_interrupt>
1e: 16 c0 rjmp .+44 ; 0x4c <__bad_interrupt>
20: 15 c0 rjmp .+42 ; 0x4c <__bad_interrupt>
22: 14 c0 rjmp .+40 ; 0x4c <__bad_interrupt>
24: 13 c0 rjmp .+38 ; 0x4c <__bad_interrupt>
26: 12 c0 rjmp .+36 ; 0x4c <__bad_interrupt>
28: 11 c0 rjmp .+34 ; 0x4c <__bad_interrupt>
0000002a <__ctors_end>:
2a: 11 24 eor r1, r1
2c: 1f be out 0x3f, r1 ; 63
2e: cf ed ldi r28, 0xDF ; 223
30: cd bf out 0x3d, r28 ; 61
32: 02 d0 rcall .+4 ; 0x38 <main>
34: 06 c0 rjmp .+12 ; 0x42 <_exit>
00000036 <__bad_interrupt>:
36: e4 cf rjmp .-56 ; 0x0 <__vectors>
00000032 <__do_copy_data>:
32: 10 e0 ldi r17, 0x00 ; 0
34: a0 e6 ldi r26, 0x60 ; 96
36: b0 e0 ldi r27, 0x00 ; 0
38: e4 e6 ldi r30, 0x64 ; 100
3a: f1 e0 ldi r31, 0x01 ; 1
3c: 02 c0 rjmp .+4 ; 0x42 <__SREG__+0x3>
3e: 05 90 lpm r0, Z+
40: 0d 92 st X+, r0
42: a2 36 cpi r26, 0x62 ; 98
44: b1 07 cpc r27, r17
46: d9 f7 brne .-10 ; 0x3e <__SP_L__+0x1>
48: 80 d0 rcall .+256 ; 0x14a <main>
4a: 8a c0 rjmp .+276 ; 0x160 <_exit>
00000038 <main>:
0000004c <__bad_interrupt>:
4c: d9 cf rjmp .-78 ; 0x0 <__vectors>
0000004e <lcd_5ms>:
void lcd_1s(void){
for(uint8_t i=200;i>0;i--){
lcd_5ms();
}
}
4e: cf 93 push r28
50: c2 e3 ldi r28, 0x32 ; 50
52: 62 d0 rcall .+196 ; 0x118 <wait_100us>
54: c1 50 subi r28, 0x01 ; 1
56: e9 f7 brne .-6 ; 0x52 <lcd_5ms+0x4>
58: cf 91 pop r28
5a: 08 95 ret
0000005c <lcd_write>:
void lcd_instruct(uint8_t zeichen){
lcd_write(instruct,zeichen,0);
}
void lcd_write(uint8_t lcd_whichwrite, uint8_t zeichen, uint8_t position){
5c: cf 93 push r28
5e: c6 2f mov r28, r22
switch (lcd_whichwrite){
60: 84 30 cpi r24, 0x04 ; 4
62: 38 f4 brcc .+14 ; 0x72 <lcd_write+0x16>
64: 82 30 cpi r24, 0x02 ; 2
66: 48 f4 brcc .+18 ; 0x7a <lcd_write+0x1e>
68: 88 23 and r24, r24
6a: 71 f0 breq .+28 ; 0x88 <lcd_write+0x2c>
6c: 81 30 cpi r24, 0x01 ; 1
6e: 49 f0 breq .+18 ; 0x82 <lcd_write+0x26>
70: 0c c0 rjmp .+24 ; 0x8a <lcd_write+0x2e>
72: 84 30 cpi r24, 0x04 ; 4
74: 51 f4 brne .+20 ; 0x8a <lcd_write+0x2e>
case instruct :
unset_lcd_RS;
76: 93 98 cbi 0x12, 3 ; 18
break;
78: 08 c0 rjmp .+16 ; 0x8a <lcd_write+0x2e>
case line2:
case line1:
position = position & 0x3f;
7a: 4f 73 andi r20, 0x3F ; 63
if (lcd_whichwrite == line2){ position=position + 0x40; };
7c: 83 30 cpi r24, 0x03 ; 3
7e: 09 f4 brne .+2 ; 0x82 <lcd_write+0x26>
80: 40 5c subi r20, 0xC0 ; 192
case therepos:
lcd_instruct(lcd_mask_Write_Adress(position));
82: 84 2f mov r24, r20
84: 80 68 ori r24, 0x80 ; 128
86: 24 d0 rcall .+72 ; 0xd0 <lcd_instruct>
case here:
set_lcd_RS;
88: 93 9a sbi 0x12, 3 ; 18
break;
}
set_lcd_E;
8a: 92 9a sbi 0x12, 2 ; 18
set_lcd_E;
8c: 92 9a sbi 0x12, 2 ; 18
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
8e: 98 b3 in r25, 0x18 ; 24
90: 9f 70 andi r25, 0x0F ; 15
92: 8c 2f mov r24, r28
94: 80 7f andi r24, 0xF0 ; 240
96: 98 2b or r25, r24
98: 98 bb out 0x18, r25 ; 24
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
9a: 98 b3 in r25, 0x18 ; 24
9c: 9f 70 andi r25, 0x0F ; 15
9e: 89 2b or r24, r25
a0: 88 bb out 0x18, r24 ; 24
unset_lcd_E;
a2: 92 98 cbi 0x12, 2 ; 18
unset_lcd_E;
a4: 92 98 cbi 0x12, 2 ; 18
wait_100us();
a6: 38 d0 rcall .+112 ; 0x118 <wait_100us>
if (lcd_dataport_DDR==0xf0){
a8: 87 b3 in r24, 0x17 ; 23
aa: 80 3f cpi r24, 0xF0 ; 240
ac: 79 f4 brne .+30 ; 0xcc <lcd_write+0x70>
zeichen=zeichen << 4;
set_lcd_E;
ae: 92 9a sbi 0x12, 2 ; 18
set_lcd_E;
b0: 92 9a sbi 0x12, 2 ; 18
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
b2: 88 b3 in r24, 0x18 ; 24
b4: c2 95 swap r28
b6: c0 7f andi r28, 0xF0 ; 240
b8: 8f 70 andi r24, 0x0F ; 15
ba: 8c 2b or r24, r28
bc: 88 bb out 0x18, r24 ; 24
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
be: 88 b3 in r24, 0x18 ; 24
c0: 8f 70 andi r24, 0x0F ; 15
c2: c8 2b or r28, r24
c4: c8 bb out 0x18, r28 ; 24
unset_lcd_E;
c6: 92 98 cbi 0x12, 2 ; 18
unset_lcd_E;
c8: 92 98 cbi 0x12, 2 ; 18
wait_100us();
ca: 26 d0 rcall .+76 ; 0x118 <wait_100us>
}
}
cc: cf 91 pop r28
ce: 08 95 ret
000000d0 <lcd_instruct>:
lcd_5ms();
}
}
void lcd_instruct(uint8_t zeichen){
lcd_write(instruct,zeichen,0);
d0: 40 e0 ldi r20, 0x00 ; 0
d2: 68 2f mov r22, r24
d4: 84 e0 ldi r24, 0x04 ; 4
d6: c2 df rcall .-124 ; 0x5c <lcd_write>
d8: 08 95 ret
000000da <lcd_init>:
void lcd_init(void){
/* setting up ports first */
lcd_dataport_DDR=0xff;
da: 8f ef ldi r24, 0xFF ; 255
dc: 87 bb out 0x17, r24 ; 23
set_lcd_RS_DDR;
de: 8b 9a sbi 0x11, 3 ; 17
set_lcd_E_DDR;
e0: 8a 9a sbi 0x11, 2 ; 17
/* end setting up ports */
lcd_dataport=0xff;
e2: 88 bb out 0x18, r24 ; 24
set_lcd_RS;
e4: 93 9a sbi 0x12, 3 ; 18
set_lcd_E;
e6: 92 9a sbi 0x12, 2 ; 18
lcd_5ms();
e8: b2 df rcall .-156 ; 0x4e <lcd_5ms>
lcd_5ms();
ea: b1 df rcall .-158 ; 0x4e <lcd_5ms>
lcd_5ms();
ec: b0 df rcall .-160 ; 0x4e <lcd_5ms>
lcd_instruct(lcd_SET_FUNCTION_8BIT);
ee: 80 e3 ldi r24, 0x30 ; 48
f0: ef df rcall .-34 ; 0xd0 <lcd_instruct>
lcd_5ms();
f2: ad df rcall .-166 ; 0x4e <lcd_5ms>
lcd_instruct(lcd_SET_FUNCTION_8BIT);
f4: 80 e3 ldi r24, 0x30 ; 48
f6: ec df rcall .-40 ; 0xd0 <lcd_instruct>
wait_100us();
f8: 0f d0 rcall .+30 ; 0x118 <wait_100us>
lcd_instruct(lcd_SET_FUNCTION_8BIT);
fa: 80 e3 ldi r24, 0x30 ; 48
fc: e9 df rcall .-46 ; 0xd0 <lcd_instruct>
if (lcd_dataport_mask==0xf0){
lcd_instruct(lcd_SET_FUNCTION_4BIT|lcd_SET_FUNCTION_2LINE|lcd_SET_FUNCTION_7X5);
fe: 88 e2 ldi r24, 0x28 ; 40
100: e7 df rcall .-50 ; 0xd0 <lcd_instruct>
}else{
lcd_instruct(lcd_SET_FUNCTION_8BIT|lcd_SET_FUNCTION_2LINE|lcd_SET_FUNCTION_7X5);
}
lcd_dataport_DDR&=lcd_dataport_mask;
102: 87 b3 in r24, 0x17 ; 23
104: 80 7f andi r24, 0xF0 ; 240
106: 87 bb out 0x17, r24 ; 23
lcd_instruct(lcd_DISPLAY_OO_ON|lcd_DISPLAY_OO_CURSOR_OFF);
108: 8c e0 ldi r24, 0x0C ; 12
10a: e2 df rcall .-60 ; 0xd0 <lcd_instruct>
lcd_instruct(lcd_ENTRY_MODE_SET|lcd_ENTRY_MODE_SET_INCREASE | lcd_ENTRY_MS_DISPLAY_NOT_S);
10c: 86 e0 ldi r24, 0x06 ; 6
10e: e0 df rcall .-64 ; 0xd0 <lcd_instruct>
lcd_instruct(lcd_RETURN_HOME);
110: 82 e0 ldi r24, 0x02 ; 2
112: de df rcall .-68 ; 0xd0 <lcd_instruct>
lcd_5ms();
114: 9c df rcall .-200 ; 0x4e <lcd_5ms>
116: 08 95 ret
00000118 <wait_100us>:
#include <inttypes.h>
#include <avr/io.h>
#include "lcd4.h"
void wait_100us(void){
118: cf 93 push r28
11a: df 93 push r29
11c: 1f 92 push r1
11e: cd b7 in r28, 0x3d ; 61
120: dd 27 eor r29, r29
for (volatile uint8_t i=68;i--;i>0){
122: 84 e4 ldi r24, 0x44 ; 68
124: 89 83 std Y+1, r24 ; 0x01
126: 89 81 ldd r24, Y+1 ; 0x01
128: 9f ef ldi r25, 0xFF ; 255
12a: 98 0f add r25, r24
12c: 99 83 std Y+1, r25 ; 0x01
12e: 88 23 and r24, r24
130: 41 f0 breq .+16 ; 0x142 <wait_100us+0x2a>
i;
132: 89 81 ldd r24, Y+1 ; 0x01
#include <inttypes.h>
#include <avr/io.h>
#include "lcd4.h"
void wait_100us(void){
for (volatile uint8_t i=68;i--;i>0){
134: 89 81 ldd r24, Y+1 ; 0x01
136: 89 81 ldd r24, Y+1 ; 0x01
138: 9f ef ldi r25, 0xFF ; 255
13a: 98 0f add r25, r24
13c: 99 83 std Y+1, r25 ; 0x01
13e: 81 11 cpse r24, r1
140: f8 cf rjmp .-16 ; 0x132 <wait_100us+0x1a>
i;
}
}
142: 0f 90 pop r0
144: df 91 pop r29
146: cf 91 pop r28
148: 08 95 ret
0000014a <main>:
#include "lcd4.h"
int main(void)
{
DDRB = 0xff;
38: 8f ef ldi r24, 0xFF ; 255
3a: 87 bb out 0x17, r24 ; 23
14a: 8f ef ldi r24, 0xFF ; 255
14c: 87 bb out 0x17, r24 ; 23
lcd_init();
14e: c5 df rcall .-118 ; 0xda <lcd_init>
lcd_write(here, "t", 0);
150: 40 e0 ldi r20, 0x00 ; 0
152: 60 e6 ldi r22, 0x60 ; 96
154: 70 e0 ldi r23, 0x00 ; 0
156: 80 e0 ldi r24, 0x00 ; 0
158: 81 df rcall .-254 ; 0x5c <lcd_write>
/* Replace with your application code */
while (1)
{
PORTB = 0xAA;
3c: 8a ea ldi r24, 0xAA ; 170
3e: 88 bb out 0x18, r24 ; 24
40: fe cf rjmp .-4 ; 0x3e <__SP_L__+0x1>
15a: 8a ea ldi r24, 0xAA ; 170
15c: 88 bb out 0x18, r24 ; 24
15e: fe cf rjmp .-4 ; 0x15c <main+0x12>
00000042 <_exit>:
42: f8 94 cli
00000160 <_exit>:
160: f8 94 cli
00000044 <__stop_program>:
44: ff cf rjmp .-2 ; 0x44 <__stop_program>
00000162 <__stop_program>:
162: ff cf rjmp .-2 ; 0x162 <__stop_program>

View file

@ -2,11 +2,22 @@ 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/avr25/tiny-stack\libgcc.a(_exit.o)
C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATtiny_DFP/1.3.172/gcc/dev/attiny2313a/avr25/tiny-stack/crtattiny2313a.o (exit)
c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr25/tiny-stack\libgcc.a(_copy_data.o)
main.o (__do_copy_data)
Discarded input sections
.data 0x00000000 0x0 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATtiny_DFP/1.3.172/gcc/dev/attiny2313a/avr25/tiny-stack/crtattiny2313a.o
.bss 0x00000000 0x0 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATtiny_DFP/1.3.172/gcc/dev/attiny2313a/avr25/tiny-stack/crtattiny2313a.o
.text 0x00000000 0x0 lcd4.o
.data 0x00000000 0x0 lcd4.o
.bss 0x00000000 0x0 lcd4.o
.text.lcd_1s 0x00000000 0xe lcd4.o
.text.lcd_blank_line
0x00000000 0x4e lcd4.o
.text 0x00000000 0x0 lcd_wait.o
.data 0x00000000 0x0 lcd_wait.o
.bss 0x00000000 0x0 lcd_wait.o
.text 0x00000000 0x0 main.o
.data 0x00000000 0x0 main.o
.bss 0x00000000 0x0 main.o
@ -26,6 +37,22 @@ Discarded input sections
0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr25/tiny-stack\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/avr25/tiny-stack\libgcc.a(_exit.o)
.text 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr25/tiny-stack\libgcc.a(_copy_data.o)
.data 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr25/tiny-stack\libgcc.a(_copy_data.o)
.bss 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr25/tiny-stack\libgcc.a(_copy_data.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/avr25/tiny-stack\libgcc.a(_copy_data.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/avr25/tiny-stack\libgcc.a(_copy_data.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/avr25/tiny-stack\libgcc.a(_copy_data.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/avr25/tiny-stack\libgcc.a(_copy_data.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/avr25/tiny-stack\libgcc.a(_copy_data.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/avr25/tiny-stack\libgcc.a(_copy_data.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/avr25/tiny-stack\libgcc.a(_copy_data.o)
Memory Configuration
@ -42,6 +69,8 @@ user_signatures 0x00850000 0x00000400 rw !x
Linker script and memory map
LOAD C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATtiny_DFP/1.3.172/gcc/dev/attiny2313a/avr25/tiny-stack/crtattiny2313a.o
LOAD lcd4.o
LOAD lcd_wait.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/avr25/tiny-stack\libm.a
@ -150,7 +179,7 @@ END GROUP
.rela.plt
*(.rela.plt)
.text 0x00000000 0x46
.text 0x00000000 0x164
*(.vectors)
.vectors 0x00000000 0x2a C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATtiny_DFP/1.3.172/gcc/dev/attiny2313a/avr25/tiny-stack/crtattiny2313a.o
0x00000000 __vector_default
@ -191,6 +220,8 @@ END GROUP
*(.init3)
*(.init3)
*(.init4)
.init4 0x00000032 0x16 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr25/tiny-stack\libgcc.a(_copy_data.o)
0x00000032 __do_copy_data
*(.init4)
*(.init5)
*(.init5)
@ -201,40 +232,54 @@ END GROUP
*(.init8)
*(.init8)
*(.init9)
.init9 0x00000032 0x4 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATtiny_DFP/1.3.172/gcc/dev/attiny2313a/avr25/tiny-stack/crtattiny2313a.o
.init9 0x00000048 0x4 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATtiny_DFP/1.3.172/gcc/dev/attiny2313a/avr25/tiny-stack/crtattiny2313a.o
*(.init9)
*(.text)
.text 0x00000036 0x2 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATtiny_DFP/1.3.172/gcc/dev/attiny2313a/avr25/tiny-stack/crtattiny2313a.o
0x00000036 __vector_1
0x00000036 __vector_12
0x00000036 __bad_interrupt
0x00000036 __vector_6
0x00000036 __vector_3
0x00000036 __vector_11
0x00000036 __vector_13
0x00000036 __vector_17
0x00000036 __vector_19
0x00000036 __vector_7
0x00000036 __vector_5
0x00000036 __vector_4
0x00000036 __vector_9
0x00000036 __vector_2
0x00000036 __vector_15
0x00000036 __vector_8
0x00000036 __vector_14
0x00000036 __vector_10
0x00000036 __vector_16
0x00000036 __vector_18
0x00000036 __vector_20
0x00000038 . = ALIGN (0x2)
.text 0x0000004c 0x2 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATtiny_DFP/1.3.172/gcc/dev/attiny2313a/avr25/tiny-stack/crtattiny2313a.o
0x0000004c __vector_1
0x0000004c __vector_12
0x0000004c __bad_interrupt
0x0000004c __vector_6
0x0000004c __vector_3
0x0000004c __vector_11
0x0000004c __vector_13
0x0000004c __vector_17
0x0000004c __vector_19
0x0000004c __vector_7
0x0000004c __vector_5
0x0000004c __vector_4
0x0000004c __vector_9
0x0000004c __vector_2
0x0000004c __vector_15
0x0000004c __vector_8
0x0000004c __vector_14
0x0000004c __vector_10
0x0000004c __vector_16
0x0000004c __vector_18
0x0000004c __vector_20
0x0000004e . = ALIGN (0x2)
*(.text.*)
.text.main 0x00000038 0xa main.o
0x00000038 main
0x00000042 . = ALIGN (0x2)
.text.lcd_5ms 0x0000004e 0xe lcd4.o
0x0000004e lcd_5ms
.text.lcd_write
0x0000005c 0x74 lcd4.o
0x0000005c lcd_write
.text.lcd_instruct
0x000000d0 0xa lcd4.o
0x000000d0 lcd_instruct
.text.lcd_init
0x000000da 0x3e lcd4.o
0x000000da lcd_init
.text.wait_100us
0x00000118 0x32 lcd_wait.o
0x00000118 wait_100us
.text.main 0x0000014a 0x16 main.o
0x0000014a main
0x00000160 . = ALIGN (0x2)
*(.fini9)
.fini9 0x00000042 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr25/tiny-stack\libgcc.a(_exit.o)
0x00000042 _exit
0x00000042 exit
.fini9 0x00000160 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr25/tiny-stack\libgcc.a(_exit.o)
0x00000160 _exit
0x00000160 exit
*(.fini9)
*(.fini8)
*(.fini8)
@ -253,36 +298,38 @@ END GROUP
*(.fini1)
*(.fini1)
*(.fini0)
.fini0 0x00000042 0x4 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr25/tiny-stack\libgcc.a(_exit.o)
.fini0 0x00000160 0x4 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr25/tiny-stack\libgcc.a(_exit.o)
*(.fini0)
0x00000046 _etext = .
0x00000164 _etext = .
.data 0x00800060 0x0 load address 0x00000046
[!provide] PROVIDE (__data_start, .)
.data 0x00800060 0x2 load address 0x00000164
0x00800060 PROVIDE (__data_start, .)
*(.data)
*(.data*)
*(.gnu.linkonce.d*)
*(.rodata)
*(.rodata*)
.rodata.str1.1
0x00800060 0x2 main.o
*(.gnu.linkonce.r*)
0x00800060 . = ALIGN (0x2)
0x00800060 _edata = .
[!provide] PROVIDE (__data_end, .)
0x00800062 . = ALIGN (0x2)
0x00800062 _edata = .
0x00800062 PROVIDE (__data_end, .)
.bss 0x00800060 0x0
.bss 0x00800062 0x0
[!provide] PROVIDE (__bss_start, .)
*(.bss)
*(.bss*)
*(COMMON)
[!provide] PROVIDE (__bss_end, .)
0x00000046 __data_load_start = LOADADDR (.data)
0x00000046 __data_load_end = (__data_load_start + SIZEOF (.data))
0x00000164 __data_load_start = LOADADDR (.data)
0x00000166 __data_load_end = (__data_load_start + SIZEOF (.data))
.noinit 0x00800060 0x0
.noinit 0x00800062 0x0
[!provide] PROVIDE (__noinit_start, .)
*(.noinit*)
[!provide] PROVIDE (__noinit_end, .)
0x00800060 _end = .
0x00800062 _end = .
[!provide] PROVIDE (__heap_start, .)
.eeprom 0x00810000 0x0
@ -324,8 +371,10 @@ END GROUP
.comment 0x00000000 0x30
*(.comment)
.comment 0x00000000 0x30 main.o
.comment 0x00000000 0x30 lcd4.o
0x31 (size before relaxing)
.comment 0x00000030 0x31 lcd_wait.o
.comment 0x00000030 0x31 main.o
.note.gnu.avr.deviceinfo
0x00000000 0x40
@ -347,41 +396,59 @@ END GROUP
.debug_sfnames
*(.debug_sfnames)
.debug_aranges 0x00000000 0x20
.debug_aranges 0x00000000 0x88
*(.debug_aranges)
.debug_aranges
0x00000000 0x20 main.o
0x00000000 0x48 lcd4.o
.debug_aranges
0x00000048 0x20 lcd_wait.o
.debug_aranges
0x00000068 0x20 main.o
.debug_pubnames
*(.debug_pubnames)
.debug_info 0x00000000 0x4de
.debug_info 0x00000000 0x90f
*(.debug_info .gnu.linkonce.wi.*)
.debug_info 0x00000000 0x456 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATtiny_DFP/1.3.172/gcc/dev/attiny2313a/avr25/tiny-stack/crtattiny2313a.o
.debug_info 0x00000456 0x88 main.o
.debug_info 0x00000456 0x31d lcd4.o
.debug_info 0x00000773 0xa3 lcd_wait.o
.debug_info 0x00000816 0xf9 main.o
.debug_abbrev 0x00000000 0x471
.debug_abbrev 0x00000000 0x631
*(.debug_abbrev)
.debug_abbrev 0x00000000 0x41b C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATtiny_DFP/1.3.172/gcc/dev/attiny2313a/avr25/tiny-stack/crtattiny2313a.o
.debug_abbrev 0x0000041b 0x56 main.o
.debug_abbrev 0x0000041b 0xfe lcd4.o
.debug_abbrev 0x00000519 0x72 lcd_wait.o
.debug_abbrev 0x0000058b 0xa6 main.o
.debug_line 0x00000000 0x1be
.debug_line 0x00000000 0x522
*(.debug_line .debug_line.* .debug_line_end)
.debug_line 0x00000000 0x10c C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATtiny_DFP/1.3.172/gcc/dev/attiny2313a/avr25/tiny-stack/crtattiny2313a.o
.debug_line 0x0000010c 0xb2 main.o
.debug_line 0x0000010c 0x291 lcd4.o
.debug_line 0x0000039d 0xbd lcd_wait.o
.debug_line 0x0000045a 0xc8 main.o
.debug_frame 0x00000000 0x24
.debug_frame 0x00000000 0xf4
*(.debug_frame)
.debug_frame 0x00000000 0x24 main.o
.debug_frame 0x00000000 0x9c lcd4.o
.debug_frame 0x0000009c 0x34 lcd_wait.o
.debug_frame 0x000000d0 0x24 main.o
.debug_str 0x00000000 0x2a3
.debug_str 0x00000000 0x35c
*(.debug_str)
.debug_str 0x00000000 0x17b C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATtiny_DFP/1.3.172/gcc/dev/attiny2313a/avr25/tiny-stack/crtattiny2313a.o
.debug_str 0x0000017b 0x128 main.o
0x15c (size before relaxing)
.debug_str 0x0000017b 0x1c0 lcd4.o
0x1fd (size before relaxing)
.debug_str 0x0000033b 0x10 lcd_wait.o
0x166 (size before relaxing)
.debug_str 0x0000034b 0x11 main.o
0x1ad (size before relaxing)
.debug_loc
.debug_loc 0x00000000 0x28c
*(.debug_loc)
.debug_loc 0x00000000 0x244 lcd4.o
.debug_loc 0x00000244 0x48 lcd_wait.o
.debug_macinfo
*(.debug_macinfo)
@ -401,9 +468,11 @@ END GROUP
.debug_pubtypes
*(.debug_pubtypes)
.debug_ranges 0x00000000 0x10
.debug_ranges 0x00000000 0x58
*(.debug_ranges)
.debug_ranges 0x00000000 0x10 main.o
.debug_ranges 0x00000000 0x38 lcd4.o
.debug_ranges 0x00000038 0x10 lcd_wait.o
.debug_ranges 0x00000048 0x10 main.o
.debug_macro
*(.debug_macro)

View file

@ -1,7 +1,26 @@
S01A0000417454696E795F616C61726D5F636C6F636B2E73726563DA
S113000014C019C018C017C016C015C014C013C03E
S113001012C011C010C00FC00EC00DC00CC00BC068
S11300200AC009C008C007C006C011241FBECFED16
S1130030CDBF02D006C0E4CF8FEF87BB8AEA88BB6E
S1090040FECFF894FFCF8F
S113000014C024C023C022C021C020C01FC01EC0F1
S11300101DC01CC01BC01AC019C018C017C016C010
S113002015C014C013C012C011C011241FBECFEDDF
S1130030CDBF10E0A0E6B0E0E4E6F1E002C0059038
S11300400D92A236B107D9F780D08AC0D9CFCF9309
S1130050C2E362D0C150E9F7CF910895CF93C62F80
S1130060843038F4823048F4882371F0813049F0C8
S11300700CC0843051F4939808C04F73833009F452
S1130080405C842F806824D0939A929A929A98B371
S11300909F708C2F807F982B98BB98B39F70892B6F
S11300A088BB9298929838D087B3803F79F4929A1B
S11300B0929A88B3C295C07F8F708C2B88BB88B30B
S11300C08F70C82BC8BB9298929826D0CF91089570
S11300D040E0682F84E0C2DF08958FEF87BB8B9ADE
S11300E08A9A88BB939A929AB2DFB1DFB0DF80E339
S11300F0EFDFADDF80E3ECDF0FD080E3E9DF88E200
S1130100E7DF87B3807F87BB8CE0E2DF86E0E0DF58
S113011082E0DEDF9CDF0895CF93DF931F92CDB79B
S1130120DD2784E4898389819FEF980F998388234D
S113013041F08981898189819FEF980F9983811189
S1130140F8CF0F90DF91CF9108958FEF87BBC5DF74
S113015040E060E670E080E081DF8AEA88BBFECFA1
S1070160F894FFCF3D
S1050164740021
S9030000FC

View file

@ -37,6 +37,8 @@ SUBDIRS :=
# Add inputs and outputs from these tool invocations to the build variables
C_SRCS += \
../lcd4.c \
../lcd_wait.c \
../main.c
@ -47,15 +49,23 @@ ASM_SRCS +=
OBJS += \
lcd4.o \
lcd_wait.o \
main.o
OBJS_AS_ARGS += \
lcd4.o \
lcd_wait.o \
main.o
C_DEPS += \
lcd4.d \
lcd_wait.d \
main.d
C_DEPS_AS_ARGS += \
lcd4.d \
lcd_wait.d \
main.d
OUTPUT_FILE_PATH +=AtTiny_alarm_clock.elf
@ -72,6 +82,20 @@ LINKER_SCRIPT_DEP+=
# AVR32/GNU C Compiler
./lcd4.o: .././lcd4.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\ATtiny_DFP\1.3.172\include" -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=attiny2313a -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.3.172\gcc\dev\attiny2313a" -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<"
@echo Finished building: $<
./lcd_wait.o: .././lcd_wait.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\ATtiny_DFP\1.3.172\include" -O1 -ffunction-sections -fdata-sections -fpack-struct -fshort-enums -g2 -Wall -mmcu=attiny2313a -B "C:\Program Files (x86)\Atmel\Studio\7.0\Packs\atmel\ATtiny_DFP\1.3.172\gcc\dev\attiny2313a" -c -std=gnu99 -MD -MP -MF "$(@:%.o=%.d)" -MT"$(@:%.o=%.d)" -MT"$(@:%.o=%.o)" -o "$@" "$<"
@echo Finished building: $<
./main.o: .././main.c
@echo Building file: $<
@echo Invoking: AVR/GNU C Compiler : 5.4.0

37
Debug/lcd4.d Normal file
View file

@ -0,0 +1,37 @@
lcd4.d lcd4.o: .././lcd4.c \
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\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\Packs\atmel\ATtiny_DFP\1.3.172\include/avr/iotn2313a.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 \
.././lcd4.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\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\Packs\atmel\ATtiny_DFP\1.3.172\include/avr/iotn2313a.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:
.././lcd4.h:

BIN
Debug/lcd4.o Normal file

Binary file not shown.

37
Debug/lcd_wait.d Normal file
View file

@ -0,0 +1,37 @@
lcd_wait.d lcd_wait.o: .././lcd_wait.c \
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\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\Packs\atmel\ATtiny_DFP\1.3.172\include/avr/iotn2313a.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 \
.././lcd4.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\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\Packs\atmel\ATtiny_DFP\1.3.172\include/avr/iotn2313a.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:
.././lcd4.h:

BIN
Debug/lcd_wait.o Normal file

Binary file not shown.

View file

@ -9,7 +9,8 @@ main.d main.o: .././main.c \
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\avr\lock.h \
.././lcd4.h
c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\include\avr\io.h:
@ -32,3 +33,5 @@ c:\program\ files\ (x86)\atmel\studio\7.0\toolchain\avr8\avr8-gnu-toolchain\avr\
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:
.././lcd4.h:

Binary file not shown.

View file

@ -2,5 +2,9 @@
# Automatically-generated file. Do not edit or delete the file
################################################################################
lcd4.c
lcd_wait.c
main.c

132
lcd4.c Normal file
View file

@ -0,0 +1,132 @@
/************************************
* lcd-Treiber-Bibliothek für Hitachi 44780 und kompatible
* z.B. KS0070B
*
*/
#include <inttypes.h>
#include <avr/io.h>
#include "lcd4.h"
/* Prototypes */
extern void wait_100us(void);
//void lcd_init(void);
//void lcd_write(uint8_t whichwrite, uint8_t zeichen, uint8_t position);
void lcd_instruct(uint8_t zeichen); //Optimzation of Code length (costs one fuction call)
// expands to lcd_write(instruct, zeichen, 0);
// void lcd_blank_line(uint8_t lcd_whichwrite);
void lcd_preinstruct(uint8_t zeichen); //Optimzation of Code length (costs one fuction call)
// expands to lcd_write(preinstruct, zeichen, 0);
// void lcd_blank_line(uint8_t lcd_whichwrite);
// Implementation
void lcd_5ms(void);
void lcd_1s(void);
/* end Prototypes */
#define lcd_mask_Write_Adress(position) ((position & 0x7F)| lcd_SET_DD_RAM)
void lcd_init(void){
/* setting up ports first */
lcd_dataport_DDR=0xff;
set_lcd_RS_DDR;
set_lcd_E_DDR;
/* end setting up ports */
lcd_dataport=0xff;
set_lcd_RS;
set_lcd_E;
lcd_5ms();
lcd_5ms();
lcd_5ms();
lcd_instruct(lcd_SET_FUNCTION_8BIT);
lcd_5ms();
lcd_instruct(lcd_SET_FUNCTION_8BIT);
wait_100us();
lcd_instruct(lcd_SET_FUNCTION_8BIT);
if (lcd_dataport_mask==0xf0){
lcd_instruct(lcd_SET_FUNCTION_4BIT|lcd_SET_FUNCTION_2LINE|lcd_SET_FUNCTION_7X5);
}else{
lcd_instruct(lcd_SET_FUNCTION_8BIT|lcd_SET_FUNCTION_2LINE|lcd_SET_FUNCTION_7X5);
}
lcd_dataport_DDR&=lcd_dataport_mask;
lcd_instruct(lcd_DISPLAY_OO_ON|lcd_DISPLAY_OO_CURSOR_OFF);
lcd_instruct(lcd_ENTRY_MODE_SET|lcd_ENTRY_MODE_SET_INCREASE | lcd_ENTRY_MS_DISPLAY_NOT_S);
lcd_instruct(lcd_RETURN_HOME);
lcd_5ms();
}
void lcd_5ms(void){
for(uint8_t i=50;i>0;i--){
wait_100us();
}
}
void lcd_1s(void){
for(uint8_t i=200;i>0;i--){
lcd_5ms();
}
}
void lcd_instruct(uint8_t zeichen){
lcd_write(instruct,zeichen,0);
}
void lcd_write(uint8_t lcd_whichwrite, uint8_t zeichen, uint8_t position){
switch (lcd_whichwrite){
case instruct :
unset_lcd_RS;
break;
case line2:
case line1:
position = position & 0x3f;
if (lcd_whichwrite == line2){ position=position + 0x40; };
case therepos:
lcd_instruct(lcd_mask_Write_Adress(position));
case here:
set_lcd_RS;
break;
}
set_lcd_E;
set_lcd_E;
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
unset_lcd_E;
unset_lcd_E;
wait_100us();
if (lcd_dataport_DDR==0xf0){
zeichen=zeichen << 4;
set_lcd_E;
set_lcd_E;
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
unset_lcd_E;
unset_lcd_E;
wait_100us();
}
}
void lcd_blank_line(uint8_t lcd_whichwrite)
{
uint8_t count;
uint8_t countin;
switch (lcd_whichwrite){
case instruct:
lcd_blank_line(line1);
case line2:
count=0x40;
break;
case line1:
count=0;
}
for (countin=count; countin < count+15; countin++){
lcd_write(therepos, 32, countin);
}
}

95
lcd4.h Normal file
View file

@ -0,0 +1,95 @@
/* avrmb2313_lcd.h
* V 1.0 by (Hr & RJH-Systems) @ (FLG)
* 30.03.07
* Zum Ansteuern eines zweizeiligen LCD-Displays
* Hitachi 44780 od. KS0070B
* auf dem AVR-evaluationsboard von Matze Brenner
* > www.flg-informatik.de
* 8-bit Mode
* 4-bit Mode
*/
#ifndef avrmb2313_lcd
#define avrmb2313_lcd
#include <inttypes.h>
/* Some ports must be definded first, dont touch these for avrmb2313-project
* but set for other Designs using other out-Ports
*/
#ifndef lcd_bus4
#ifndef lcd_bus8
#define lcd_bus4 //defaults to 4-Bit
#endif
#endif
#ifndef lcd_dataports_defined
#define lcd_dataports_defined
#include <avr/io.h>
#define lcd_dataport PORTB
#define lcd_dataport_DDR DDRB // DataDirectionRegister für lcd_datatport
//#ifdef lcd_bus8
#define lcd_dataport_mask 0xf0 // which bits in that port (8-bit = 0xff for 8-bit operation)
//#else
// #define lcd_dataport_mask 0xf0 // which bits in that port (4-bit = 0xf0 for 4-bit operation)
// #endif
#define set_lcd_RS_DDR DDRD=(DDRD | ((uint8_t) 0x08)) // Dir-Out für lcd _RS setzen)
#define set_lcd_E_DDR DDRD=(DDRD | ((uint8_t) 0x04)) // Dir-Out für lcd _E setzen)
#define set_lcd_RS PORTD=(PORTD | ((uint8_t) 0x08)) // Bit für lcd _RS setzen)
#define unset_lcd_RS PORTD=(PORTD & ~((uint8_t) 0x08)) // Bit für lcd _RS löschen)
#define set_lcd_E PORTD=(PORTD | ((uint8_t) 0x04)) // Bit für lcd _E setzen)
#define unset_lcd_E PORTD=(PORTD & ~((uint8_t) 0x04)) // Bit für lcd _E löschen)
#
#endif
extern void wait_100us(void); // This function must be implemented
// Bitte eine Funktion "void wait_100us()" implementieren, die 100us wartet
// Please implement function "void wait_100us()": just waiting 100*10^(-6) s
extern void lcd_init(void);
extern void lcd_write(uint8_t lcd_whichwrite, uint8_t zeichen, uint8_t position);
enum lcd_whichwrite{here, therepos, line1, line2, instruct, preinstruct};
extern void lcd_blank_line(uint8_t lcd_whichwrite); // line1, line2, instruct=all
extern void lcd_instruct(uint8_t zeichen);
/* possible "zeichen":
lcd_DISPLAY_CLEAR
lcd_RETURN_HOME
lcd_ENTRY_MODE_SET_INCREASE
lcd_ENTRY_MODE_SET_DECREASE
lcd_ENTRY_MODE_SET_DISPLAY_SHIFTED
lcd_ENTRY_MS_DISPLAY_NOT_S hifted
*/
extern void lcd_5ms(); //based on wait_100us
extern void lcd_1s(); //based on wait_100us
// Die Konstanten des lcd-Kontrollers local
#define lcd_DISPLAY_CLEAR 0b00000001
#define lcd_RETURN_HOME 0b00000010
#define lcd_ENTRY_MODE_SET 0b00000100
#define lcd_ENTRY_MODE_SET_INCREASE 0b00000110
#define lcd_ENTRY_MODE_SET_DECREASE 0b00000100
#define lcd_ENTRY_MODE_SET_DISPLAY_SHIFTED 0b00000101
#define lcd_ENTRY_MS_DISPLAY_NOT_S 0b00000100
#define lcd_DISPLAY_OO 0b00001000
#define lcd_DISPLAY_OO_ON 0b00001100
#define lcd_DISPLAY_OO_OFF 0b00001000
#define lcd_DISPLAY_OO_CURSOR_ON 0b00001010
#define lcd_DISPLAY_OO_CURSOR_OFF 0b00001000
#define lcd_DISPLAY_OO_BLINKING_ON 0b00001001
#define lcd_DISPLAY_OO_BLINKING_OFF 0b00001000
#define lcd_SHIFT 0b00010000
#define lcd_SHIFT_DISPLAY_SHIFT 0b00011000
#define lcd_SHIFT_CURSOR_MOVE 0b00010000
#define lcd_SHIFT_RIGHT_SHIFT 0b00010100
#define lcd_SHIFT_LEFT_SHIFT 0b00010000
#define lcd_SET_FUNCTION 0b00100000
#define lcd_SET_FUNCTION_8BIT 0b00110000
#define lcd_SET_FUNCTION_4BIT 0b00100000
#define lcd_SET_FUNCTION_2LINE 0b00101000
#define lcd_SET_FUNCTION_1LINE 0b00100000
#define lcd_SET_FUNCTION_5X10 0b00100100
#define lcd_SET_FUNCTION_7X5 0b00100000
#define lcd_SET_CG_RAM 0b01000000
#define lcd_SET_DD_RAM 0b10000000
#endif

9
lcd_wait.c Normal file
View file

@ -0,0 +1,9 @@
#include <inttypes.h>
#include <avr/io.h>
#include "lcd4.h"
void wait_100us(void){
for (volatile uint8_t i=68;i--;i>0){
i;
}
}

34
lcdtest.c Normal file
View file

@ -0,0 +1,34 @@
#include <inttypes.h>
#include <avr/io.h>
#define lcd_bus8
#include "lcd4.h"
int main(void){
lcd_1s();
lcd_init();
lcd_1s();
lcd_1s();
lcd_write(therepos,0x41,0x08);
lcd_1s();
lcd_1s();
lcd_write(here,0x42,0);
lcd_1s();
lcd_1s();
lcd_write(here,0x43,0);
lcd_1s();
lcd_1s();
lcd_write(here,0x44,0);
lcd_1s();
lcd_1s();
DDRB = 0x0f;
while(1==1){
PORTB = 0x0f;
lcd_1s();
PORTB = 0x05;
lcd_1s();
PORTB = 0x0A;
lcd_1s();
}
}

3
main.c
View file

@ -6,11 +6,14 @@
*/
#include <avr/io.h>
#include "lcd4.h"
int main(void)
{
DDRB = 0xff;
lcd_init();
lcd_write(here, "t", 0);
/* Replace with your application code */
while (1)
{