343 lines
11 KiB
Text
343 lines
11 KiB
Text
|
|
AtTiny_alarm_clock.elf: file format elf32-avr
|
|
|
|
Sections:
|
|
Idx Name Size VMA LMA File off Algn
|
|
0 .text 00000164 00000000 00000000 00000074 2**1
|
|
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
|
1 .data 00000002 00800060 00000164 000001d8 2**0
|
|
CONTENTS, ALLOC, LOAD, DATA
|
|
2 .comment 00000030 00000000 00000000 000001da 2**0
|
|
CONTENTS, READONLY
|
|
3 .note.gnu.avr.deviceinfo 00000040 00000000 00000000 0000020c 2**2
|
|
CONTENTS, READONLY
|
|
4 .debug_aranges 00000088 00000000 00000000 0000024c 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
5 .debug_info 0000090f 00000000 00000000 000002d4 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
6 .debug_abbrev 00000631 00000000 00000000 00000be3 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
7 .debug_line 00000522 00000000 00000000 00001214 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
8 .debug_frame 000000f4 00000000 00000000 00001738 2**2
|
|
CONTENTS, READONLY, DEBUGGING
|
|
9 .debug_str 0000035c 00000000 00000000 0000182c 2**0
|
|
CONTENTS, READONLY, DEBUGGING
|
|
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: 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
|
|
|
|
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>
|
|
|
|
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;
|
|
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;
|
|
15a: 8a ea ldi r24, 0xAA ; 170
|
|
15c: 88 bb out 0x18, r24 ; 24
|
|
15e: fe cf rjmp .-4 ; 0x15c <main+0x12>
|
|
|
|
00000160 <_exit>:
|
|
160: f8 94 cli
|
|
|
|
00000162 <__stop_program>:
|
|
162: ff cf rjmp .-2 ; 0x162 <__stop_program>
|