[EDIT] change interrupt 0 to 2 to be able to use led matrices
This commit is contained in:
Binary file not shown.
@@ -7,14 +7,12 @@
|
||||
:100060001DC000001BC0000019C0000017C0000028
|
||||
:1000700015C0000013C0000011C000000FC0000038
|
||||
:100080000DC000000BC0000009C0000011241FBEFD
|
||||
:10009000CFEFD0E1DEBFCDBF40D048C0B1CF20E030
|
||||
:10009000CFEFD0E1DEBFCDBF36D038C0B1CF20E04A
|
||||
:1000A00030E008C0E3ECF9E03197F1F700C0000060
|
||||
:1000B0002F5F3F4F28173907ACF3089588B380624C
|
||||
:1000C00088BB81E28A95F1F7000088B38F7D88BBF9
|
||||
:1000D00081E28A95F1F70000089588B38E7F88BB8E
|
||||
:1000E00088B38D7F88BB88B38B7F88BB88B3877FBD
|
||||
:1000F00088BB8FE385BBE2CF089588B38E7F88BB32
|
||||
:1001000088B38D7F88BB88B38B7F88BB88B3877F9C
|
||||
:1001100088BB8EE385BBD2CF0895DFDF80ED97E00B
|
||||
:10012000BEDFEBDF80ED97E0BADFF7CFF894FFCFCB
|
||||
:1000B0002F5F3F4F28173907ACF308958FEF84BBAC
|
||||
:1000C00087BB88B38B6088BB84E190E0E8CF08955C
|
||||
:1000D00088B3806188BB81E28A95F1F7000088B31C
|
||||
:1000E0008F7E88BB81E28A95F1F70000089588B37E
|
||||
:1000F0008E7F88BB88B38D7F88BB8FEF88BB8EE1F6
|
||||
:1001000085BBE6CF0895DADFF2DFFFCFF894FFCFAB
|
||||
:00000001FF
|
||||
|
||||
@@ -3,29 +3,29 @@ GLCD.elf: file format elf32-avr
|
||||
|
||||
Sections:
|
||||
Idx Name Size VMA LMA File off Algn
|
||||
0 .data 00000000 00800100 00800100 00000184 2**0
|
||||
0 .data 00000000 00800100 00800100 00000164 2**0
|
||||
CONTENTS, ALLOC, LOAD, DATA
|
||||
1 .text 00000130 00000000 00000000 00000054 2**1
|
||||
1 .text 00000110 00000000 00000000 00000054 2**1
|
||||
CONTENTS, ALLOC, LOAD, READONLY, CODE
|
||||
2 .comment 00000030 00000000 00000000 00000184 2**0
|
||||
2 .comment 00000030 00000000 00000000 00000164 2**0
|
||||
CONTENTS, READONLY
|
||||
3 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 000001b4 2**2
|
||||
3 .note.gnu.avr.deviceinfo 0000003c 00000000 00000000 00000194 2**2
|
||||
CONTENTS, READONLY
|
||||
4 .debug_aranges 00000040 00000000 00000000 000001f0 2**0
|
||||
4 .debug_aranges 00000058 00000000 00000000 000001d0 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
5 .debug_info 00000a18 00000000 00000000 00000230 2**0
|
||||
5 .debug_info 00000aeb 00000000 00000000 00000228 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
6 .debug_abbrev 00000882 00000000 00000000 00000c48 2**0
|
||||
6 .debug_abbrev 00000891 00000000 00000000 00000d13 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
7 .debug_line 00000369 00000000 00000000 000014ca 2**0
|
||||
7 .debug_line 000003e0 00000000 00000000 000015a4 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
8 .debug_frame 00000064 00000000 00000000 00001834 2**2
|
||||
8 .debug_frame 00000094 00000000 00000000 00001984 2**2
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
9 .debug_str 00000463 00000000 00000000 00001898 2**0
|
||||
9 .debug_str 0000045b 00000000 00000000 00001a18 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
10 .debug_loc 000000f4 00000000 00000000 00001cfb 2**0
|
||||
10 .debug_loc 00000189 00000000 00000000 00001e73 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
11 .debug_ranges 00000030 00000000 00000000 00001def 2**0
|
||||
11 .debug_ranges 00000048 00000000 00000000 00001ffc 2**0
|
||||
CONTENTS, READONLY, DEBUGGING
|
||||
|
||||
Disassembly of section .text:
|
||||
@@ -109,28 +109,22 @@ Disassembly of section .text:
|
||||
92: d0 e1 ldi r29, 0x10 ; 16
|
||||
94: de bf out 0x3e, r29 ; 62
|
||||
96: cd bf out 0x3d, r28 ; 61
|
||||
98: 40 d0 rcall .+128 ; 0x11a <main>
|
||||
9a: 48 c0 rjmp .+144 ; 0x12c <_exit>
|
||||
98: 36 d0 rcall .+108 ; 0x106 <main>
|
||||
9a: 38 c0 rjmp .+112 ; 0x10c <_exit>
|
||||
|
||||
0000009c <__bad_interrupt>:
|
||||
9c: b1 cf rjmp .-158 ; 0x0 <__vectors>
|
||||
|
||||
0000009e <wait>:
|
||||
//is active low (refer to datasheet)
|
||||
|
||||
|
||||
void wait( int ms )
|
||||
{
|
||||
for (int i=0; i<ms; i++)
|
||||
CONTROLPORT |= CS1; //Activate both chips
|
||||
CONTROLPORT |= CS2;
|
||||
#endif
|
||||
CONTROLPORT = ~GLCD_RST | ~GLCD_RW; //RS low --> command
|
||||
DATAPORT = 0b0011111; //OFF command
|
||||
trigger();
|
||||
9e: 20 e0 ldi r18, 0x00 ; 0
|
||||
a0: 30 e0 ldi r19, 0x00 ; 0
|
||||
a2: 08 c0 rjmp .+16 ; 0xb4 <wait+0x16>
|
||||
#else
|
||||
//round up by default
|
||||
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
||||
#endif
|
||||
|
||||
__builtin_avr_delay_cycles(__ticks_dc);
|
||||
a4: e3 ec ldi r30, 0xC3 ; 195
|
||||
a6: f9 e0 ldi r31, 0x09 ; 9
|
||||
a8: 31 97 sbiw r30, 0x01 ; 1
|
||||
@@ -142,129 +136,79 @@ void wait( int ms )
|
||||
b4: 28 17 cp r18, r24
|
||||
b6: 39 07 cpc r19, r25
|
||||
b8: ac f3 brlt .-22 ; 0xa4 <wait+0x6>
|
||||
{
|
||||
_delay_ms( 1 ); // library function (max 30 ms at 8MHz)
|
||||
}
|
||||
}
|
||||
ba: 08 95 ret
|
||||
|
||||
000000bc <trigger>:
|
||||
000000bc <GLCD_init>:
|
||||
bc: 8f ef ldi r24, 0xFF ; 255
|
||||
be: 84 bb out 0x14, r24 ; 20
|
||||
c0: 87 bb out 0x17, r24 ; 23
|
||||
c2: 88 b3 in r24, 0x18 ; 24
|
||||
c4: 8b 60 ori r24, 0x0B ; 11
|
||||
c6: 88 bb out 0x18, r24 ; 24
|
||||
c8: 84 e1 ldi r24, 0x14 ; 20
|
||||
ca: 90 e0 ldi r25, 0x00 ; 0
|
||||
cc: e8 cf rjmp .-48 ; 0x9e <wait>
|
||||
ce: 08 95 ret
|
||||
|
||||
void trigger()
|
||||
{
|
||||
CONTROLPORT |= GLCD_EN; //EN high
|
||||
bc: 88 b3 in r24, 0x18 ; 24
|
||||
be: 80 62 ori r24, 0x20 ; 32
|
||||
c0: 88 bb out 0x18, r24 ; 24
|
||||
#else
|
||||
//round up by default
|
||||
__ticks_dc = (uint32_t)(ceil(fabs(__tmp)));
|
||||
#endif
|
||||
000000d0 <trigger>:
|
||||
d0: 88 b3 in r24, 0x18 ; 24
|
||||
d2: 80 61 ori r24, 0x10 ; 16
|
||||
d4: 88 bb out 0x18, r24 ; 24
|
||||
d6: 81 e2 ldi r24, 0x21 ; 33
|
||||
d8: 8a 95 dec r24
|
||||
da: f1 f7 brne .-4 ; 0xd8 <trigger+0x8>
|
||||
dc: 00 00 nop
|
||||
de: 88 b3 in r24, 0x18 ; 24
|
||||
e0: 8f 7e andi r24, 0xEF ; 239
|
||||
e2: 88 bb out 0x18, r24 ; 24
|
||||
e4: 81 e2 ldi r24, 0x21 ; 33
|
||||
e6: 8a 95 dec r24
|
||||
e8: f1 f7 brne .-4 ; 0xe6 <trigger+0x16>
|
||||
ea: 00 00 nop
|
||||
ec: 08 95 ret
|
||||
|
||||
__builtin_avr_delay_cycles(__ticks_dc);
|
||||
c2: 81 e2 ldi r24, 0x21 ; 33
|
||||
c4: 8a 95 dec r24
|
||||
c6: f1 f7 brne .-4 ; 0xc4 <trigger+0x8>
|
||||
c8: 00 00 nop
|
||||
_delay_us(E_DELAY);
|
||||
CONTROLPORT &= ~GLCD_EN; //EN low
|
||||
ca: 88 b3 in r24, 0x18 ; 24
|
||||
cc: 8f 7d andi r24, 0xDF ; 223
|
||||
ce: 88 bb out 0x18, r24 ; 24
|
||||
d0: 81 e2 ldi r24, 0x21 ; 33
|
||||
d2: 8a 95 dec r24
|
||||
d4: f1 f7 brne .-4 ; 0xd2 <trigger+0x16>
|
||||
d6: 00 00 nop
|
||||
d8: 08 95 ret
|
||||
|
||||
000000da <glcd_on>:
|
||||
}
|
||||
//----------------------
|
||||
void glcd_on()
|
||||
{
|
||||
#ifdef GLCD_CS_ACTIVE_LOW
|
||||
CONTROLPORT &= ~CS1; //Activate both chips
|
||||
da: 88 b3 in r24, 0x18 ; 24
|
||||
dc: 8e 7f andi r24, 0xFE ; 254
|
||||
de: 88 bb out 0x18, r24 ; 24
|
||||
CONTROLPORT &= ~CS2;
|
||||
e0: 88 b3 in r24, 0x18 ; 24
|
||||
e2: 8d 7f andi r24, 0xFD ; 253
|
||||
e4: 88 bb out 0x18, r24 ; 24
|
||||
#else
|
||||
CONTROLPORT |= CS1; //Activate both chips
|
||||
CONTROLPORT |= CS2;
|
||||
#endif
|
||||
CONTROLPORT &= ~GLCD_RS; //RS low --> command
|
||||
e6: 88 b3 in r24, 0x18 ; 24
|
||||
e8: 8b 7f andi r24, 0xFB ; 251
|
||||
ea: 88 bb out 0x18, r24 ; 24
|
||||
CONTROLPORT &= ~GLCD_RW; //RW low --> write
|
||||
ec: 88 b3 in r24, 0x18 ; 24
|
||||
ee: 87 7f andi r24, 0xF7 ; 247
|
||||
f0: 88 bb out 0x18, r24 ; 24
|
||||
DATAPORT = 0x3F; //ON command
|
||||
f2: 8f e3 ldi r24, 0x3F ; 63
|
||||
f4: 85 bb out 0x15, r24 ; 21
|
||||
trigger();
|
||||
f6: e2 cf rjmp .-60 ; 0xbc <trigger>
|
||||
f8: 08 95 ret
|
||||
|
||||
000000fa <glcd_off>:
|
||||
000000ee <glcd_off>:
|
||||
}
|
||||
//----------------------
|
||||
void glcd_off()
|
||||
{
|
||||
#ifdef GLCD_CS_ACTIVE_LOW
|
||||
CONTROLPORT &= ~CS1; //Activate both chips
|
||||
fa: 88 b3 in r24, 0x18 ; 24
|
||||
fc: 8e 7f andi r24, 0xFE ; 254
|
||||
fe: 88 bb out 0x18, r24 ; 24
|
||||
ee: 88 b3 in r24, 0x18 ; 24
|
||||
f0: 8e 7f andi r24, 0xFE ; 254
|
||||
f2: 88 bb out 0x18, r24 ; 24
|
||||
CONTROLPORT &= ~CS2;
|
||||
100: 88 b3 in r24, 0x18 ; 24
|
||||
102: 8d 7f andi r24, 0xFD ; 253
|
||||
104: 88 bb out 0x18, r24 ; 24
|
||||
f4: 88 b3 in r24, 0x18 ; 24
|
||||
f6: 8d 7f andi r24, 0xFD ; 253
|
||||
f8: 88 bb out 0x18, r24 ; 24
|
||||
#else
|
||||
CONTROLPORT |= CS1; //Activate both chips
|
||||
CONTROLPORT |= CS2;
|
||||
#endif
|
||||
CONTROLPORT &= ~GLCD_RS; //DI low --> command
|
||||
106: 88 b3 in r24, 0x18 ; 24
|
||||
108: 8b 7f andi r24, 0xFB ; 251
|
||||
10a: 88 bb out 0x18, r24 ; 24
|
||||
CONTROLPORT &= ~GLCD_RW; //RW low --> write
|
||||
10c: 88 b3 in r24, 0x18 ; 24
|
||||
10e: 87 7f andi r24, 0xF7 ; 247
|
||||
110: 88 bb out 0x18, r24 ; 24
|
||||
DATAPORT = 0x3E; //OFF command
|
||||
112: 8e e3 ldi r24, 0x3E ; 62
|
||||
114: 85 bb out 0x15, r24 ; 21
|
||||
CONTROLPORT = ~GLCD_RST | ~GLCD_RW; //RS low --> command
|
||||
fa: 8f ef ldi r24, 0xFF ; 255
|
||||
fc: 88 bb out 0x18, r24 ; 24
|
||||
DATAPORT = 0b0011110; //OFF command
|
||||
fe: 8e e1 ldi r24, 0x1E ; 30
|
||||
100: 85 bb out 0x15, r24 ; 21
|
||||
trigger();
|
||||
116: d2 cf rjmp .-92 ; 0xbc <trigger>
|
||||
118: 08 95 ret
|
||||
102: e6 cf rjmp .-52 ; 0xd0 <trigger>
|
||||
104: 08 95 ret
|
||||
|
||||
00000106 <main>:
|
||||
}
|
||||
|
||||
|
||||
0000011a <main>:
|
||||
int main(void)
|
||||
{
|
||||
while (1)
|
||||
{
|
||||
|
||||
glcd_on();
|
||||
11a: df df rcall .-66 ; 0xda <glcd_on>
|
||||
wait(2000);
|
||||
11c: 80 ed ldi r24, 0xD0 ; 208
|
||||
11e: 97 e0 ldi r25, 0x07 ; 7
|
||||
glcd_off();
|
||||
120: be df rcall .-132 ; 0x9e <wait>
|
||||
wait(2000);
|
||||
122: eb df rcall .-42 ; 0xfa <glcd_off>
|
||||
124: 80 ed ldi r24, 0xD0 ; 208
|
||||
126: 97 e0 ldi r25, 0x07 ; 7
|
||||
128: ba df rcall .-140 ; 0x9e <wait>
|
||||
12a: f7 cf rjmp .-18 ; 0x11a <main>
|
||||
GLCD_init();
|
||||
106: da df rcall .-76 ; 0xbc <GLCD_init>
|
||||
glcd_off();
|
||||
108: f2 df rcall .-28 ; 0xee <glcd_off>
|
||||
10a: ff cf rjmp .-2 ; 0x10a <main+0x4>
|
||||
|
||||
0000012c <_exit>:
|
||||
12c: f8 94 cli
|
||||
0000010c <_exit>:
|
||||
10c: f8 94 cli
|
||||
|
||||
0000012e <__stop_program>:
|
||||
12e: ff cf rjmp .-2 ; 0x12e <__stop_program>
|
||||
0000010e <__stop_program>:
|
||||
10e: ff cf rjmp .-2 ; 0x10e <__stop_program>
|
||||
|
||||
@@ -10,6 +10,10 @@ Discarded input sections
|
||||
.text 0x00000000 0x0 main.o
|
||||
.data 0x00000000 0x0 main.o
|
||||
.bss 0x00000000 0x0 main.o
|
||||
.text.wait_us 0x00000000 0x1a main.o
|
||||
.text.GLCD_command
|
||||
0x00000000 0x2c main.o
|
||||
.text.glcd_on 0x00000000 0x1a main.o
|
||||
.text 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o)
|
||||
.data 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o)
|
||||
.bss 0x00000000 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o)
|
||||
@@ -153,7 +157,7 @@ END GROUP
|
||||
.rela.plt
|
||||
*(.rela.plt)
|
||||
|
||||
.text 0x00000000 0x130
|
||||
.text 0x00000000 0x110
|
||||
*(.vectors)
|
||||
.vectors 0x00000000 0x8c C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o
|
||||
0x00000000 __vector_default
|
||||
@@ -247,20 +251,21 @@ END GROUP
|
||||
*(.text.*)
|
||||
.text.wait 0x0000009e 0x1e main.o
|
||||
0x0000009e wait
|
||||
.text.trigger 0x000000bc 0x1e main.o
|
||||
0x000000bc trigger
|
||||
.text.glcd_on 0x000000da 0x20 main.o
|
||||
0x000000da glcd_on
|
||||
.text.GLCD_init
|
||||
0x000000bc 0x14 main.o
|
||||
0x000000bc GLCD_init
|
||||
.text.trigger 0x000000d0 0x1e main.o
|
||||
0x000000d0 trigger
|
||||
.text.glcd_off
|
||||
0x000000fa 0x20 main.o
|
||||
0x000000fa glcd_off
|
||||
.text.main 0x0000011a 0x12 main.o
|
||||
0x0000011a main
|
||||
0x0000012c . = ALIGN (0x2)
|
||||
0x000000ee 0x18 main.o
|
||||
0x000000ee glcd_off
|
||||
.text.main 0x00000106 0x6 main.o
|
||||
0x00000106 main
|
||||
0x0000010c . = ALIGN (0x2)
|
||||
*(.fini9)
|
||||
.fini9 0x0000012c 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o)
|
||||
0x0000012c _exit
|
||||
0x0000012c exit
|
||||
.fini9 0x0000010c 0x0 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o)
|
||||
0x0000010c _exit
|
||||
0x0000010c exit
|
||||
*(.fini9)
|
||||
*(.fini8)
|
||||
*(.fini8)
|
||||
@@ -279,11 +284,11 @@ END GROUP
|
||||
*(.fini1)
|
||||
*(.fini1)
|
||||
*(.fini0)
|
||||
.fini0 0x0000012c 0x4 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o)
|
||||
.fini0 0x0000010c 0x4 c:/program files (x86)/atmel/studio/7.0/toolchain/avr8/avr8-gnu-toolchain/bin/../lib/gcc/avr/5.4.0/avr51\libgcc.a(_exit.o)
|
||||
*(.fini0)
|
||||
0x00000130 _etext = .
|
||||
0x00000110 _etext = .
|
||||
|
||||
.data 0x00800100 0x0 load address 0x00000130
|
||||
.data 0x00800100 0x0 load address 0x00000110
|
||||
[!provide] PROVIDE (__data_start, .)
|
||||
*(.data)
|
||||
*(.data*)
|
||||
@@ -301,8 +306,8 @@ END GROUP
|
||||
*(.bss*)
|
||||
*(COMMON)
|
||||
[!provide] PROVIDE (__bss_end, .)
|
||||
0x00000130 __data_load_start = LOADADDR (.data)
|
||||
0x00000130 __data_load_end = (__data_load_start + SIZEOF (.data))
|
||||
0x00000110 __data_load_start = LOADADDR (.data)
|
||||
0x00000110 __data_load_end = (__data_load_start + SIZEOF (.data))
|
||||
|
||||
.noinit 0x00800100 0x0
|
||||
[!provide] PROVIDE (__noinit_start, .)
|
||||
@@ -373,42 +378,42 @@ END GROUP
|
||||
.debug_sfnames
|
||||
*(.debug_sfnames)
|
||||
|
||||
.debug_aranges 0x00000000 0x40
|
||||
.debug_aranges 0x00000000 0x58
|
||||
*(.debug_aranges)
|
||||
.debug_aranges
|
||||
0x00000000 0x40 main.o
|
||||
0x00000000 0x58 main.o
|
||||
|
||||
.debug_pubnames
|
||||
*(.debug_pubnames)
|
||||
|
||||
.debug_info 0x00000000 0xa18
|
||||
.debug_info 0x00000000 0xaeb
|
||||
*(.debug_info .gnu.linkonce.wi.*)
|
||||
.debug_info 0x00000000 0x780 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o
|
||||
.debug_info 0x00000780 0x298 main.o
|
||||
.debug_info 0x00000780 0x36b main.o
|
||||
|
||||
.debug_abbrev 0x00000000 0x882
|
||||
.debug_abbrev 0x00000000 0x891
|
||||
*(.debug_abbrev)
|
||||
.debug_abbrev 0x00000000 0x718 C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o
|
||||
.debug_abbrev 0x00000718 0x16a main.o
|
||||
.debug_abbrev 0x00000718 0x179 main.o
|
||||
|
||||
.debug_line 0x00000000 0x369
|
||||
.debug_line 0x00000000 0x3e0
|
||||
*(.debug_line .debug_line.* .debug_line_end)
|
||||
.debug_line 0x00000000 0x16a C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o
|
||||
.debug_line 0x0000016a 0x1ff main.o
|
||||
.debug_line 0x0000016a 0x276 main.o
|
||||
|
||||
.debug_frame 0x00000000 0x64
|
||||
.debug_frame 0x00000000 0x94
|
||||
*(.debug_frame)
|
||||
.debug_frame 0x00000000 0x64 main.o
|
||||
.debug_frame 0x00000000 0x94 main.o
|
||||
|
||||
.debug_str 0x00000000 0x463
|
||||
.debug_str 0x00000000 0x45b
|
||||
*(.debug_str)
|
||||
.debug_str 0x00000000 0x27d C:/Program Files (x86)/Atmel/Studio/7.0/Packs/atmel/ATmega_DFP/1.6.364/gcc/dev/atmega128/avr51/crtatmega128.o
|
||||
.debug_str 0x0000027d 0x1e6 main.o
|
||||
0x21a (size before relaxing)
|
||||
.debug_str 0x0000027d 0x1de main.o
|
||||
0x21f (size before relaxing)
|
||||
|
||||
.debug_loc 0x00000000 0xf4
|
||||
.debug_loc 0x00000000 0x189
|
||||
*(.debug_loc)
|
||||
.debug_loc 0x00000000 0xf4 main.o
|
||||
.debug_loc 0x00000000 0x189 main.o
|
||||
|
||||
.debug_macinfo
|
||||
*(.debug_macinfo)
|
||||
@@ -428,9 +433,9 @@ END GROUP
|
||||
.debug_pubtypes
|
||||
*(.debug_pubtypes)
|
||||
|
||||
.debug_ranges 0x00000000 0x30
|
||||
.debug_ranges 0x00000000 0x48
|
||||
*(.debug_ranges)
|
||||
.debug_ranges 0x00000000 0x30 main.o
|
||||
.debug_ranges 0x00000000 0x48 main.o
|
||||
|
||||
.debug_macro
|
||||
*(.debug_macro)
|
||||
|
||||
@@ -8,14 +8,12 @@ S113005025C0000023C0000021C000001FC0000014
|
||||
S11300601DC000001BC0000019C0000017C0000024
|
||||
S113007015C0000013C0000011C000000FC0000034
|
||||
S11300800DC000000BC0000009C0000011241FBEF9
|
||||
S1130090CFEFD0E1DEBFCDBF40D048C0B1CF20E02C
|
||||
S1130090CFEFD0E1DEBFCDBF36D038C0B1CF20E046
|
||||
S11300A030E008C0E3ECF9E03197F1F700C000005C
|
||||
S11300B02F5F3F4F28173907ACF3089588B3806248
|
||||
S11300C088BB81E28A95F1F7000088B38F7D88BBF5
|
||||
S11300D081E28A95F1F70000089588B38E7F88BB8A
|
||||
S11300E088B38D7F88BB88B38B7F88BB88B3877FB9
|
||||
S11300F088BB8FE385BBE2CF089588B38E7F88BB2E
|
||||
S113010088B38D7F88BB88B38B7F88BB88B3877F98
|
||||
S113011088BB8EE385BBD2CF0895DFDF80ED97E007
|
||||
S1130120BEDFEBDF80ED97E0BADFF7CFF894FFCFC7
|
||||
S11300B02F5F3F4F28173907ACF308958FEF84BBA8
|
||||
S11300C087BB88B38B6088BB84E190E0E8CF089558
|
||||
S11300D088B3806188BB81E28A95F1F7000088B318
|
||||
S11300E08F7E88BB81E28A95F1F70000089588B37A
|
||||
S11300F08E7F88BB88B38D7F88BB8FEF88BB8EE1F2
|
||||
S113010085BBE6CF0895DADFF2DFFFCFF894FFCFA7
|
||||
S9030000FC
|
||||
|
||||
Binary file not shown.
@@ -34,13 +34,14 @@ typedef unsigned char byte;
|
||||
#define E_DELAY 10
|
||||
#define DATAPORT PORTC
|
||||
#define CONTROLPORT PORTB
|
||||
#define CONTTROLDDR DDRB
|
||||
#define DATADDR DDRC
|
||||
#define DATAPIN PINC
|
||||
#define GLCD_CS1 (1<<0)
|
||||
#define GLCD_CS2 (1<<1)
|
||||
#define GLCD_RS (1<<2)
|
||||
#define GLCD_RW (1<<3)
|
||||
#define GLCD_EN (1<<5)
|
||||
#define GLCD_RST (1<<3)
|
||||
#define GLCD_RW (1<<2)
|
||||
#define GLCD_EN (1<<4)
|
||||
#define GLCD_CS_ACTIVE_LOW 1 //Define this if your GLCD CS
|
||||
//is active low (refer to datasheet)
|
||||
|
||||
@@ -53,6 +54,40 @@ void wait( int ms )
|
||||
}
|
||||
}
|
||||
|
||||
void wait_us(int us)
|
||||
{
|
||||
for (int i=0; i<us; i++)
|
||||
{
|
||||
_delay_us( 1 ); // library function (max 30 ms at 8MHz)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void GLCD_init()
|
||||
{
|
||||
|
||||
DATADDR = 0xFF; // port c all output
|
||||
CONTTROLDDR = 0xFF; // PORTB all output
|
||||
CONTROLPORT |= (GLCD_CS1) | (GLCD_CS2) | (GLCD_RST);
|
||||
|
||||
wait(20);
|
||||
|
||||
}
|
||||
|
||||
void GLCD_command(char command)
|
||||
{
|
||||
DATAPORT = command;
|
||||
CONTROLPORT &= ~GLCD_RST;
|
||||
CONTROLPORT &= ~GLCD_RW;
|
||||
CONTROLPORT |= GLCD_EN;
|
||||
|
||||
wait_us(5);
|
||||
|
||||
CONTROLPORT &= ~GLCD_EN;
|
||||
wait_us(5);
|
||||
|
||||
}
|
||||
|
||||
void trigger()
|
||||
{
|
||||
CONTROLPORT |= GLCD_EN; //EN high
|
||||
@@ -70,9 +105,8 @@ void glcd_on()
|
||||
CONTROLPORT |= CS1; //Activate both chips
|
||||
CONTROLPORT |= CS2;
|
||||
#endif
|
||||
CONTROLPORT &= ~GLCD_RS; //RS low --> command
|
||||
CONTROLPORT &= ~GLCD_RW; //RW low --> write
|
||||
DATAPORT = 0x3F; //ON command
|
||||
CONTROLPORT = ~GLCD_RST | ~GLCD_RW; //RS low --> command
|
||||
DATAPORT = 0b0011111; //OFF command
|
||||
trigger();
|
||||
}
|
||||
//----------------------
|
||||
@@ -85,22 +119,20 @@ void glcd_off()
|
||||
CONTROLPORT |= CS1; //Activate both chips
|
||||
CONTROLPORT |= CS2;
|
||||
#endif
|
||||
CONTROLPORT &= ~GLCD_RS; //DI low --> command
|
||||
CONTROLPORT &= ~GLCD_RW; //RW low --> write
|
||||
DATAPORT = 0x3E; //OFF command
|
||||
CONTROLPORT = ~GLCD_RST | ~GLCD_RW; //RS low --> command
|
||||
DATAPORT = 0b0011110; //OFF command
|
||||
trigger();
|
||||
}
|
||||
|
||||
|
||||
int main(void)
|
||||
{
|
||||
GLCD_init();
|
||||
glcd_off();
|
||||
while (1)
|
||||
{
|
||||
|
||||
glcd_on();
|
||||
wait(2000);
|
||||
glcd_off();
|
||||
wait(2000);
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user