Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Parallel GLCD with 20-pin PIC

jpanhalt

Well-Known Member
Most Helpful Member
I got the mechanics/math for my inclinometer working earlier in the week and have temperature, tilt, and re-zero working in simulation.

Today I turned to my graphic display. It is a New Haven Display, NHD-12864MZ and uses the KS0108 controller. The PIC's I have available are the 16F690 and 16F1829. Both are just 20-pin devices.

It appears most people use a single port to drive the display data pins DB0-DB7. I have assigned PortC to that. Six pins are needed for control functions, but I do not have 6 pins on the same port for doing that.

Plan:

1) PortA pins RA0,RA1, RA2, and RA5 will control chip select (right/left halves of LCD, 2 pins), register select, and enable.

2) PortB pins RB4 and RB6 will control reset and read/write select.

3) PortB will be set before setting PortA. PortC (data) will be set last.

Does that plan make sense? Would you divide the control pins differently?

Note: USART uses pins RB5 and RB7, MCLR is RA3, and clock out is RA4. The datasheet is pretty skimpy.

Thanks,

John
 
You could use a 74HC595 SPI to parallel latch chip to drive the LCD's parallel port. Only would require 3 pins on the PIC to drive that (SDI, SCK and Latch). If the PIC doesn't have a SSP port, SPI is simple to bit bang.
 
Last edited:
Sounds like you're making a serial GLCD. If so, let me know how your display works (CS1/2 = active high/low etc.) as I have lots of code for that display.

Mike.
 
Yes, I am making a serial GLCD, but with a twist -- I need some decoding of the serial data. I have captured PWM data from an accelerometer with a 12F683, and converted it into digital data for tilt (signed) and temperature. The critical part of the serial link will be a pair of xBee's, which will be decoded by whatever chip is attached to the GLCD.

I could get a 16F877, 40-pin chip, but that would take until next Thursday. More important, I have never worked with a graphic display. My only experience with any display was with a serial Parallax around the first of the year. I have 16F1829 and 16F690 20-pin chips in my parts box and figured it would be a good learning experience to use one of them. In theory, at least, 20-pins might do everything I plan to do for now. I am pretty certain the final project will have a larger chip.

My question is simply what is the best way, if there is one, to divide up the 6 control signals between my available 4-pin (RA) and 2-pin (RB) ports.

Thank you for the code offer. You can be certain I will take you up on it, but right now, I would like to play with the display to get a better understanding of how it works rather than just making it work with someone else's code.

Regards, John
 
Put the data on portc and the controls lines on portb and 2 of them on porta ra4 and5 and that leaves you 3 I/O ra0 to2 and one pin for input ra3

But you need two of the port B pins rb5 and 7 for serial Hope you don't want to use more then one ADC pin then

I would put the LCD on one chip and make it in a serial backpack
 
Last edited:
The 16F887 would be the better choice over the 877/877A. On chip oscillator and a few other added features (the F877/F877A is becoming obsolete).
 

Latest threads

New Articles From Microcontroller Tips

Back
Top