This repository has been archived on 2022-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
AtTiny_alarm_clock/Debug/AtTiny_alarm_clock.lss

514 lines
16 KiB
Text

AtTiny_alarm_clock.elf: file format elf32-avr
Sections:
Idx Name Size VMA LMA File off Algn
0 .text 0000023e 00000000 00000000 00000094 2**1
CONTENTS, ALLOC, LOAD, READONLY, CODE
1 .data 00000012 00800060 0000023e 000002d2 2**0
CONTENTS, ALLOC, LOAD, DATA
2 .bss 00000006 00800072 00800072 000002e4 2**0
ALLOC
3 .comment 00000030 00000000 00000000 000002e4 2**0
CONTENTS, READONLY
4 .note.gnu.avr.deviceinfo 00000040 00000000 00000000 00000314 2**2
CONTENTS, READONLY
5 .debug_aranges 00000090 00000000 00000000 00000354 2**0
CONTENTS, READONLY, DEBUGGING
6 .debug_info 00000a9b 00000000 00000000 000003e4 2**0
CONTENTS, READONLY, DEBUGGING
7 .debug_abbrev 000006f0 00000000 00000000 00000e7f 2**0
CONTENTS, READONLY, DEBUGGING
8 .debug_line 0000059a 00000000 00000000 0000156f 2**0
CONTENTS, READONLY, DEBUGGING
9 .debug_frame 00000120 00000000 00000000 00001b0c 2**2
CONTENTS, READONLY, DEBUGGING
10 .debug_str 00000446 00000000 00000000 00001c2c 2**0
CONTENTS, READONLY, DEBUGGING
11 .debug_loc 000003bb 00000000 00000000 00002072 2**0
CONTENTS, READONLY, DEBUGGING
12 .debug_ranges 00000078 00000000 00000000 0000242d 2**0
CONTENTS, READONLY, DEBUGGING
Disassembly of section .text:
00000000 <__vectors>:
0: 14 c0 rjmp .+40 ; 0x2a <__ctors_end>
2: 2c c0 rjmp .+88 ; 0x5c <__bad_interrupt>
4: 2b c0 rjmp .+86 ; 0x5c <__bad_interrupt>
6: 2a c0 rjmp .+84 ; 0x5c <__bad_interrupt>
8: 29 c0 rjmp .+82 ; 0x5c <__bad_interrupt>
a: 28 c0 rjmp .+80 ; 0x5c <__bad_interrupt>
c: 27 c0 rjmp .+78 ; 0x5c <__bad_interrupt>
e: 26 c0 rjmp .+76 ; 0x5c <__bad_interrupt>
10: 25 c0 rjmp .+74 ; 0x5c <__bad_interrupt>
12: 24 c0 rjmp .+72 ; 0x5c <__bad_interrupt>
14: 23 c0 rjmp .+70 ; 0x5c <__bad_interrupt>
16: 22 c0 rjmp .+68 ; 0x5c <__bad_interrupt>
18: 21 c0 rjmp .+66 ; 0x5c <__bad_interrupt>
1a: 20 c0 rjmp .+64 ; 0x5c <__bad_interrupt>
1c: 1f c0 rjmp .+62 ; 0x5c <__bad_interrupt>
1e: 1e c0 rjmp .+60 ; 0x5c <__bad_interrupt>
20: 1d c0 rjmp .+58 ; 0x5c <__bad_interrupt>
22: 1c c0 rjmp .+56 ; 0x5c <__bad_interrupt>
24: 1b c0 rjmp .+54 ; 0x5c <__bad_interrupt>
26: 1a c0 rjmp .+52 ; 0x5c <__bad_interrupt>
28: 19 c0 rjmp .+50 ; 0x5c <__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: ee e3 ldi r30, 0x3E ; 62
3a: f2 e0 ldi r31, 0x02 ; 2
3c: 02 c0 rjmp .+4 ; 0x42 <__SREG__+0x3>
3e: 05 90 lpm r0, Z+
40: 0d 92 st X+, r0
42: a2 37 cpi r26, 0x72 ; 114
44: b1 07 cpc r27, r17
46: d9 f7 brne .-10 ; 0x3e <__SP_L__+0x1>
00000048 <__do_clear_bss>:
48: 20 e0 ldi r18, 0x00 ; 0
4a: a2 e7 ldi r26, 0x72 ; 114
4c: b0 e0 ldi r27, 0x00 ; 0
4e: 01 c0 rjmp .+2 ; 0x52 <.do_clear_bss_start>
00000050 <.do_clear_bss_loop>:
50: 1d 92 st X+, r1
00000052 <.do_clear_bss_start>:
52: a8 37 cpi r26, 0x78 ; 120
54: b2 07 cpc r27, r18
56: e1 f7 brne .-8 ; 0x50 <.do_clear_bss_loop>
58: ae d0 rcall .+348 ; 0x1b6 <main>
5a: ef c0 rjmp .+478 ; 0x23a <_exit>
0000005c <__bad_interrupt>:
5c: d1 cf rjmp .-94 ; 0x0 <__vectors>
0000005e <lcd_5ms>:
void lcd_1s(void){
for(uint8_t i=200;i>0;i--){
lcd_5ms();
}
}
5e: cf 93 push r28
60: c2 e3 ldi r28, 0x32 ; 50
62: 62 d0 rcall .+196 ; 0x128 <wait_100us>
64: c1 50 subi r28, 0x01 ; 1
66: e9 f7 brne .-6 ; 0x62 <lcd_5ms+0x4>
68: cf 91 pop r28
6a: 08 95 ret
0000006c <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){
6c: cf 93 push r28
6e: c6 2f mov r28, r22
switch (lcd_whichwrite){
70: 84 30 cpi r24, 0x04 ; 4
72: 38 f4 brcc .+14 ; 0x82 <lcd_write+0x16>
74: 82 30 cpi r24, 0x02 ; 2
76: 48 f4 brcc .+18 ; 0x8a <lcd_write+0x1e>
78: 88 23 and r24, r24
7a: 71 f0 breq .+28 ; 0x98 <lcd_write+0x2c>
7c: 81 30 cpi r24, 0x01 ; 1
7e: 49 f0 breq .+18 ; 0x92 <lcd_write+0x26>
80: 0c c0 rjmp .+24 ; 0x9a <lcd_write+0x2e>
82: 84 30 cpi r24, 0x04 ; 4
84: 51 f4 brne .+20 ; 0x9a <lcd_write+0x2e>
case instruct :
unset_lcd_RS;
86: 93 98 cbi 0x12, 3 ; 18
break;
88: 08 c0 rjmp .+16 ; 0x9a <lcd_write+0x2e>
case line2:
case line1:
position = position & 0x3f;
8a: 4f 73 andi r20, 0x3F ; 63
if (lcd_whichwrite == line2){ position=position + 0x40; };
8c: 83 30 cpi r24, 0x03 ; 3
8e: 09 f4 brne .+2 ; 0x92 <lcd_write+0x26>
90: 40 5c subi r20, 0xC0 ; 192
case therepos:
lcd_instruct(lcd_mask_Write_Adress(position));
92: 84 2f mov r24, r20
94: 80 68 ori r24, 0x80 ; 128
96: 24 d0 rcall .+72 ; 0xe0 <lcd_instruct>
case here:
set_lcd_RS;
98: 93 9a sbi 0x12, 3 ; 18
break;
}
set_lcd_E;
9a: 92 9a sbi 0x12, 2 ; 18
set_lcd_E;
9c: 92 9a sbi 0x12, 2 ; 18
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
9e: 98 b3 in r25, 0x18 ; 24
a0: 9f 70 andi r25, 0x0F ; 15
a2: 8c 2f mov r24, r28
a4: 80 7f andi r24, 0xF0 ; 240
a6: 98 2b or r25, r24
a8: 98 bb out 0x18, r25 ; 24
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
aa: 98 b3 in r25, 0x18 ; 24
ac: 9f 70 andi r25, 0x0F ; 15
ae: 89 2b or r24, r25
b0: 88 bb out 0x18, r24 ; 24
unset_lcd_E;
b2: 92 98 cbi 0x12, 2 ; 18
unset_lcd_E;
b4: 92 98 cbi 0x12, 2 ; 18
wait_100us();
b6: 38 d0 rcall .+112 ; 0x128 <wait_100us>
if (lcd_dataport_DDR==0xf0){
b8: 87 b3 in r24, 0x17 ; 23
ba: 80 3f cpi r24, 0xF0 ; 240
bc: 79 f4 brne .+30 ; 0xdc <lcd_write+0x70>
zeichen=zeichen << 4;
set_lcd_E;
be: 92 9a sbi 0x12, 2 ; 18
set_lcd_E;
c0: 92 9a sbi 0x12, 2 ; 18
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
c2: 88 b3 in r24, 0x18 ; 24
c4: c2 95 swap r28
c6: c0 7f andi r28, 0xF0 ; 240
c8: 8f 70 andi r24, 0x0F ; 15
ca: 8c 2b or r24, r28
cc: 88 bb out 0x18, r24 ; 24
lcd_dataport=lcd_dataport&~lcd_dataport_mask|zeichen&lcd_dataport_mask;
ce: 88 b3 in r24, 0x18 ; 24
d0: 8f 70 andi r24, 0x0F ; 15
d2: c8 2b or r28, r24
d4: c8 bb out 0x18, r28 ; 24
unset_lcd_E;
d6: 92 98 cbi 0x12, 2 ; 18
unset_lcd_E;
d8: 92 98 cbi 0x12, 2 ; 18
wait_100us();
da: 26 d0 rcall .+76 ; 0x128 <wait_100us>
}
}
dc: cf 91 pop r28
de: 08 95 ret
000000e0 <lcd_instruct>:
lcd_5ms();
}
}
void lcd_instruct(uint8_t zeichen){
lcd_write(instruct,zeichen,0);
e0: 40 e0 ldi r20, 0x00 ; 0
e2: 68 2f mov r22, r24
e4: 84 e0 ldi r24, 0x04 ; 4
e6: c2 df rcall .-124 ; 0x6c <lcd_write>
e8: 08 95 ret
000000ea <lcd_init>:
void lcd_init(void){
/* setting up ports first */
lcd_dataport_DDR=0xff;
ea: 8f ef ldi r24, 0xFF ; 255
ec: 87 bb out 0x17, r24 ; 23
set_lcd_RS_DDR;
ee: 8b 9a sbi 0x11, 3 ; 17
set_lcd_E_DDR;
f0: 8a 9a sbi 0x11, 2 ; 17
/* end setting up ports */
lcd_dataport=0xff;
f2: 88 bb out 0x18, r24 ; 24
set_lcd_RS;
f4: 93 9a sbi 0x12, 3 ; 18
set_lcd_E;
f6: 92 9a sbi 0x12, 2 ; 18
lcd_5ms();
f8: b2 df rcall .-156 ; 0x5e <lcd_5ms>
lcd_5ms();
fa: b1 df rcall .-158 ; 0x5e <lcd_5ms>
lcd_5ms();
fc: b0 df rcall .-160 ; 0x5e <lcd_5ms>
lcd_instruct(lcd_SET_FUNCTION_8BIT);
fe: 80 e3 ldi r24, 0x30 ; 48
100: ef df rcall .-34 ; 0xe0 <lcd_instruct>
lcd_5ms();
102: ad df rcall .-166 ; 0x5e <lcd_5ms>
lcd_instruct(lcd_SET_FUNCTION_8BIT);
104: 80 e3 ldi r24, 0x30 ; 48
106: ec df rcall .-40 ; 0xe0 <lcd_instruct>
wait_100us();
108: 0f d0 rcall .+30 ; 0x128 <wait_100us>
lcd_instruct(lcd_SET_FUNCTION_8BIT);
10a: 80 e3 ldi r24, 0x30 ; 48
10c: e9 df rcall .-46 ; 0xe0 <lcd_instruct>
if (lcd_dataport_mask==0xf0){
lcd_instruct(lcd_SET_FUNCTION_4BIT|lcd_SET_FUNCTION_2LINE|lcd_SET_FUNCTION_7X5);
10e: 88 e2 ldi r24, 0x28 ; 40
110: e7 df rcall .-50 ; 0xe0 <lcd_instruct>
}else{
lcd_instruct(lcd_SET_FUNCTION_8BIT|lcd_SET_FUNCTION_2LINE|lcd_SET_FUNCTION_7X5);
}
lcd_dataport_DDR&=lcd_dataport_mask;
112: 87 b3 in r24, 0x17 ; 23
114: 80 7f andi r24, 0xF0 ; 240
116: 87 bb out 0x17, r24 ; 23
lcd_instruct(lcd_DISPLAY_OO_ON|lcd_DISPLAY_OO_CURSOR_OFF);
118: 8c e0 ldi r24, 0x0C ; 12
11a: e2 df rcall .-60 ; 0xe0 <lcd_instruct>
lcd_instruct(lcd_ENTRY_MODE_SET|lcd_ENTRY_MODE_SET_INCREASE | lcd_ENTRY_MS_DISPLAY_NOT_S);
11c: 86 e0 ldi r24, 0x06 ; 6
11e: e0 df rcall .-64 ; 0xe0 <lcd_instruct>
lcd_instruct(lcd_RETURN_HOME);
120: 82 e0 ldi r24, 0x02 ; 2
122: de df rcall .-68 ; 0xe0 <lcd_instruct>
lcd_5ms();
124: 9c df rcall .-200 ; 0x5e <lcd_5ms>
126: 08 95 ret
00000128 <wait_100us>:
#include <inttypes.h>
#include <avr/io.h>
#include "lcd4.h"
void wait_100us(void){
128: cf 93 push r28
12a: df 93 push r29
12c: 1f 92 push r1
12e: cd b7 in r28, 0x3d ; 61
130: dd 27 eor r29, r29
for (volatile uint8_t i=68;i--;i>0){
132: 84 e4 ldi r24, 0x44 ; 68
134: 89 83 std Y+1, r24 ; 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: 88 23 and r24, r24
140: 41 f0 breq .+16 ; 0x152 <wait_100us+0x2a>
i;
142: 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){
144: 89 81 ldd r24, Y+1 ; 0x01
146: 89 81 ldd r24, Y+1 ; 0x01
148: 9f ef ldi r25, 0xFF ; 255
14a: 98 0f add r25, r24
14c: 99 83 std Y+1, r25 ; 0x01
14e: 81 11 cpse r24, r1
150: f8 cf rjmp .-16 ; 0x142 <wait_100us+0x1a>
i;
}
}
152: 0f 90 pop r0
154: df 91 pop r29
156: cf 91 pop r28
158: 08 95 ret
0000015a <lcd_write_text>:
}
}
}
void lcd_write_text(int row, int col, uint8_t text[16])
{
15a: ef 92 push r14
15c: ff 92 push r15
15e: 0f 93 push r16
160: 1f 93 push r17
162: cf 93 push r28
164: 7c 01 movw r14, r24
switch(row){
166: 89 2b or r24, r25
168: 29 f0 breq .+10 ; 0x174 <lcd_write_text+0x1a>
16a: 81 e0 ldi r24, 0x01 ; 1
16c: e8 16 cp r14, r24
16e: f1 04 cpc r15, r1
170: 31 f0 breq .+12 ; 0x17e <lcd_write_text+0x24>
172: 0a c0 rjmp .+20 ; 0x188 <lcd_write_text+0x2e>
case 0:
row = line1;
174: 68 94 set
176: ee 24 eor r14, r14
178: e1 f8 bld r14, 1
17a: f1 2c mov r15, r1
17c: 05 c0 rjmp .+10 ; 0x188 <lcd_write_text+0x2e>
break;
case 1:
row = line2;
17e: 0f 2e mov r0, r31
180: f3 e0 ldi r31, 0x03 ; 3
182: ef 2e mov r14, r31
184: f1 2c mov r15, r1
186: f0 2d mov r31, r0
break;
}
int i=0;
while(text[i] != 0x5F){
188: fa 01 movw r30, r20
18a: 60 81 ld r22, Z
18c: 6f 35 cpi r22, 0x5F ; 95
18e: 69 f0 breq .+26 ; 0x1aa <lcd_write_text+0x50>
190: 8a 01 movw r16, r20
192: 0f 5f subi r16, 0xFF ; 255
194: 1f 4f sbci r17, 0xFF ; 255
196: c0 e0 ldi r28, 0x00 ; 0
lcd_write(row, text[i], 0+i);
198: 4c 2f mov r20, r28
19a: 8e 2d mov r24, r14
19c: 67 df rcall .-306 ; 0x6c <lcd_write>
case 1:
row = line2;
break;
}
int i=0;
while(text[i] != 0x5F){
19e: f8 01 movw r30, r16
1a0: 61 91 ld r22, Z+
1a2: 8f 01 movw r16, r30
1a4: cf 5f subi r28, 0xFF ; 255
1a6: 6f 35 cpi r22, 0x5F ; 95
1a8: b9 f7 brne .-18 ; 0x198 <lcd_write_text+0x3e>
lcd_write(row, text[i], 0+i);
i++;
}
}
1aa: cf 91 pop r28
1ac: 1f 91 pop r17
1ae: 0f 91 pop r16
1b0: ff 90 pop r15
1b2: ef 90 pop r14
1b4: 08 95 ret
000001b6 <main>:
uint8_t flags;
int main(void)
{
DDRD = 0x00;
1b6: 11 ba out 0x11, r1 ; 17
flags &= ~(1<<butt1);
}
}
t1[0] = counter + 48;
1b8: c2 e7 ldi r28, 0x72 ; 114
1ba: d0 e0 ldi r29, 0x00 ; 0
/* Replace with your application code */
while (1)
{
clock_state = clock_new_state;
1bc: 80 91 74 00 lds r24, 0x0074 ; 0x800074 <clock_new_state>
switch(clock_state){
1c0: 88 23 and r24, r24
1c2: 19 f0 breq .+6 ; 0x1ca <main+0x14>
1c4: 81 30 cpi r24, 0x01 ; 1
1c6: 51 f0 breq .+20 ; 0x1dc <main+0x26>
1c8: fb cf rjmp .-10 ; 0x1c0 <main+0xa>
1ca: 10 92 75 00 sts 0x0075, r1 ; 0x800075 <clock_state>
case CLOCK_INIT:
//do some init stuff...
lcd_init(); //I know, it's just c but I don't care
1ce: 8d df rcall .-230 ; 0xea <lcd_init>
lcd_instruct(lcd_DISPLAY_CLEAR);
1d0: 81 e0 ldi r24, 0x01 ; 1
1d2: 86 df rcall .-244 ; 0xe0 <lcd_instruct>
//INIT done -> change to IDLE
clock_new_state = CLOCK_IDLE;
1d4: 81 e0 ldi r24, 0x01 ; 1
1d6: 80 93 74 00 sts 0x0074, r24 ; 0x800074 <clock_new_state>
break;
1da: f0 cf rjmp .-32 ; 0x1bc <main+0x6>
1dc: 81 e0 ldi r24, 0x01 ; 1
1de: 80 93 75 00 sts 0x0075, r24 ; 0x800075 <clock_state>
case CLOCK_IDLE:
//IDLE MODE
//print the IDLE Screen
lcd_write_text(0,0,t1);
1e2: 40 e6 ldi r20, 0x60 ; 96
1e4: 50 e0 ldi r21, 0x00 ; 0
1e6: 60 e0 ldi r22, 0x00 ; 0
1e8: 70 e0 ldi r23, 0x00 ; 0
1ea: 80 e0 ldi r24, 0x00 ; 0
1ec: 90 e0 ldi r25, 0x00 ; 0
1ee: b5 df rcall .-150 ; 0x15a <lcd_write_text>
if(((PIND & 0x03) == 3) != (flags & 1<<butt1)){
1f0: 90 b3 in r25, 0x10 ; 16
1f2: 80 91 77 00 lds r24, 0x0077 ; 0x800077 <flags>
1f6: 93 70 andi r25, 0x03 ; 3
1f8: 21 e0 ldi r18, 0x01 ; 1
1fa: 93 30 cpi r25, 0x03 ; 3
1fc: 09 f0 breq .+2 ; 0x200 <main+0x4a>
1fe: 20 e0 ldi r18, 0x00 ; 0
200: 98 2f mov r25, r24
202: 91 70 andi r25, 0x01 ; 1
204: 29 17 cp r18, r25
206: a1 f0 breq .+40 ; 0x230 <main+0x7a>
if((PIND & 0x03) == 3){
208: 90 b3 in r25, 0x10 ; 16
20a: 93 70 andi r25, 0x03 ; 3
20c: 93 30 cpi r25, 0x03 ; 3
20e: 69 f4 brne .+26 ; 0x22a <main+0x74>
flags |= 1<<butt1;
210: 81 60 ori r24, 0x01 ; 1
212: 80 93 77 00 sts 0x0077, r24 ; 0x800077 <flags>
counter++;
216: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__data_end>
21a: 90 91 73 00 lds r25, 0x0073 ; 0x800073 <__data_end+0x1>
21e: 01 96 adiw r24, 0x01 ; 1
220: 90 93 73 00 sts 0x0073, r25 ; 0x800073 <__data_end+0x1>
224: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__data_end>
228: 03 c0 rjmp .+6 ; 0x230 <main+0x7a>
}
else{
flags &= ~(1<<butt1);
22a: 8e 7f andi r24, 0xFE ; 254
22c: 80 93 77 00 sts 0x0077, r24 ; 0x800077 <flags>
}
}
t1[0] = counter + 48;
230: 88 81 ld r24, Y
232: 80 5d subi r24, 0xD0 ; 208
234: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__data_start>
break;
238: c1 cf rjmp .-126 ; 0x1bc <main+0x6>
0000023a <_exit>:
23a: f8 94 cli
0000023c <__stop_program>:
23c: ff cf rjmp .-2 ; 0x23c <__stop_program>