326 lines
11 KiB
Text
326 lines
11 KiB
Text
|
|
AtTiny_alarm_clock.elf: file format elf32-avr
|
|
|
|
Sections:
|
|
Idx Name Size VMA LMA File off Algn
|
|
0 .text 0000014c 00000000 00000000 00000054 2**1
|
|
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
|
1 .data 00000000 00800060 00800060 000001a0 2**0
|
|
CONTENTS, ALLOC, LOAD, DATA
|
|
2 .comment 00000030 00000000 00000000 000001a0 2**0
|
|
CONTENTS, READONLY
|
|
3 .note.gnu.avr.deviceinfo 00000040 00000000 00000000 000001d0 2**2
|
|
CONTENTS, READONLY
|
|
4 .debug_aranges 00000088 00000000 00000000 00000210 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
5 .debug_info 00000915 00000000 00000000 00000298 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
6 .debug_abbrev 00000631 00000000 00000000 00000bad 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
7 .debug_line 00000517 00000000 00000000 000011de 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
8 .debug_frame 000000f4 00000000 00000000 000016f8 2**2
|
|
CONTENTS, READONLY, DEBUGGING
|
|
9 .debug_str 0000035c 00000000 00000000 000017ec 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
10 .debug_loc 0000028c 00000000 00000000 00001b48 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
11 .debug_ranges 00000058 00000000 00000000 00001dd4 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>
|
|
|
|
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: 80 d0 rcall .+256 ; 0x134 <main>
|
|
34: 89 c0 rjmp .+274 ; 0x148 <_exit>
|
|
|
|
00000036 <__bad_interrupt>:
|
|
36: e4 cf rjmp .-56 ; 0x0 <__vectors>
|
|
|
|
00000038 <lcd_5ms>:
|
|
|
|
void lcd_1s(void){
|
|
for(uint8_t i=200;i>0;i--){
|
|
lcd_5ms();
|
|
}
|
|
}
|
|
38: cf 93 push r28
|
|
3a: c2 e3 ldi r28, 0x32 ; 50
|
|
3c: 62 d0 rcall .+196 ; 0x102 <wait_100us>
|
|
3e: c1 50 subi r28, 0x01 ; 1
|
|
40: e9 f7 brne .-6 ; 0x3c <lcd_5ms+0x4>
|
|
42: cf 91 pop r28
|
|
44: 08 95 ret
|
|
|
|
00000046 <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){
|
|
46: cf 93 push r28
|
|
48: c6 2f mov r28, r22
|
|
switch (lcd_whichwrite){
|
|
4a: 84 30 cpi r24, 0x04 ; 4
|
|
4c: 38 f4 brcc .+14 ; 0x5c <lcd_write+0x16>
|
|
4e: 82 30 cpi r24, 0x02 ; 2
|
|
50: 48 f4 brcc .+18 ; 0x64 <lcd_write+0x1e>
|
|
52: 88 23 and r24, r24
|
|
54: 71 f0 breq .+28 ; 0x72 <lcd_write+0x2c>
|
|
56: 81 30 cpi r24, 0x01 ; 1
|
|
58: 49 f0 breq .+18 ; 0x6c <lcd_write+0x26>
|
|
5a: 0c c0 rjmp .+24 ; 0x74 <lcd_write+0x2e>
|
|
5c: 84 30 cpi r24, 0x04 ; 4
|
|
5e: 51 f4 brne .+20 ; 0x74 <lcd_write+0x2e>
|
|
case instruct :
|
|
unset_lcd_RS;
|
|
60: 93 98 cbi 0x12, 3 ; 18
|
|
break;
|
|
62: 08 c0 rjmp .+16 ; 0x74 <lcd_write+0x2e>
|
|
case line2:
|
|
case line1:
|
|
position = position & 0x3f;
|
|
64: 4f 73 andi r20, 0x3F ; 63
|
|
if (lcd_whichwrite == line2){ position=position + 0x40; };
|
|
66: 83 30 cpi r24, 0x03 ; 3
|
|
68: 09 f4 brne .+2 ; 0x6c <lcd_write+0x26>
|
|
6a: 40 5c subi r20, 0xC0 ; 192
|
|
case therepos:
|
|
lcd_instruct(lcd_mask_Write_Adress(position));
|
|
6c: 84 2f mov r24, r20
|
|
6e: 80 68 ori r24, 0x80 ; 128
|
|
70: 24 d0 rcall .+72 ; 0xba <lcd_instruct>
|
|
case here:
|
|
set_lcd_RS;
|
|
72: 93 9a sbi 0x12, 3 ; 18
|
|
break;
|
|
|
|
|
|
}
|
|
set_lcd_E;
|
|
74: 92 9a sbi 0x12, 2 ; 18
|
|
set_lcd_E;
|
|
76: 92 9a sbi 0x12, 2 ; 18
|
|
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
|
|
78: 98 b3 in r25, 0x18 ; 24
|
|
7a: 9f 70 andi r25, 0x0F ; 15
|
|
7c: 8c 2f mov r24, r28
|
|
7e: 80 7f andi r24, 0xF0 ; 240
|
|
80: 98 2b or r25, r24
|
|
82: 98 bb out 0x18, r25 ; 24
|
|
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
|
|
84: 98 b3 in r25, 0x18 ; 24
|
|
86: 9f 70 andi r25, 0x0F ; 15
|
|
88: 89 2b or r24, r25
|
|
8a: 88 bb out 0x18, r24 ; 24
|
|
unset_lcd_E;
|
|
8c: 92 98 cbi 0x12, 2 ; 18
|
|
unset_lcd_E;
|
|
8e: 92 98 cbi 0x12, 2 ; 18
|
|
wait_100us();
|
|
90: 38 d0 rcall .+112 ; 0x102 <wait_100us>
|
|
if (lcd_dataport_DDR==0xf0){
|
|
92: 87 b3 in r24, 0x17 ; 23
|
|
94: 80 3f cpi r24, 0xF0 ; 240
|
|
96: 79 f4 brne .+30 ; 0xb6 <lcd_write+0x70>
|
|
zeichen=zeichen << 4;
|
|
set_lcd_E;
|
|
98: 92 9a sbi 0x12, 2 ; 18
|
|
set_lcd_E;
|
|
9a: 92 9a sbi 0x12, 2 ; 18
|
|
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
|
|
9c: 88 b3 in r24, 0x18 ; 24
|
|
9e: c2 95 swap r28
|
|
a0: c0 7f andi r28, 0xF0 ; 240
|
|
a2: 8f 70 andi r24, 0x0F ; 15
|
|
a4: 8c 2b or r24, r28
|
|
a6: 88 bb out 0x18, r24 ; 24
|
|
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
|
|
a8: 88 b3 in r24, 0x18 ; 24
|
|
aa: 8f 70 andi r24, 0x0F ; 15
|
|
ac: c8 2b or r28, r24
|
|
ae: c8 bb out 0x18, r28 ; 24
|
|
unset_lcd_E;
|
|
b0: 92 98 cbi 0x12, 2 ; 18
|
|
unset_lcd_E;
|
|
b2: 92 98 cbi 0x12, 2 ; 18
|
|
wait_100us();
|
|
b4: 26 d0 rcall .+76 ; 0x102 <wait_100us>
|
|
}
|
|
}
|
|
b6: cf 91 pop r28
|
|
b8: 08 95 ret
|
|
|
|
000000ba <lcd_instruct>:
|
|
lcd_5ms();
|
|
}
|
|
}
|
|
|
|
void lcd_instruct(uint8_t zeichen){
|
|
lcd_write(instruct,zeichen,0);
|
|
ba: 40 e0 ldi r20, 0x00 ; 0
|
|
bc: 68 2f mov r22, r24
|
|
be: 84 e0 ldi r24, 0x04 ; 4
|
|
c0: c2 df rcall .-124 ; 0x46 <lcd_write>
|
|
c2: 08 95 ret
|
|
|
|
000000c4 <lcd_init>:
|
|
|
|
|
|
|
|
void lcd_init(void){
|
|
/* setting up ports first */
|
|
lcd_dataport_DDR=0xff;
|
|
c4: 8f ef ldi r24, 0xFF ; 255
|
|
c6: 87 bb out 0x17, r24 ; 23
|
|
set_lcd_RS_DDR;
|
|
c8: 8b 9a sbi 0x11, 3 ; 17
|
|
set_lcd_E_DDR;
|
|
ca: 8a 9a sbi 0x11, 2 ; 17
|
|
/* end setting up ports */
|
|
lcd_dataport=0xff;
|
|
cc: 88 bb out 0x18, r24 ; 24
|
|
set_lcd_RS;
|
|
ce: 93 9a sbi 0x12, 3 ; 18
|
|
set_lcd_E;
|
|
d0: 92 9a sbi 0x12, 2 ; 18
|
|
lcd_5ms();
|
|
d2: b2 df rcall .-156 ; 0x38 <lcd_5ms>
|
|
lcd_5ms();
|
|
d4: b1 df rcall .-158 ; 0x38 <lcd_5ms>
|
|
lcd_5ms();
|
|
d6: b0 df rcall .-160 ; 0x38 <lcd_5ms>
|
|
lcd_instruct(lcd_SET_FUNCTION_8BIT);
|
|
d8: 80 e3 ldi r24, 0x30 ; 48
|
|
da: ef df rcall .-34 ; 0xba <lcd_instruct>
|
|
lcd_5ms();
|
|
dc: ad df rcall .-166 ; 0x38 <lcd_5ms>
|
|
lcd_instruct(lcd_SET_FUNCTION_8BIT);
|
|
de: 80 e3 ldi r24, 0x30 ; 48
|
|
e0: ec df rcall .-40 ; 0xba <lcd_instruct>
|
|
wait_100us();
|
|
e2: 0f d0 rcall .+30 ; 0x102 <wait_100us>
|
|
lcd_instruct(lcd_SET_FUNCTION_8BIT);
|
|
e4: 80 e3 ldi r24, 0x30 ; 48
|
|
e6: e9 df rcall .-46 ; 0xba <lcd_instruct>
|
|
if (lcd_dataport_mask==0xf0){
|
|
lcd_instruct(lcd_SET_FUNCTION_4BIT|lcd_SET_FUNCTION_2LINE|lcd_SET_FUNCTION_7X5);
|
|
e8: 88 e2 ldi r24, 0x28 ; 40
|
|
ea: e7 df rcall .-50 ; 0xba <lcd_instruct>
|
|
}else{
|
|
lcd_instruct(lcd_SET_FUNCTION_8BIT|lcd_SET_FUNCTION_2LINE|lcd_SET_FUNCTION_7X5);
|
|
}
|
|
lcd_dataport_DDR&=lcd_dataport_mask;
|
|
ec: 87 b3 in r24, 0x17 ; 23
|
|
ee: 80 7f andi r24, 0xF0 ; 240
|
|
f0: 87 bb out 0x17, r24 ; 23
|
|
lcd_instruct(lcd_DISPLAY_OO_ON|lcd_DISPLAY_OO_CURSOR_OFF);
|
|
f2: 8c e0 ldi r24, 0x0C ; 12
|
|
f4: e2 df rcall .-60 ; 0xba <lcd_instruct>
|
|
lcd_instruct(lcd_ENTRY_MODE_SET|lcd_ENTRY_MODE_SET_INCREASE | lcd_ENTRY_MS_DISPLAY_NOT_S);
|
|
f6: 86 e0 ldi r24, 0x06 ; 6
|
|
f8: e0 df rcall .-64 ; 0xba <lcd_instruct>
|
|
lcd_instruct(lcd_RETURN_HOME);
|
|
fa: 82 e0 ldi r24, 0x02 ; 2
|
|
fc: de df rcall .-68 ; 0xba <lcd_instruct>
|
|
lcd_5ms();
|
|
fe: 9c df rcall .-200 ; 0x38 <lcd_5ms>
|
|
100: 08 95 ret
|
|
|
|
00000102 <wait_100us>:
|
|
#include <inttypes.h>
|
|
#include <avr/io.h>
|
|
#include "lcd4.h"
|
|
|
|
void wait_100us(void){
|
|
102: cf 93 push r28
|
|
104: df 93 push r29
|
|
106: 1f 92 push r1
|
|
108: cd b7 in r28, 0x3d ; 61
|
|
10a: dd 27 eor r29, r29
|
|
for (volatile uint8_t i=68;i--;i>0){
|
|
10c: 84 e4 ldi r24, 0x44 ; 68
|
|
10e: 89 83 std Y+1, r24 ; 0x01
|
|
110: 89 81 ldd r24, Y+1 ; 0x01
|
|
112: 9f ef ldi r25, 0xFF ; 255
|
|
114: 98 0f add r25, r24
|
|
116: 99 83 std Y+1, r25 ; 0x01
|
|
118: 88 23 and r24, r24
|
|
11a: 41 f0 breq .+16 ; 0x12c <wait_100us+0x2a>
|
|
i;
|
|
11c: 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){
|
|
11e: 89 81 ldd r24, Y+1 ; 0x01
|
|
120: 89 81 ldd r24, Y+1 ; 0x01
|
|
122: 9f ef ldi r25, 0xFF ; 255
|
|
124: 98 0f add r25, r24
|
|
126: 99 83 std Y+1, r25 ; 0x01
|
|
128: 81 11 cpse r24, r1
|
|
12a: f8 cf rjmp .-16 ; 0x11c <wait_100us+0x1a>
|
|
i;
|
|
}
|
|
}
|
|
12c: 0f 90 pop r0
|
|
12e: df 91 pop r29
|
|
130: cf 91 pop r28
|
|
132: 08 95 ret
|
|
|
|
00000134 <main>:
|
|
#include "lcd4.h"
|
|
|
|
|
|
int main(void)
|
|
{
|
|
DDRB = 0xff;
|
|
134: 8f ef ldi r24, 0xFF ; 255
|
|
136: 87 bb out 0x17, r24 ; 23
|
|
PORTB = 0xAA;
|
|
138: 8a ea ldi r24, 0xAA ; 170
|
|
13a: 88 bb out 0x18, r24 ; 24
|
|
lcd_init();
|
|
13c: c3 df rcall .-122 ; 0xc4 <lcd_init>
|
|
lcd_write(here, 0x41, 0);
|
|
13e: 40 e0 ldi r20, 0x00 ; 0
|
|
140: 61 e4 ldi r22, 0x41 ; 65
|
|
142: 80 e0 ldi r24, 0x00 ; 0
|
|
144: 80 df rcall .-256 ; 0x46 <lcd_write>
|
|
146: ff cf rjmp .-2 ; 0x146 <main+0x12>
|
|
|
|
00000148 <_exit>:
|
|
148: f8 94 cli
|
|
|
|
0000014a <__stop_program>:
|
|
14a: ff cf rjmp .-2 ; 0x14a <__stop_program>
|