Need helps to how to interface PIC16F877A with graphic LCD

Discussion about projects that used PIC Microcontroller, Hardware Interface, Programming Algorithm and etc......

Need helps to how to interface PIC16F877A with graphic LCD

Postby sengyee88 » Tue Mar 01, 2011 6:09 pm

Hello, I just bought a Graphic LCD from Cytron but i'm having problem using it with PIC16F877A.
In my project, first thing to start off with is interface PIC16F877A with 2x16 LCD display, it's done. Now, it has to proceed to another level where need to interface the PIC with Graphic LCD in order to display image captured from the webcam. Currently, I get stucked in this level and i have problem with it.

1st Q: what is the driver for that glcd? TG12864E, HD61202, KS0108, T6963C, SED1330 or ST7920?
2nd Q: how to connect the PIC16f877a to the glcd pins as i just need a simple image display on the glcd?
3rd Q: As the schematic is given in the PR21, how should i change it as what i need in the 2nd Q
4th Q: Is that possible to exchange the PIC18F452 in PR21 to PIC16F877A?

Plz help! TQ
sengyee88
Novice
 
Posts: 19
Joined: Tue Mar 01, 2011 3:36 pm

Re: Need helps to how to interface PIC16F877A with graphic L

Postby ober » Tue Mar 01, 2011 8:46 pm

Hi, you can try searching the forum for related topic. Here you go http://forum.cytron.com.my/viewtopic.php?f=21&t=10722&start=10&hilit=graphic+LCD
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: Need helps to how to interface PIC16F877A with graphic L

Postby Brian Griffin » Tue Mar 01, 2011 8:56 pm

sengyee88 WROTE:Hello, I just bought a Graphic LCD from Cytron but i'm having problem using it with PIC16F877A.
In my project, first thing to start off with is interface PIC16F877A with 2x16 LCD display, it's done. Now, it has to proceed to another level where need to interface the PIC with Graphic LCD in order to display image captured from the webcam. Currently, I get stucked in this level and i have problem with it.

1st Q: what is the driver for that glcd? TG12864E, HD61202, KS0108, T6963C, SED1330 or ST7920?
2nd Q: how to connect the PIC16f877a to the glcd pins as i just need a simple image display on the glcd?
3rd Q: As the schematic is given in the PR21, how should i change it as what i need in the 2nd Q
4th Q: Is that possible to exchange the PIC18F452 in PR21 to PIC16F877A?

Plz help! TQ


1: That's ST7920. Wait... you want to display the image captured from the webcam? Hmm... you do realize that the GLCDs are 1-bit colour, and from the webcams, they are at least 8-bit colour and a much higher resolution. Unless if you do some thresholding and some filtering to convert the image first and then load it up to the microcontroller.

2: You just connect them. Find an empty 8-bit Port, and find another a few more pins on the microcontroller for the control (reset, enable, read/write, serial enabled/disabled).

3. I don't think you need to change it as you are using the PR21 kit from Cytron. The circuit board has already lines routed to specific pins of the microcontroller.

4. They are almost pin-compatible. So, you need to make very careful modifications of the program.
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: Need helps to how to interface PIC16F877A with graphic L

Postby sengyee88 » Tue Mar 01, 2011 11:07 pm

1: That's ST7920. Wait... you want to display the image captured from the webcam? Hmm... you do realize that the GLCDs are 1-bit colour, and from the webcams, they are at least 8-bit colour and a much higher resolution. Unless if you do some thresholding and some filtering to convert the image first and then load it up to the microcontroller.

2: You just connect them. Find an empty 8-bit Port, and find another a few more pins on the microcontroller for the control (reset, enable, read/write, serial enabled/disabled).

3. I don't think you need to change it as you are using the PR21 kit from Cytron. The circuit board has already lines routed to specific pins of the microcontroller.

4. They are almost pin-compatible. So, you need to make very careful modifications of the program.


1: Yes. i got what you meant for the image captured that firstly have to convert it to binary image which is black and white only. So what does the "TG12864E" mentioned in the datasheet meant?
2: Alright
3: Opps Sorry! i forgot to mention that i did not buy the whole PR21 kit, i just bought the glcd only.
In the PR21 schematic, there is a ADXL330 Accelerometer part, for my hardware implementation, do i need the ADXL330 Accelerometer? actually i'm so confusing on how does the ADXL330 Accelerometer work.
4: Alright. Thanks
Q5: For the extension from Q1, so do you think it's possible to display the image captured in binary format on the glcd without adding any other components?

Thanks Brian!
sengyee88
Novice
 
Posts: 19
Joined: Tue Mar 01, 2011 3:36 pm

Re: Need helps to how to interface PIC16F877A with graphic L

Postby Brian Griffin » Wed Mar 02, 2011 12:35 am

sengyee88 WROTE:1: Yes. i got what you meant for the image captured that firstly have to convert it to binary image which is black and white only. So what does the "TG12864E" mentioned in the datasheet meant?
2: Alright
3: Opps Sorry! i forgot to mention that i did not buy the whole PR21 kit, i just bought the glcd only.
In the PR21 schematic, there is a ADXL330 Accelerometer part, for my hardware implementation, do i need the ADXL330 Accelerometer? actually i'm so confusing on how does the ADXL330 Accelerometer work.
4: Alright. Thanks
Q5: For the extension from Q1, so do you think it's possible to display the image captured in binary format on the glcd without adding any other components?
Thanks Brian!


1: It's the model number and code of the 128x64 GLCD.

2. And one more note, the GLCD you buy from Cytron is a bit special. If you keep reading, it has a serial interface and it has character ROM, so if you plan to save the number of pins, use the serial interface instead. The datasheet gives you clues there.

You can print characters (latin), arabic numbers and chinese words inside as well without worrying about loading up the character data into the GLCD.

5: Yes you can. I browsed through the datasheet. To do so, form a driver program first. You fill up the whole screen first with 1s (lighted pixel) and then 0s (not lighted pixel) as a test. If you managed to do that, then you form an array (1024-byte), get the picture, resize it, and then threshold it to binary image, and finally, use some programs (available in internet) and convert it to an array.

I don't know whether they have libraries for that ST7920. But you can find KS0108 libraries almost everywhere. 8-)
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: Need helps to how to interface PIC16F877A with graphic L

Postby ober » Wed Mar 02, 2011 9:34 am

sengyee88 WROTE:Hello, I just bought a Graphic LCD from Cytron but i'm having problem using it with PIC16F877A.
In my project, first thing to start off with is interface PIC16F877A with 2x16 LCD display, it's done. Now, it has to proceed to another level where need to interface the PIC with Graphic LCD in order to display image captured from the webcam. Currently, I get stucked in this level and i have problem with it.


Just curious to know the method to extract the image from webcam? Because normally webcam is USB device and you need a USB host of OTG to communicate with it, PIC16F877A does not provide that. Or you have a device as a bridge to grab that image and send to PIC16F?
Ober Choo
Cytron Technologies Sdn Bhd
www.cytron.com.my
User avatar
ober
Moderator
 
Posts: 1486
Joined: Wed Apr 15, 2009 1:03 pm

Re: Need helps to how to interface PIC16F877A with graphic L

Postby sengyee88 » Wed Mar 02, 2011 10:48 am

Just curious to know the method to extract the image from webcam? Because normally webcam is USB device and you need a USB host of OTG to communicate with it, PIC16F877A does not provide that. Or you have a device as a bridge to grab that image and send to PIC16F?

Hi Ober, actually it's not USB webcam, it's laptop webcam, is already built in! I did the binary image conversion using MATLAB. I did the first try on the 2x16 LCD display, where it using used the 8 CGRAM adddress. For this moment, i have to change the LCD to glcd. It may need some programming on the connection between the PIC16F and webcam through serial port(RS232) or UART. i'm not sure the USB to UART converter from Cytron able to work or not. Will it possible to use it as the bridge to grab that image?

Thanks Ober!
sengyee88
Novice
 
Posts: 19
Joined: Tue Mar 01, 2011 3:36 pm

Re: Need helps to how to interface PIC16F877A with graphic L

Postby sengyee88 » Wed Mar 02, 2011 10:57 am

1: It's the model number and code of the 128x64 GLCD.

2. And one more note, the GLCD you buy from Cytron is a bit special. If you keep reading, it has a serial interface and it has character ROM, so if you plan to save the number of pins, use the serial interface instead. The datasheet gives you clues there.

You can print characters (latin), arabic numbers and chinese words inside as well without worrying about loading up the character data into the GLCD.

5: Yes you can. I browsed through the datasheet. To do so, form a driver program first. You fill up the whole screen first with 1s (lighted pixel) and then 0s (not lighted pixel) as a test. If you managed to do that, then you form an array (1024-byte), get the picture, resize it, and then threshold it to binary image, and finally, use some programs (available in internet) and convert it to an array.

I don't know whether they have libraries for that ST7920. But you can find KS0108 libraries almost everywhere. 8-)


1: Alright.
2: Since you said the GLCD from Cytron is a bit special, so it's a better GLCD compared with others model?
3: In the PR21 schematic, there is a ADXL330 Accelerometer part, for my hardware implementation, do i need the ADXL330 Accelerometer? actually i'm so confusing on how does the ADXL330 Accelerometer work.
5: So, how to form a driver program? what's the programs you meant that available in internet? I'm pretty blur on this problem.
Yes. I knew there are a lots of KS0108 libraries, but i could hardly find for ST7920 libraries.

Thanks Brian!
sengyee88
Novice
 
Posts: 19
Joined: Tue Mar 01, 2011 3:36 pm

Re: Need helps to how to interface PIC16F877A with graphic L

Postby Brian Griffin » Wed Mar 02, 2011 2:05 pm

sengyee88 WROTE:1: Alright.
2: Since you said the GLCD from Cytron is a bit special, so it's a better GLCD compared with others model?
3: In the PR21 schematic, there is a ADXL330 Accelerometer part, for my hardware implementation, do i need the ADXL330 Accelerometer? actually i'm so confusing on how does the ADXL330 Accelerometer work.
5: So, how to form a driver program? what's the programs you meant that available in internet? I'm pretty blur on this problem.
Yes. I knew there are a lots of KS0108 libraries, but i could hardly find for ST7920 libraries.
Thanks Brian!


2. Mostly people would use the KS0108 controller for the GLCD, but I may be wrong. The ST7920 controller has character generator ROM which you can print characters inside without having to define your GLCD fonts and ways and means of printing it out on the screen, which takes up quite some program space.

The disadvantage is, you can't have custom fonts inside - they are fixed in the LCD. Unless if you make another driver for that...

3. Refer to the datasheet. They may have given you a list of commands or instructions if they are I2C or SPI.

5. "Driver program" means a software with a fragment of the code to be tested.

The ST7920 is rare due to the presence of the ability of printing characters, as I told you previously, and it's much direct and easier to use than the KS0108. However, I haven't actually used the ST7920 since I don't have those in my hands right now.
PIC - UIC00B from Cytron (replacement for my broken PICKit 2), Pickit 3, MikroC for PIC
dsPIC - MikroC for dsPIC, mikromedia board (dsPIC33)
AVR - AVR Dragon
Parallax - Prop tool
User avatar
Brian Griffin
Enthusiast
 
Posts: 403
Joined: Mon Jan 17, 2011 9:36 am

Re: Need helps to how to interface PIC16F877A with graphic L

Postby sengyee88 » Wed Mar 02, 2011 8:28 pm

2. Mostly people would use the KS0108 controller for the GLCD, but I may be wrong. The ST7920 controller has character generator ROM which you can print characters inside without having to define your GLCD fonts and ways and means of printing it out on the screen, which takes up quite some program space.

The disadvantage is, you can't have custom fonts inside - they are fixed in the LCD. Unless if you make another driver for that...

3. Refer to the datasheet. They may have given you a list of commands or instructions if they are I2C or SPI.

5. "Driver program" means a software with a fragment of the code to be tested.

The ST7920 is rare due to the presence of the ability of printing characters, as I told you previously, and it's much direct and easier to use than the KS0108. However, I haven't actually used the ST7920 since I don't have those in my hands right now.


Opppss.. i'm getting more confuse about the driver and controller. So with the GLCD i bought from Cytron, can i use KS0108?
sengyee88
Novice
 
Posts: 19
Joined: Tue Mar 01, 2011 3:36 pm

Next

Return to PIC Microcontroller

Who is online

Users browsing this forum: No registered users and 3 guests

cron