Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

[SOLVED] GLCD ampire 128x64 problem

Status
Not open for further replies.

hafizimran18

Member level 4
Member level 4
Joined
Aug 10, 2012
Messages
69
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,780
i want to interface ampire 128x64 glcd with pic18f4515 i have mikroC compiler and proteus 6.9 , code is not working, please help me

Proteus diagram:




CODE:


// ------------------------------------------------------
// GLCD Picture name: bank.bmp
// GLCD Model: KS0108 128x64
// ------------------------------------------------------

const code char bank[1024] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 64, 128, 0, 98, 68, 8, 16, 0, 128, 72, 132, 0, 0, 96, 32, 0, 192, 64, 0, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 16, 132, 121, 4, 3, 1, 128, 0, 0, 0, 0, 0, 0, 0, 24, 23, 16, 0, 0, 0, 32, 32, 64, 128, 128, 1, 34, 156, 112, 128, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 128, 0, 64, 192, 0, 96, 64, 16, 64, 96, 32, 128, 64, 0, 128, 0, 0, 0, 0, 0, 0, 32, 16, 0, 0, 0, 4, 0, 0, 0, 3, 0, 3, 0, 4, 4, 6, 8, 16, 112, 192, 0, 0, 0, 0, 0, 0, 0, 0, 128, 32, 0, 0, 8, 1, 7, 6, 4, 6, 4, 7, 4, 4, 0, 8, 8, 16, 112, 192, 0, 0, 0, 0, 0, 0, 0, 0, 240, 0, 0, 122, 122, 0, 64, 0, 2, 0, 4, 248, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 128, 128, 0, 64, 128, 0, 96, 128, 48, 96, 24, 24, 32, 12, 20, 18, 6, 12, 3, 7, 4, 3, 3, 26, 1, 31, 125, 60, 60, 60, 125, 25, 6, 2, 3, 5, 4, 2, 9, 12, 6, 18, 10, 36, 48, 64, 96, 48, 192, 192, 32, 160, 192, 64, 16, 144, 0, 8, 8, 4, 6, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 32, 32, 32, 32, 32, 0, 16, 16, 8, 12, 6, 3, 128, 128, 128, 0, 0, 192, 192, 128, 255, 0, 0, 7, 69, 8, 192, 135, 0, 0, 128, 255, 8, 224, 240, 240, 224, 192, 192, 128, 0, 0, 0, 0, 0, 0,
0, 0, 0, 1, 1, 1, 129, 1, 63, 33, 33, 33, 33, 123, 63, 37, 37, 37, 63, 187, 33, 33, 33, 57, 37, 35, 163, 39, 47, 61, 57, 49, 33, 35, 63, 39, 37, 45, 57, 57, 63, 63, 33, 33, 59, 127, 63, 37, 37, 37, 47, 59, 57, 49, 225, 33, 33, 33, 33, 63, 33, 1, 192, 0, 224, 32, 32, 0, 0, 0, 48, 48, 32, 0, 136, 152, 152, 16, 128, 140, 76, 72, 64, 0, 198, 230, 36, 32, 0, 3, 227, 242, 16, 16, 1, 1, 9, 248, 248, 0, 0, 4, 255, 0, 0, 141, 136, 152, 144, 61, 1, 0, 218, 255, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 254, 252, 252, 248,
0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 255, 86, 0, 0, 0, 0, 255, 0, 0, 0, 0, 255, 255, 16, 172, 244, 62, 37, 39, 35, 34, 34, 226, 34, 34, 34, 35, 37, 38, 58, 228, 248, 0, 255, 255, 0, 0, 0, 255, 255, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 255, 2, 0, 0, 127, 65, 65, 0, 63, 63, 0, 0, 32, 32, 63, 63, 0, 128, 128, 128, 159, 159, 144, 144, 128, 128, 143, 143, 136, 8, 72, 72, 64, 199, 71, 192, 192, 4, 15, 0, 16, 5, 33, 34, 38, 32, 48, 0, 15, 6, 0, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255, 255,
0, 0, 0, 0, 0, 0, 64, 64, 127, 64, 64, 64, 64, 127, 107, 64, 64, 64, 64, 127, 64, 64, 64, 64, 127, 127, 64, 84, 127, 64, 64, 64, 64, 64, 64, 127, 64, 64, 64, 64, 64, 64, 64, 127, 127, 64, 127, 127, 64, 64, 64, 127, 127, 64, 64, 127, 64, 64, 64, 64, 64, 64, 64, 240, 255, 0, 0, 0, 0, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 64, 255, 255, 0, 16, 16, 16, 16, 16, 16, 16, 255, 0, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 63, 255, 15, 255, 255, 255, 255, 255, 255, 255, 255, 255,
0, 0, 0, 0, 0, 0, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 6, 0, 0, 0, 0, 0, 63, 43, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 47, 32, 63, 63, 32, 32, 32, 32, 32, 32, 32, 32, 63, 32, 47, 47, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 40, 63, 32, 32, 32, 47, 63, 47, 47, 63, 63, 63, 63, 63,
};
//' ------------------------------------------------------
//' GLCD Picture name: mailbx.bmp
//' GLCD Model: KS0108 128x64
//' ------------------------------------------------------

const code char mailbox[1024] = {
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 28, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 126, 254, 254, 254, 254, 254, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 240, 16, 16, 144, 16, 16, 0, 144, 128, 128, 0, 0, 0, 96, 112, 240, 208, 96, 48, 24, 8, 16, 16, 32, 32, 32, 64, 64, 128, 128, 0, 0, 0, 0, 0, 0, 224, 16, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 15, 15, 15, 15, 15, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 8, 24, 240, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 15, 8, 8, 136, 136, 72, 74, 72, 40, 42, 8, 24, 24, 8, 62, 53, 56, 8, 8, 18, 16, 37, 37, 66, 242, 28, 30, 120, 120, 56, 28, 31, 31, 30, 154, 30, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 127, 6, 56, 64, 56, 6, 127, 64, 56, 22, 17, 22, 56, 64, 0, 127, 0, 0, 127, 64, 64, 64, 64, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 1, 3, 4, 24, 48, 96, 64, 0, 68, 64, 42, 34, 21, 85, 73, 72, 72, 68, 68, 66, 66, 64, 65, 95, 80, 80, 80, 80, 80, 81, 81, 83, 82, 82, 83, 127, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 96, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 224, 32, 32, 32, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 3, 3, 3, 7, 7, 15, 15, 31, 31, 31, 63, 63, 127, 127, 125, 253, 253, 249, 249, 241, 241, 241, 225, 225, 193, 193, 129, 129, 129, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 3, 3, 7, 7, 7, 15, 15, 31, 31, 31, 63, 63, 126, 126, 124, 252, 252, 248, 248, 240, 240, 224, 224, 224, 255, 255, 255, 255, 255, 255, 255, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 3, 3, 7, 7, 7, 15, 15, 31, 31, 63, 63, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
};



// Glcd module connections
char GLCD_DataPort at PORTD;
sbit GLCD_CS1 at RB0_bit;
sbit GLCD_CS2 at RB1_bit;
sbit GLCD_RS at RB2_bit;
sbit GLCD_RW at RB3_bit;
sbit GLCD_EN at RB4_bit;
sbit GLCD_RST at RB5_bit;
sbit GLCD_CS1_Direction at TRISB0_bit;
sbit GLCD_CS2_Direction at TRISB1_bit;
sbit GLCD_RS_Direction at TRISB2_bit;
sbit GLCD_RW_Direction at TRISB3_bit;
sbit GLCD_EN_Direction at TRISB4_bit;
sbit GLCD_RST_Direction at TRISB5_bit;
// End Glcd module connections

void main()
{
TRISD = 0x00;
TRISB = 0x00;
Glcd_Init();
while(1)
{
Glcd_Image(mailbox);
Delay_ms(1000);
Glcd_Image(bank);
Delay_ms(1000);
}
}
 

Hi,

It does work, here is one we did earlier, though the code will be of little use to you as its in assembly.

However you can see the connections needed for simulation.

Think if you search this forum you wil find some code in mikro C as its a common project.
 

Attachments

  • ScreenShot001.jpg
    ScreenShot001.jpg
    176.6 KB · Views: 233

hi,

Looks there and normal to me ...?

You have to be logged in to see it, did you look in my post after you logging in to reply ?

Screenshot below here -
 

Attachments

  • ScreenShot001.jpg
    ScreenShot001.jpg
    90.1 KB · Views: 110

thanks a lot dear , a have burned .hex file and its working , now can you please tell me if the assembly code is full or just the main portion of full code??
and also tell which assembler have you used for it??? actually i am new with glcd and i want to understand its programming i were in the search of a good circuit and code , now i have found both.........thanks to you once again
here is my working glcd



- - - Updated - - -

thanks dear, i have also checked assembly code on mplab ide, its full code, its working ,,,,,, now i will understand the project............ thanks once again
 

thanks a lot dear , a have burned .hex file and its working , now can you please tell me if the assembly code is full or just the main portion of full code??
and also tell which assembler have you used for it??? actually i am new with glcd and i want to understand its programming i were in the search of a good circuit and code , now i have found both.........thanks to you once again
here is my working glcd


Hi,

Glad that it worked ok for you.

The assembler code is exactly what you see on the screen as a complete project, the images were from other demo projects.

The Assembly code I was created by the integral Assembler of MPLAB IDE which you can download for free. MPlab 8.86
That will produce an exact copy of the .hex file.
**broken link removed**

You might have to make minor adjustments to the code for your 4515 chip, probably just these two opening lines.

LIST P=18F4520,r=hex,n=80,x=off,st=off
errorlevel -302 ; no bank warnings

#include <P18F4520.INC>


That lcd is veryy old technology using two controllers each displaying one half of the screen - its a pain to program.

If you are using C then its easier to use as C does all the hard work for you; there are plenty of C examples around as I mentioned earlier.
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top