From a46a8eb5e949836ac40796a601aed3d01511779c Mon Sep 17 00:00:00 2001 From: Dorian Zedler Date: Sun, 5 Aug 2018 20:58:04 +0200 Subject: [PATCH] tried to add some screens but the display is not working correctly --- .vs/AtTiny_alarm_clock/v14/.atsuo | Bin 35840 -> 27136 bytes Debug/AtTiny_alarm_clock.elf | Bin 13672 -> 14532 bytes Debug/AtTiny_alarm_clock.hex | 69 ++-- Debug/AtTiny_alarm_clock.lss | 506 +++++++++++++++++++----------- Debug/AtTiny_alarm_clock.map | 103 +++--- Debug/AtTiny_alarm_clock.srec | 69 ++-- Debug/main.o | Bin 9376 -> 11492 bytes main.c | 52 ++- 8 files changed, 511 insertions(+), 288 deletions(-) diff --git a/.vs/AtTiny_alarm_clock/v14/.atsuo b/.vs/AtTiny_alarm_clock/v14/.atsuo index 8512f01be15173b1b1c16e4f40503cdb1a3ebc3f..813b4ecbb725f898dec2483cc2027d9274c0e745 100644 GIT binary patch delta 1262 zcmb`GUr1AN6vyxH?%wUX?#w&qpW3Qx*_w0ynL#X@WhK+FoT6by(RvE3Bw<3Upy5Lj zMC1-Z`C=@BdMVhYhX_K_2O}d0U!sR1=qYLy*9Tu*=WM$+Bq^c`pZ$Knv-3N@-}jvJ zi{Iko^Xx|B2A<1*B^)QelJ9%(=t5kJy|(5d#El(wuC@7!NXv8V%v#_V13XKg+p zNg|se$%<8E#YuLsp z(2D&sgYSb*&FT8Y621;;b7AzT?;1>XA$wQ_)oukd;S_z>!ZW2ddqtGdS{ zmPD{kpx&W!F*l3^!!os*9a+wd9_*Isxlms&8>20KQdNPWhD@(93sS zv!RP`>SFy9_xg?NjxlK6c>vM@c~zIy6eV}_33sj%(dICAB0YV2y2hPEdMKQ>xW^)u z%r;Ft<0sRO=U0}dh5`?NXeEJfELqQ|nr9fyR0NZ)*5pAUHS|&0H7yH{L5u0SURLeI zYKjY1t*D4NoXb%W1z`~seGz*fRj4T9!>}#x$tM+j94OpA45aa#n?GjYpf7&#%lF-L z&prRXbFzMm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Nw`@rUS`vtB@VnWXNqa=gwBz!svUr55e z!2EEznWUiafY*V?u{J9FBQQ}Lcd)TglpowE0IsKD@TXw_fW{?z0-X5d;(fpi5z}$c z344Kg-zNj}7W!FlS~0(Ni3M`JYG97XX1t}LrQq=3Q8tJ(UJqOg1CL=KX=B_05D96< zp}PnE6%bF@0zDrvz505Cs?ye^*b1aP7SXgD-_D#_to628n1rWM^v(*FjW zxRac~BVhB2B@Ub!yMTw{83ZUaJem!Gxy1h<)v-flp?v7gE2;)gTswT+jL!tWzljyj zgq{q<6&oI1Y_jJHFEPgp!EhA>{C!9Sc*kr2X+skJ0GPLk8=ndO>t;^yI52)j;{?tD zOha(qX0Fg>Rt5|;<+H&61m*z00P`cVLMA<@|PD`&svC9In- 3e: 05 90 lpm r0, Z+ 40: 0d 92 st X+, r0 - 42: a2 37 cpi r26, 0x72 ; 114 + 42: a4 3b cpi r26, 0xB4 ; 180 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 + 4a: a4 eb ldi r26, 0xB4 ; 180 4c: b0 e0 ldi r27, 0x00 ; 0 4e: 01 c0 rjmp .+2 ; 0x52 <.do_clear_bss_start> @@ -84,11 +84,11 @@ Disassembly of section .text: 50: 1d 92 st X+, r1 00000052 <.do_clear_bss_start>: - 52: a8 37 cpi r26, 0x78 ; 120 + 52: ac 3b cpi r26, 0xBC ; 188 54: b2 07 cpc r27, r18 56: e1 f7 brne .-8 ; 0x50 <.do_clear_bss_loop> - 58: f4 d0 rcall .+488 ; 0x242
- 5a: 4b c1 rjmp .+662 ; 0x2f2 <_exit> + 58: f5 d0 rcall .+490 ; 0x244
+ 5a: c3 c1 rjmp .+902 ; 0x3e2 <_exit> 0000005c <__bad_interrupt>: 5c: d1 cf rjmp .-94 ; 0x0 <__vectors> @@ -328,9 +328,9 @@ void wait_100us(void){ 158: 08 95 ret 0000015a <__vector_5>: -int counter = 0; -uint8_t flags; +int clock_state_changed = 0; +int update_display = 1; ISR (TIMER1_OVF_vect) // Timer1 ISR { @@ -361,7 +361,7 @@ ISR (TIMER1_OVF_vect) // Timer1 ISR } } -void lcd_write_text(int row, int col, uint8_t text[16]) +void lcd_write_text(int row, int col, uint8_t text[]) { 17e: ef 92 push r14 180: ff 92 push r15 @@ -408,233 +408,383 @@ void lcd_write_text(int row, int col, uint8_t text[16]) 1bc: 4c 2f mov r20, r28 1be: 8e 2d mov r24, r14 1c0: 55 df rcall .-342 ; 0x6c - 1c2: cf 5f subi r28, 0xFF ; 255 + } + lcd_5ms(); + 1c2: 4d df rcall .-358 ; 0x5e + 1c4: cf 5f subi r28, 0xFF ; 255 break; case 1: row = line2; break; } for(int i=0;i<=15;i++){ - 1c4: c0 31 cpi r28, 0x10 ; 16 - 1c6: a9 f7 brne .-22 ; 0x1b2 + 1c6: c0 31 cpi r28, 0x10 ; 16 + 1c8: a1 f7 brne .-24 ; 0x1b2 if(text[i] != 0x5F){ lcd_write(row, text[i], 0+i); } + lcd_5ms(); } } - 1c8: cf 91 pop r28 - 1ca: 1f 91 pop r17 - 1cc: 0f 91 pop r16 - 1ce: ff 90 pop r15 - 1d0: ef 90 pop r14 - 1d2: 08 95 ret + 1ca: cf 91 pop r28 + 1cc: 1f 91 pop r17 + 1ce: 0f 91 pop r16 + 1d0: ff 90 pop r15 + 1d2: ef 90 pop r14 + 1d4: 08 95 ret -000001d4 : +000001d6 : int button_clicked(int button) { if(((PIND & 0x03) == button+1) != ((flags & (1<0)){ - 1d4: 20 b3 in r18, 0x10 ; 16 - 1d6: bc 01 movw r22, r24 - 1d8: 6f 5f subi r22, 0xFF ; 255 - 1da: 7f 4f sbci r23, 0xFF ; 255 - 1dc: 40 91 77 00 lds r20, 0x0077 ; 0x800077 - 1e0: e1 e0 ldi r30, 0x01 ; 1 - 1e2: f0 e0 ldi r31, 0x00 ; 0 - 1e4: df 01 movw r26, r30 - 1e6: 02 c0 rjmp .+4 ; 0x1ec - 1e8: aa 0f add r26, r26 - 1ea: bb 1f adc r27, r27 - 1ec: 8a 95 dec r24 - 1ee: e2 f7 brpl .-8 ; 0x1e8 - 1f0: cd 01 movw r24, r26 - 1f2: 23 70 andi r18, 0x03 ; 3 - 1f4: 30 e0 ldi r19, 0x00 ; 0 - 1f6: 51 e0 ldi r21, 0x01 ; 1 - 1f8: 26 17 cp r18, r22 - 1fa: 37 07 cpc r19, r23 - 1fc: 09 f0 breq .+2 ; 0x200 - 1fe: 50 e0 ldi r21, 0x00 ; 0 - 200: 24 2f mov r18, r20 - 202: 30 e0 ldi r19, 0x00 ; 0 - 204: 28 23 and r18, r24 - 206: 39 23 and r19, r25 - 208: e1 e0 ldi r30, 0x01 ; 1 - 20a: 12 16 cp r1, r18 - 20c: 13 06 cpc r1, r19 - 20e: 0c f0 brlt .+2 ; 0x212 - 210: e0 e0 ldi r30, 0x00 ; 0 - 212: 5e 17 cp r21, r30 - 214: 99 f0 breq .+38 ; 0x23c + 1d6: 20 b3 in r18, 0x10 ; 16 + 1d8: bc 01 movw r22, r24 + 1da: 6f 5f subi r22, 0xFF ; 255 + 1dc: 7f 4f sbci r23, 0xFF ; 255 + 1de: 40 91 bb 00 lds r20, 0x00BB ; 0x8000bb + 1e2: e1 e0 ldi r30, 0x01 ; 1 + 1e4: f0 e0 ldi r31, 0x00 ; 0 + 1e6: df 01 movw r26, r30 + 1e8: 02 c0 rjmp .+4 ; 0x1ee + 1ea: aa 0f add r26, r26 + 1ec: bb 1f adc r27, r27 + 1ee: 8a 95 dec r24 + 1f0: e2 f7 brpl .-8 ; 0x1ea + 1f2: cd 01 movw r24, r26 + 1f4: 23 70 andi r18, 0x03 ; 3 + 1f6: 30 e0 ldi r19, 0x00 ; 0 + 1f8: 51 e0 ldi r21, 0x01 ; 1 + 1fa: 26 17 cp r18, r22 + 1fc: 37 07 cpc r19, r23 + 1fe: 09 f0 breq .+2 ; 0x202 + 200: 50 e0 ldi r21, 0x00 ; 0 + 202: 24 2f mov r18, r20 + 204: 30 e0 ldi r19, 0x00 ; 0 + 206: 28 23 and r18, r24 + 208: 39 23 and r19, r25 + 20a: e1 e0 ldi r30, 0x01 ; 1 + 20c: 12 16 cp r1, r18 + 20e: 13 06 cpc r1, r19 + 210: 0c f0 brlt .+2 ; 0x214 + 212: e0 e0 ldi r30, 0x00 ; 0 + 214: 5e 17 cp r21, r30 + 216: 99 f0 breq .+38 ; 0x23e //if the pin is not equal to the stored state -> was pressed or released //check is the button has been pressed or released if((PIND & 0x03) == button+1){ - 216: 20 b3 in r18, 0x10 ; 16 - 218: 23 70 andi r18, 0x03 ; 3 - 21a: 30 e0 ldi r19, 0x00 ; 0 - 21c: 62 17 cp r22, r18 - 21e: 73 07 cpc r23, r19 - 220: 31 f4 brne .+12 ; 0x22e + 218: 20 b3 in r18, 0x10 ; 16 + 21a: 23 70 andi r18, 0x03 ; 3 + 21c: 30 e0 ldi r19, 0x00 ; 0 + 21e: 62 17 cp r22, r18 + 220: 73 07 cpc r23, r19 + 222: 31 f4 brne .+12 ; 0x230 //button is high -> pressed - flags |= (1< + flags |= (1< return(1); - 228: 81 e0 ldi r24, 0x01 ; 1 - 22a: 90 e0 ldi r25, 0x00 ; 0 - 22c: 08 95 ret + 22a: 81 e0 ldi r24, 0x01 ; 1 + 22c: 90 e0 ldi r25, 0x00 ; 0 + 22e: 08 95 ret } else{ //button is low -> released - flags &= ~(1< + flags &= ~(1< return(0); - 236: 80 e0 ldi r24, 0x00 ; 0 - 238: 90 e0 ldi r25, 0x00 ; 0 - 23a: 08 95 ret + 238: 80 e0 ldi r24, 0x00 ; 0 + 23a: 90 e0 ldi r25, 0x00 ; 0 + 23c: 08 95 ret } } return(0); - 23c: 80 e0 ldi r24, 0x00 ; 0 - 23e: 90 e0 ldi r25, 0x00 ; 0 + 23e: 80 e0 ldi r24, 0x00 ; 0 + 240: 90 e0 ldi r25, 0x00 ; 0 } - 240: 08 95 ret + 242: 08 95 ret -00000242
: +00000244
: + //counter++; TCNT1 = 63974; } int main(void) { + 244: cf 93 push r28 + 246: df 93 push r29 + 248: cd b7 in r28, 0x3d ; 61 + 24a: dd 27 eor r29, r29 + 24c: c0 54 subi r28, 0x40 ; 64 + 24e: cd bf out 0x3d, r28 ; 61 DDRD = 0x00; - 242: 11 ba out 0x11, r1 ; 17 + 250: 11 ba out 0x11, r1 ; 17 TCNT1 = 63974; // for 1 sec at 16 MHz - 244: 86 ee ldi r24, 0xE6 ; 230 - 246: 99 ef ldi r25, 0xF9 ; 249 - 248: 9d bd out 0x2d, r25 ; 45 - 24a: 8c bd out 0x2c, r24 ; 44 + 252: 86 ee ldi r24, 0xE6 ; 230 + 254: 99 ef ldi r25, 0xF9 ; 249 + 256: 9d bd out 0x2d, r25 ; 45 + 258: 8c bd out 0x2c, r24 ; 44 TCCR1A = 0x00; - 24c: 1f bc out 0x2f, r1 ; 47 + 25a: 1f bc out 0x2f, r1 ; 47 TCCR1B = (1< + if(clock_state != clock_new_state){ + 27c: 90 91 b9 00 lds r25, 0x00B9 ; 0x8000b9 + 280: 80 91 b8 00 lds r24, 0x00B8 ; 0x8000b8 + 284: 98 17 cp r25, r24 + 286: 99 f0 breq .+38 ; 0x2ae + clock_state = clock_new_state; + 288: 80 93 b9 00 sts 0x00B9, r24 ; 0x8000b9 + clock_state_changed = 1; + 28c: 21 e0 ldi r18, 0x01 ; 1 + 28e: 30 e0 ldi r19, 0x00 ; 0 + 290: 30 93 b5 00 sts 0x00B5, r19 ; 0x8000b5 <__data_end+0x1> + 294: 20 93 b4 00 sts 0x00B4, r18 ; 0x8000b4 <__data_end> + update_display = 1; + 298: 30 93 61 00 sts 0x0061, r19 ; 0x800061 <__data_start+0x1> + 29c: 20 93 60 00 sts 0x0060, r18 ; 0x800060 <__data_start> + else { + clock_state_changed = 0; + } + + switch(clock_state){ - 260: 88 23 and r24, r24 - 262: 19 f0 breq .+6 ; 0x26a - 264: 81 30 cpi r24, 0x01 ; 1 - 266: 51 f0 breq .+20 ; 0x27c - 268: fb cf rjmp .-10 ; 0x260 - 26a: 10 92 75 00 sts 0x0075, r1 ; 0x800075 + 2a0: 81 30 cpi r24, 0x01 ; 1 + 2a2: f1 f0 breq .+60 ; 0x2e0 + 2a4: 78 f0 brcs .+30 ; 0x2c4 + 2a6: 82 30 cpi r24, 0x02 ; 2 + 2a8: 09 f4 brne .+2 ; 0x2ac + 2aa: 6d c0 rjmp .+218 ; 0x386 + 2ac: e7 cf rjmp .-50 ; 0x27c + clock_state = clock_new_state; + clock_state_changed = 1; + update_display = 1; + } + else { + clock_state_changed = 0; + 2ae: 10 92 b5 00 sts 0x00B5, r1 ; 0x8000b5 <__data_end+0x1> + 2b2: 10 92 b4 00 sts 0x00B4, r1 ; 0x8000b4 <__data_end> + } + + + switch(clock_state){ + 2b6: 91 30 cpi r25, 0x01 ; 1 + 2b8: 69 f0 breq .+26 ; 0x2d4 + 2ba: 20 f0 brcs .+8 ; 0x2c4 + 2bc: 92 30 cpi r25, 0x02 ; 2 + 2be: 09 f4 brne .+2 ; 0x2c2 + 2c0: 62 c0 rjmp .+196 ; 0x386 + 2c2: dc cf rjmp .-72 ; 0x27c case CLOCK_INIT: //do some init stuff... - lcd_init(); //I know, it's just c but I don't care - 26e: 3d df rcall .-390 ; 0xea + lcd_init(); + 2c4: 12 df rcall .-476 ; 0xea + lcd_5ms(); + 2c6: cb de rcall .-618 ; 0x5e lcd_instruct(lcd_DISPLAY_CLEAR); - 270: 81 e0 ldi r24, 0x01 ; 1 - 272: 36 df rcall .-404 ; 0xe0 + 2c8: 81 e0 ldi r24, 0x01 ; 1 + 2ca: 0a df rcall .-492 ; 0xe0 //INIT done -> change to IDLE clock_new_state = CLOCK_IDLE; - 274: 81 e0 ldi r24, 0x01 ; 1 - 276: 80 93 74 00 sts 0x0074, r24 ; 0x800074 - + 2cc: 81 e0 ldi r24, 0x01 ; 1 + 2ce: 80 93 b8 00 sts 0x00B8, r24 ; 0x8000b8 + break; - 27a: f0 cf rjmp .-32 ; 0x25c - 27c: 81 e0 ldi r24, 0x01 ; 1 - 27e: 80 93 75 00 sts 0x0075, r24 ; 0x800075 + 2d2: d4 cf rjmp .-88 ; 0x27c case CLOCK_IDLE: //IDLE MODE //print the IDLE Screen - - lcd_write_text(0,0,t1); - 282: 40 e6 ldi r20, 0x60 ; 96 - 284: 50 e0 ldi r21, 0x00 ; 0 - 286: 60 e0 ldi r22, 0x00 ; 0 - 288: 70 e0 ldi r23, 0x00 ; 0 - 28a: 80 e0 ldi r24, 0x00 ; 0 - 28c: 90 e0 ldi r25, 0x00 ; 0 - 28e: 77 df rcall .-274 ; 0x17e - + + if(update_display){ + 2d4: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__data_start> + 2d8: 90 91 61 00 lds r25, 0x0061 ; 0x800061 <__data_start+0x1> + 2dc: 89 2b or r24, r25 + 2de: 41 f1 breq .+80 ; 0x330 + lcd_5ms(); + 2e0: be de rcall .-644 ; 0x5e + lcd_write_text(0,0,(uint8_t []){'_','_','_','_','_','_','t','i','m','e','_','_','_','_','_','_'}); + 2e2: 80 e1 ldi r24, 0x10 ; 16 + 2e4: e3 e7 ldi r30, 0x73 ; 115 + 2e6: f0 e0 ldi r31, 0x00 ; 0 + 2e8: de 01 movw r26, r28 + 2ea: d1 96 adiw r26, 0x31 ; 49 + 2ec: 01 90 ld r0, Z+ + 2ee: 0d 92 st X+, r0 + 2f0: 8a 95 dec r24 + 2f2: e1 f7 brne .-8 ; 0x2ec + 2f4: ae 01 movw r20, r28 + 2f6: 4f 5c subi r20, 0xCF ; 207 + 2f8: 5f 4f sbci r21, 0xFF ; 255 + 2fa: 60 e0 ldi r22, 0x00 ; 0 + 2fc: 70 e0 ldi r23, 0x00 ; 0 + 2fe: 80 e0 ldi r24, 0x00 ; 0 + 300: 90 e0 ldi r25, 0x00 ; 0 + 302: 3d df rcall .-390 ; 0x17e + lcd_5ms(); + 304: ac de rcall .-680 ; 0x5e + lcd_write_text(1,0,(uint8_t []){' ',' ',' ',' ',' ',' ','t','i','m','e',' ',' ',' ',' ',' ',' '}); + 306: 80 e1 ldi r24, 0x10 ; 16 + 308: e3 e8 ldi r30, 0x83 ; 131 + 30a: f0 e0 ldi r31, 0x00 ; 0 + 30c: de 01 movw r26, r28 + 30e: 91 96 adiw r26, 0x21 ; 33 + 310: 01 90 ld r0, Z+ + 312: 0d 92 st X+, r0 + 314: 8a 95 dec r24 + 316: e1 f7 brne .-8 ; 0x310 + 318: ae 01 movw r20, r28 + 31a: 4f 5d subi r20, 0xDF ; 223 + 31c: 5f 4f sbci r21, 0xFF ; 255 + 31e: 60 e0 ldi r22, 0x00 ; 0 + 320: 70 e0 ldi r23, 0x00 ; 0 + 322: 81 e0 ldi r24, 0x01 ; 1 + 324: 90 e0 ldi r25, 0x00 ; 0 + 326: 2b df rcall .-426 ; 0x17e + update_display = 0; + 328: 10 92 61 00 sts 0x0061, r1 ; 0x800061 <__data_start+0x1> + 32c: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__data_start> + } if(button_clicked(butt1)){ - 290: 80 e0 ldi r24, 0x00 ; 0 - 292: 90 e0 ldi r25, 0x00 ; 0 - 294: 9f df rcall .-194 ; 0x1d4 - 296: 89 2b or r24, r25 - 298: 51 f0 breq .+20 ; 0x2ae - counter++; - 29a: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__data_end> - 29e: 90 91 73 00 lds r25, 0x0073 ; 0x800073 <__data_end+0x1> - 2a2: 01 96 adiw r24, 0x01 ; 1 - 2a4: 90 93 73 00 sts 0x0073, r25 ; 0x800073 <__data_end+0x1> - 2a8: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__data_end> - 2ac: 1d c0 rjmp .+58 ; 0x2e8 + 330: 80 e0 ldi r24, 0x00 ; 0 + 332: 90 e0 ldi r25, 0x00 ; 0 + 334: 50 df rcall .-352 ; 0x1d6 + 336: 89 2b or r24, r25 + 338: 19 f0 breq .+6 ; 0x340 + clock_new_state = CLOCK_ALARM; + 33a: d0 92 b8 00 sts 0x00B8, r13 ; 0x8000b8 + 33e: 1d c0 rjmp .+58 ; 0x37a } else if(button_clicked(butt2)){ - 2ae: 81 e0 ldi r24, 0x01 ; 1 - 2b0: 90 e0 ldi r25, 0x00 ; 0 - 2b2: 90 df rcall .-224 ; 0x1d4 - 2b4: 89 2b or r24, r25 - 2b6: 51 f0 breq .+20 ; 0x2cc + 340: 81 e0 ldi r24, 0x01 ; 1 + 342: 90 e0 ldi r25, 0x00 ; 0 + 344: 48 df rcall .-368 ; 0x1d6 + 346: 89 2b or r24, r25 + 348: 51 f0 breq .+20 ; 0x35e counter += 2; - 2b8: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__data_end> - 2bc: 90 91 73 00 lds r25, 0x0073 ; 0x800073 <__data_end+0x1> - 2c0: 02 96 adiw r24, 0x02 ; 2 - 2c2: 90 93 73 00 sts 0x0073, r25 ; 0x800073 <__data_end+0x1> - 2c6: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__data_end> - 2ca: 0e c0 rjmp .+28 ; 0x2e8 + 34a: 80 91 b6 00 lds r24, 0x00B6 ; 0x8000b6 + 34e: 90 91 b7 00 lds r25, 0x00B7 ; 0x8000b7 + 352: 02 96 adiw r24, 0x02 ; 2 + 354: 90 93 b7 00 sts 0x00B7, r25 ; 0x8000b7 + 358: 80 93 b6 00 sts 0x00B6, r24 ; 0x8000b6 + 35c: 0e c0 rjmp .+28 ; 0x37a } else if(button_clicked(butt3)){ - 2cc: 82 e0 ldi r24, 0x02 ; 2 - 2ce: 90 e0 ldi r25, 0x00 ; 0 - 2d0: 81 df rcall .-254 ; 0x1d4 - 2d2: 89 2b or r24, r25 - 2d4: 49 f0 breq .+18 ; 0x2e8 + 35e: 82 e0 ldi r24, 0x02 ; 2 + 360: 90 e0 ldi r25, 0x00 ; 0 + 362: 39 df rcall .-398 ; 0x1d6 + 364: 89 2b or r24, r25 + 366: 49 f0 breq .+18 ; 0x37a counter += 3; - 2d6: 80 91 72 00 lds r24, 0x0072 ; 0x800072 <__data_end> - 2da: 90 91 73 00 lds r25, 0x0073 ; 0x800073 <__data_end+0x1> - 2de: 03 96 adiw r24, 0x03 ; 3 - 2e0: 90 93 73 00 sts 0x0073, r25 ; 0x800073 <__data_end+0x1> - 2e4: 80 93 72 00 sts 0x0072, r24 ; 0x800072 <__data_end> -// flags &= ~(1< + 36c: 90 91 b7 00 lds r25, 0x00B7 ; 0x8000b7 + 370: 03 96 adiw r24, 0x03 ; 3 + 372: 90 93 b7 00 sts 0x00B7, r25 ; 0x8000b7 + 376: 80 93 b6 00 sts 0x00B6, r24 ; 0x8000b6 + } t1[0] = counter + 48; - 2e8: 88 81 ld r24, Y - 2ea: 80 5d subi r24, 0xD0 ; 208 - 2ec: 80 93 60 00 sts 0x0060, r24 ; 0x800060 <__data_start> + 37a: f8 01 movw r30, r16 + 37c: 80 81 ld r24, Z + 37e: 80 5d subi r24, 0xD0 ; 208 + 380: f7 01 movw r30, r14 + 382: 80 83 st Z, r24 break; - 2f0: b5 cf rjmp .-150 ; 0x25c + 384: 7b cf rjmp .-266 ; 0x27c + + case CLOCK_ALARM: + //ALARM setup Mode + //print the ALARM screen + if(update_display){ + 386: 80 91 60 00 lds r24, 0x0060 ; 0x800060 <__data_start> + 38a: 90 91 61 00 lds r25, 0x0061 ; 0x800061 <__data_start+0x1> + 38e: 89 2b or r24, r25 + 390: 09 f4 brne .+2 ; 0x394 + 392: 74 cf rjmp .-280 ; 0x27c + lcd_write_text(0,0,(uint8_t []){' ',' ','[','a','l','a','r','m',' ','t','i','m','e',']',' ',' '}); + 394: 80 e1 ldi r24, 0x10 ; 16 + 396: e3 e9 ldi r30, 0x93 ; 147 + 398: f0 e0 ldi r31, 0x00 ; 0 + 39a: de 01 movw r26, r28 + 39c: 51 96 adiw r26, 0x11 ; 17 + 39e: 01 90 ld r0, Z+ + 3a0: 0d 92 st X+, r0 + 3a2: 8a 95 dec r24 + 3a4: e1 f7 brne .-8 ; 0x39e + 3a6: ae 01 movw r20, r28 + 3a8: 4f 5e subi r20, 0xEF ; 239 + 3aa: 5f 4f sbci r21, 0xFF ; 255 + 3ac: 60 e0 ldi r22, 0x00 ; 0 + 3ae: 70 e0 ldi r23, 0x00 ; 0 + 3b0: 80 e0 ldi r24, 0x00 ; 0 + 3b2: 90 e0 ldi r25, 0x00 ; 0 + 3b4: e4 de rcall .-568 ; 0x17e + lcd_write_text(1,0,(uint8_t []){' ',' ',' ',' ',' ','a','l','a','r','m',' ','>',' ',' ',' ',' '}); + 3b6: 80 e1 ldi r24, 0x10 ; 16 + 3b8: e3 ea ldi r30, 0xA3 ; 163 + 3ba: f0 e0 ldi r31, 0x00 ; 0 + 3bc: de 01 movw r26, r28 + 3be: 11 96 adiw r26, 0x01 ; 1 + 3c0: 01 90 ld r0, Z+ + 3c2: 0d 92 st X+, r0 + 3c4: 8a 95 dec r24 + 3c6: e1 f7 brne .-8 ; 0x3c0 + 3c8: ae 01 movw r20, r28 + 3ca: 4f 5f subi r20, 0xFF ; 255 + 3cc: 5f 4f sbci r21, 0xFF ; 255 + 3ce: 60 e0 ldi r22, 0x00 ; 0 + 3d0: 70 e0 ldi r23, 0x00 ; 0 + 3d2: 81 e0 ldi r24, 0x01 ; 1 + 3d4: 90 e0 ldi r25, 0x00 ; 0 + 3d6: d3 de rcall .-602 ; 0x17e + update_display = 0; + 3d8: 10 92 61 00 sts 0x0061, r1 ; 0x800061 <__data_start+0x1> + 3dc: 10 92 60 00 sts 0x0060, r1 ; 0x800060 <__data_start> + 3e0: 4d cf rjmp .-358 ; 0x27c -000002f2 <_exit>: - 2f2: f8 94 cli +000003e2 <_exit>: + 3e2: f8 94 cli -000002f4 <__stop_program>: - 2f4: ff cf rjmp .-2 ; 0x2f4 <__stop_program> +000003e4 <__stop_program>: + 3e4: ff cf rjmp .-2 ; 0x3e4 <__stop_program> diff --git a/Debug/AtTiny_alarm_clock.map b/Debug/AtTiny_alarm_clock.map index 538eddd..19767b1 100644 --- a/Debug/AtTiny_alarm_clock.map +++ b/Debug/AtTiny_alarm_clock.map @@ -203,7 +203,7 @@ END GROUP .rela.plt *(.rela.plt) -.text 0x00000000 0x2f6 +.text 0x00000000 0x3e6 *(.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 @@ -302,18 +302,18 @@ END GROUP 0x0000015a 0x24 main.o 0x0000015a __vector_5 .text.lcd_write_text - 0x0000017e 0x56 main.o + 0x0000017e 0x58 main.o 0x0000017e lcd_write_text .text.button_clicked - 0x000001d4 0x6e main.o - 0x000001d4 button_clicked - .text.main 0x00000242 0xb0 main.o - 0x00000242 main - 0x000002f2 . = ALIGN (0x2) + 0x000001d6 0x6e main.o + 0x000001d6 button_clicked + .text.main 0x00000244 0x19e main.o + 0x00000244 main + 0x000003e2 . = ALIGN (0x2) *(.fini9) - .fini9 0x000002f2 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) - 0x000002f2 _exit - 0x000002f2 exit + .fini9 0x000003e2 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) + 0x000003e2 _exit + 0x000003e2 exit *(.fini9) *(.fini8) *(.fini8) @@ -332,50 +332,57 @@ END GROUP *(.fini1) *(.fini1) *(.fini0) - .fini0 0x000002f2 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 0x000003e2 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) - 0x000002f6 _etext = . + 0x000003e6 _etext = . -.data 0x00800060 0x12 load address 0x000002f6 +.data 0x00800060 0x54 load address 0x000003e6 0x00800060 PROVIDE (__data_start, .) *(.data) *(.data*) - .data.t1 0x00800060 0x11 main.o - 0x00800060 t1 + .data.update_display + 0x00800060 0x2 main.o + 0x00800060 update_display + .data.t1 0x00800062 0x11 main.o + 0x00800062 t1 *(.gnu.linkonce.d*) *(.rodata) + .rodata 0x00800073 0x40 main.o *(.rodata*) *(.gnu.linkonce.r*) - 0x00800072 . = ALIGN (0x2) - *fill* 0x00800071 0x1 - 0x00800072 _edata = . - 0x00800072 PROVIDE (__data_end, .) + 0x008000b4 . = ALIGN (0x2) + *fill* 0x008000b3 0x1 + 0x008000b4 _edata = . + 0x008000b4 PROVIDE (__data_end, .) -.bss 0x00800072 0x6 - 0x00800072 PROVIDE (__bss_start, .) +.bss 0x008000b4 0x8 + 0x008000b4 PROVIDE (__bss_start, .) *(.bss) *(.bss*) - .bss.counter 0x00800072 0x2 main.o - 0x00800072 counter + .bss.clock_state_changed + 0x008000b4 0x2 main.o + 0x008000b4 clock_state_changed + .bss.counter 0x008000b6 0x2 main.o + 0x008000b6 counter .bss.clock_new_state - 0x00800074 0x1 main.o - 0x00800074 clock_new_state + 0x008000b8 0x1 main.o + 0x008000b8 clock_new_state .bss.clock_state - 0x00800075 0x1 main.o - 0x00800075 clock_state + 0x008000b9 0x1 main.o + 0x008000b9 clock_state *(COMMON) - COMMON 0x00800076 0x2 main.o - 0x00800076 clock_old_state - 0x00800077 flags - 0x00800078 PROVIDE (__bss_end, .) - 0x000002f6 __data_load_start = LOADADDR (.data) - 0x00000308 __data_load_end = (__data_load_start + SIZEOF (.data)) + COMMON 0x008000ba 0x2 main.o + 0x008000ba clock_old_state + 0x008000bb flags + 0x008000bc PROVIDE (__bss_end, .) + 0x000003e6 __data_load_start = LOADADDR (.data) + 0x0000043a __data_load_end = (__data_load_start + SIZEOF (.data)) -.noinit 0x00800078 0x0 +.noinit 0x008000bc 0x0 [!provide] PROVIDE (__noinit_start, .) *(.noinit*) [!provide] PROVIDE (__noinit_end, .) - 0x00800078 _end = . + 0x008000bc _end = . [!provide] PROVIDE (__heap_start, .) .eeprom 0x00810000 0x0 @@ -454,48 +461,48 @@ END GROUP .debug_pubnames *(.debug_pubnames) -.debug_info 0x00000000 0xb59 +.debug_info 0x00000000 0xc54 *(.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 0x31d lcd4.o .debug_info 0x00000773 0xa3 lcd_wait.o - .debug_info 0x00000816 0x343 main.o + .debug_info 0x00000816 0x43e main.o -.debug_abbrev 0x00000000 0x738 +.debug_abbrev 0x00000000 0x73a *(.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 0xfe lcd4.o .debug_abbrev 0x00000519 0x72 lcd_wait.o - .debug_abbrev 0x0000058b 0x1ad main.o + .debug_abbrev 0x0000058b 0x1af main.o -.debug_line 0x00000000 0x61f +.debug_line 0x00000000 0x689 *(.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 0x291 lcd4.o .debug_line 0x0000039d 0xbd lcd_wait.o - .debug_line 0x0000045a 0x1c5 main.o + .debug_line 0x0000045a 0x22f main.o -.debug_frame 0x00000000 0x154 +.debug_frame 0x00000000 0x164 *(.debug_frame) .debug_frame 0x00000000 0x9c lcd4.o .debug_frame 0x0000009c 0x34 lcd_wait.o - .debug_frame 0x000000d0 0x84 main.o + .debug_frame 0x000000d0 0x94 main.o -.debug_str 0x00000000 0x470 +.debug_str 0x00000000 0x493 *(.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 0x1c0 lcd4.o 0x1fd (size before relaxing) .debug_str 0x0000033b 0x10 lcd_wait.o 0x166 (size before relaxing) - .debug_str 0x0000034b 0x125 main.o - 0x2d3 (size before relaxing) + .debug_str 0x0000034b 0x148 main.o + 0x2fe (size before relaxing) -.debug_loc 0x00000000 0x428 +.debug_loc 0x00000000 0x470 *(.debug_loc) .debug_loc 0x00000000 0x244 lcd4.o .debug_loc 0x00000244 0x48 lcd_wait.o - .debug_loc 0x0000028c 0x19c main.o + .debug_loc 0x0000028c 0x1e4 main.o .debug_macinfo *(.debug_macinfo) diff --git a/Debug/AtTiny_alarm_clock.srec b/Debug/AtTiny_alarm_clock.srec index 5211b36..fc47c9a 100644 --- a/Debug/AtTiny_alarm_clock.srec +++ b/Debug/AtTiny_alarm_clock.srec @@ -2,9 +2,9 @@ S01A0000417454696E795F616C61726D5F636C6F636B2E73726563DA S113000014C02CC02BC02AC029C0A7C027C026C03A S113001025C024C023C022C021C020C01FC01EC0D0 S11300201DC01CC01BC01AC019C011241FBECFEDB7 -S1130030CDBF10E0A0E6B0E0E6EFF2E002C005902C -S11300400D92A237B107D9F720E0A2E7B0E001C0D2 -S11300501D92A837B207E1F7F4D04BC1D1CFCF93AB +S1130030CDBF10E0A0E6B0E0E6EEF3E002C005902C +S11300400D92A43BB107D9F720E0A4EBB0E001C0C6 +S11300501D92AC3BB207E1F7F5D0C3C1D1CFCF932A S1130060C2E362D0C150E9F7CF910895CF93C62F70 S1130070843038F4823048F4882371F0813049F0B8 S11300800CC0843051F4939808C04F73833009F442 @@ -27,26 +27,45 @@ S1130180FF920F931F93CF937C01892B29F081E079 S1130190E816F10431F00AC06894EE24E1F8F12C79 S11301A005C00F2EF3E0EF2EF12CF02D042F152FA8 S11301B0C0E0F80161918F016F3519F04C2F8E2D3D -S11301C055DFCF5FC031A9F7CF911F910F91FF90F9 -S11301D0EF90089520B3BC016F5F7F4F409177008B -S11301E0E1E0F0E0DF0102C0AA0FBB1F8A95E2F74D -S11301F0CD01237030E051E02617370709F050E0B5 -S1130200242F30E028233923E1E0121613060CF0E2 -S1130210E0E05E1799F020B3237030E062177307B3 -S113022031F4842B8093770081E090E008958095E9 -S113023048234093770080E090E0089580E090E0C8 -S1130240089511BA86EE99EF9DBD8CBD1FBC85E063 -S11302508EBD80E889BF7894C2E7D0E080917400B5 -S1130260882319F0813051F0FBCF109275003DDFE7 -S113027081E036DF81E080937400F0CF81E08093E9 -S1130280750040E650E060E070E080E090E077DFE9 -S113029080E090E09FDF892B51F080917200909173 -S11302A07300019690937300809372001DC081E0E7 -S11302B090E090DF892B51F080917200909173004F -S11302C0029690937300809372000EC082E090E0D7 -S11302D081DF892B49F0809172009091730003961D -S11302E090937300809372008881805D8093600096 -S10902F0B5CFF894FFCF26 -S11302F62048616C6C6F5F5F5F5F5F5F5F5F5F5F2E -S10503065F0092 +S11301C055DF4DDFCF5FC031A1F7CF911F910F9164 +S11301D0FF90EF90089520B3BC016F5F7F4F409173 +S11301E0BB00E1E0F0E0DF0102C0AA0FBB1F8A956B +S11301F0E2F7CD01237030E051E02617370709F00C +S113020050E0242F30E028233923E1E012161306AE +S11302100CF0E0E05E1799F020B3237030E0621731 +S1130220730731F4842B8093BB0081E090E0089540 +S1130230809548234093BB0080E090E0089580E0DF +S113024090E00895CF93DF93CDB7DD27C054CDBFA1 +S113025011BA86EE99EF9DBD8CBD1FBC85E08EBDA5 +S113026080E889BF78940F2EF2E6EF2EF0E0FF2E9F +S1130270F02D06EB10E06894DD24D1F89091B900DC +S11302808091B800981799F08093B90021E030E08C +S11302903093B5002093B400309361002093600044 +S11302A08130F1F078F0823009F46DC0E7CF10921C +S11302B0B5001092B400913069F020F0923009F446 +S11302C062C0DCCF12DFCBDE81E00ADF81E0809305 +S11302D0B800D4CF8091600090916100892B41F1E6 +S11302E0BEDE80E1E3E7F0E0DE01D19601900D92FD +S11302F08A95E1F7AE014F5C5F4F60E070E080E00B +S113030090E03DDFACDE80E1E3E8F0E0DE019196D1 +S113031001900D928A95E1F7AE014F5D5F4F60E069 +S113032070E081E090E02BDF109261001092600099 +S113033080E090E050DF892B19F0D092B8001DC006 +S113034081E090E048DF892B51F08091B6009091D4 +S1130350B70002969093B7008093B6000EC082E077 +S113036090E039DF892B49F08091B6009091B70075 +S113037003969093B7008093B600F8018081805D66 +S1130380F70180837BCF8091600090916100892B7D +S113039009F474CF80E1E3E9F0E0DE0151960190C5 +S11303A00D928A95E1F7AE014F5E5F4F60E070E019 +S11303B080E090E0E4DE80E1E3EAF0E0DE01119623 +S11303C001900D928A95E1F7AE014F5F5F4F60E0B7 +S11303D070E081E090E0D3DE109261001092600042 +S10903E04DCFF894FFCF9D +S11303E601002048616C6C6F5F5F5F5F5F5F5F5FFA +S11303F65F5F5F5F5F5F5F5F5F74696D655F5F5FD0 +S11304065F5F5F20202020202074696D65202020F6 +S113041620202020205B616C61726D2074696D65FB +S11304265D20202020202020616C61726D203E20FA +S1070436202020005E S9030000FC diff --git a/Debug/main.o b/Debug/main.o index 215ffe35865ffd02acad61c5d4b6deaccd0c9559..b370daefe15789c8355b264ec183267e833132aa 100644 GIT binary patch literal 11492 zcmbuEe~?twmB;Vx*Yg7y<|ht_;Ix2>$}}?wI-=mrFsPFZKZLo@nU?zll~tz6P-qbk&tYP(da$I-adC@fS9)J3Xp zq++Dvdle&93mzSPYV^TBJpRcyU)}%eQ^SuAR}5ABsA8yYXx5=mMoy1ZjMj}F9o?-T zxk8Wc$^E|eL{N{bvEGA!SaAH*iA8FxBK%qIlkkZ}IeS zK)pJqjvbARHR_W`hwFwbhEETDGE{mf^x`Wz6}fL+^RQCKbK|*RYc=+F6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j?nyQrUF|d{JjT1VvS~1Ea3R?a4z}Cf@+vrP>$!~nXx3sWQGtlyNQTD zo>{91i-M;U{PAf)yHWhs%y-!jn^r;*OTwI;Y{Px*Ce|_ChKua6fb>7<@tItW>wnX0 zhtA@Dd7jv0`{jAy>Txgd?6Aq|ZG#|;t5+&s#&cj0+=ihH$y|xF@(iZL;=` zK;YWD3VU4Jv{xl{w8uT@+T*#zy=9ZN_ZbLWdqep4G5Zp79^2NxlVCS~e+dITr);wJ zPD4Ppai$(zEG4V=MMzwGKS719qq61mA5!nnoHlGvdpoTYPTiYecf2cFmHH3pF@Ah4 zwd4IOrwvd=FUh4N6*lDg(2vQGZ zHrcv=hQPI##$j*Q0ftnvXTFM=(b9tL%nUd zF}LYF^ge3~$mtUkziVCpUS3@u?<&-@j{Asf*I7oY9S>4In{Bel+;LlVMPLttDCB$& U(_SMk?kU&aJcL{uHd%ZB4QudC%m4rY diff --git a/main.c b/main.c index 88f41a2..cff6adf 100644 --- a/main.c +++ b/main.c @@ -25,6 +25,9 @@ int counter = 0; uint8_t flags; +int clock_state_changed = 0; +int update_display = 1; + ISR (TIMER1_OVF_vect) // Timer1 ISR { //counter++; @@ -41,32 +44,46 @@ int main(void) TCCR1B = (1< change to IDLE clock_new_state = CLOCK_IDLE; - + break; case CLOCK_IDLE: //IDLE MODE //print the IDLE Screen - - lcd_write_text(0,0,t1); - + + if(update_display){ + lcd_5ms(); + lcd_write_text(0,0,(uint8_t []){'_','_','_','_','_','_','t','i','m','e','_','_','_','_','_','_'}); + lcd_5ms(); + lcd_write_text(1,0,(uint8_t []){' ',' ',' ',' ',' ',' ','t','i','m','e',' ',' ',' ',' ',' ',' '}); + update_display = 0; + } if(button_clicked(butt1)){ - counter++; + clock_new_state = CLOCK_ALARM; } else if(button_clicked(butt2)){ counter += 2; @@ -79,11 +96,21 @@ int main(void) t1[0] = counter + 48; break; + + case CLOCK_ALARM: + //ALARM setup Mode + //print the ALARM screen + if(update_display){ + lcd_write_text(0,0,(uint8_t []){' ',' ','[','a','l','a','r','m',' ','t','i','m','e',']',' ',' '}); + lcd_write_text(1,0,(uint8_t []){' ',' ',' ',' ',' ','a','l','a','r','m',' ','>',' ',' ',' ',' '}); + update_display = 0; + } + break; } } } -void lcd_write_text(int row, int col, uint8_t text[16]) +void lcd_write_text(int row, int col, uint8_t text[]) { switch(row){ case 0: @@ -97,6 +124,7 @@ void lcd_write_text(int row, int col, uint8_t text[16]) if(text[i] != 0x5F){ lcd_write(row, text[i], 0+i); } + lcd_5ms(); } } @@ -107,12 +135,12 @@ int button_clicked(int button) //check is the button has been pressed or released if((PIND & 0x03) == button+1){ //button is high -> pressed - flags |= (1< released - flags &= ~(1<