Newbie and CFAG12864A

Kianoosh5

New member
Hello,

I just purchased a CDAG12864A, a graphic LCD. I am using this for a senior project of mine at school. I want to be able to display various messages on the display, however here is the kicer, this is my first time working or having to start out fresh with new LCD.

SO where should i start, oh yeah i am using a PIC micro controller....

Thanks for all the help !
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 

CF Tech

Administrator
The best place for "just starting out" is the CFA-10006 demo board:

http://www.crystalfontz.com/product/CFA10006.html

It has all the schematics, source code & etc posted. It is for an AVR, not a PIC, but the algorithms are the same.

If you are not required to use a PIC, it might save time to switch to an AVR and get a CFA-10006 to use as a development platform.

But even without purchasing a CFA-10006, you can download the schematics and code:

http://www.crystalfontz.com/product/CFA10006.html#docs
 

Kianoosh5

New member
I really have no idea where to start , can you be more detail and give me some kind of help ?

i am having no luck !

Thanks
 
I really have no idea where to start
Code:
[FONT=Arial][SIZE=4]What is your skill level?
   Have you built other electronic projects (that work)?
   Have you gotten any experience in writing software?
   Can you read schematics and understand component data sheets?

What tools do you have available?
   Do you have a PIC development board, or just a bare cpu?
   Do you have assemblers or compilers for this processor?
   What language will you program in?
   Do you have ways to debug your project, like an oscilloscope?

What are the expectations for this class?
   Is the instructor teaching the basic steps to make the project,
   or is this something that you are left to invent by yourself?
   Are you working alone, or with a partner/group?
[/SIZE][/FONT]
 

Kianoosh5

New member
What is your skill level?

Have you built other electronic projects (that work)?

yes, probably not as tough as this !

Have you gotten any experience in writing software?

i am fairly decent, even better when i can look at some examples that is already been done

Can you read schematics and understand component data sheets?

Yes, verry easily

What tools do you have available?

Do you have a PIC development board, or just a bare cpu?

Our teacher has a board made that you can upload you hex file into it , it also has ports and everything available to us, so in a way it is like development board

Do you have assemblers or compilers for this processor?

Yes, i already have alpha numeric LCD in place that our teacher has the header files and everrything for it, but i am trying to replace alpha numeric LCD with grarphic display

What language will you program in?

C

Do you have ways to debug your project, like an oscilloscope?

Yes, we are in academic environment so anything can be made available in a given time

What are the expectations for this class?

Is the instructor teaching the basic steps to make the project,

or is this something that you are left to invent by yourself?

Not invent, but we are to implement a graphic display within this project !

Are you working alone, or with a partner/group?

Yes
 
Looks like you should be able to do this project, as it is not much harder than using the character type display.

Go to the "Technical Support" forum, and at the top of the list of threads, there is a "Search this forum" link, and you can enter "CFAG12864" and see a list of threads. You will be interested in the models A, B, C, E, I, K, or M, which all use the KS0108 controller, so the code will be usable on your display. There are several threads that have sample code in "C", so you can use that as a starting point.
 

Kianoosh5

New member
thanks for the help

i am still stuck , i am pulling my hair out , i mean i look at what people have said , okay that gives me a little better insight

okay , i have the schematic, i am stuck of what to hook up to my PIC , i mean , Data bus lines should be connected to my PIC ?

i am going insanely crazy , can you give me clues of where to start?

thanks
 
okay , i have the schematic, i am stuck of what to hook up to my PIC , i mean , Data bus lines should be connected to my PIC ?
The schematic should contain that info, but I have no idea what schematic you have, so can you attach the file to your post, or post a link to where you got it, so I can see what you have?
 

Kianoosh5

New member
Alright, lets start from top, i know i am being retard and that is just because i get very little time and so much on mind school wise that i am having hard time doing, so i apperciate you guys helping so much, so thank you

Anyway so we have twenty pins right?

VSS - Ground
VDD = +5Volts
V0 ???? what should i hook up
D/I = +5volts for data or ground for instruction ( kind of confused what is the difference )
R/W = 0 volts all the time, because i think we are going to be writing to LCD all the time, we do not need no reading
E = Enable Signal which is going to 5volts all the time
DB0-DB7 = so here is the problem , am i supposed to hook them up to regular I/O pins or it has to be a2d ???, they are used for writing stuff right?
CS1 = H if you want to write to left half of the LCD Display? and would it be low if you are writing to other half?
CS2 = H if you want to write to right half of the LCD display?
RST = ??? little bit explanation please??
Vout = ???
A & K = am i supposed to ground K and give K input voltage and a resistor?
 

CF Tech

Administrator
Vo and Vout

Vo = control pin for the contrast (Vlcd). You need to connect it to -4.1v

We want Vlcd to be 9.1v.

Vcc = 5.0v

Vlcd = Vcc - Vo

9.1v = 5.0v - (-4.1v)

Where to get -4.1v? That is what Vout is!

Vout = -5v output from the negative voltage generator that is built into the display.

You need to be able to adjust Vo (pin 3), so connect a 10K pot between Vdd (pin 2) and Vout (pin 18), and put the wiper to Vo (pin 3). Then adjust the pot to give -4.1v at Vo (pin 3).

Processor pins

The best way to attack these is to get some sample source code first, than make the processor pin assignments.

Go here:

http://piclist.org/techref/piclist/index.htm

and type ks0180 in the search box to find:

http://www.piclist.com/techref/microchip/language/c/ks0107.htm?key=ks0108&from=

or some other sample code you like. That example used these assignments:
Code:
#define LCD_TRIS      TRISB
#define LCD_DATA      PORTB

#define ENABLE        PORTDbits.RD7
#define RW            PORTDbits.RD6
#define DI            PORTDbits.RD5
#define RESET         PORTDbits.RD4
#define CS1           PORTDbits.RD2
#define CS2           PORTDbits.RD3
So connect DB0-DB8 to Port B, bits 0-7

And connect all the other control lines (D/I, R/W, E, CS1, CS2, RST) to Port D:

Then the microcontroller will have full control over the display. Follow the connections and code used in the sample code you use, that will make it easier.

Backlight

You need a current limiting resistor. Please understand and follow the instructions in this post:

https://forum.crystalfontz.com/showthread.php?t=62

Your display is similar to this one, which has a updated data sheet. It might be worth a look for reference:

http://www.crystalfontz.com/product/CFAG12864B-TMI-V.html#docs
 
V0 ???? what should i hook up
There is a diagram on pg 8 of the data sheet that shows how to hook a pot from Vdd to Vout (Vee), with the wiper to Vo. As CF Tech says, set it for about -4.1 volts.
D/I = +5volts for data or ground for instruction ( kind of confused what is the difference )
Instructions are sent to the control registers in the display, data is sent to the screen memory
R/W = 0 volts all the time, because i think we are going to be writing to LCD all the time, we do not need no reading
That is true if you want to use delays in your code to slow it down to stay within the display's speed limits. Otherwise the read mode (R/W = high) can be used to test the "busy" flag to know when the display controller is ready for the next command or data. This is the fastest way to control the display.
E = Enable Signal which is going to 5volts all the time
That is absolutely wrong. The E signal is a strobe (clocking) signal to write or read the data bus. This is shown on pg 9 of the datasheet. This is the most important control signal; it is high for at least 450 nS, then low again, to write to the display.
DB0-DB7 = so here is the problem , am i supposed to hook them up to regular I/O pins or it has to be a2d ???, they are used for writing stuff right?
Use a regular I/O port, not a/d. They are bidirectional for writing or reading.
CS1 = H if you want to write to left half of the LCD Display?
Yes
and would it be low if you are writing to other half?
Yes, but not always. You could write to both sides at once if both CS are high, for example to clear the display quickly. For normal use only one CS is high at a time.
CS2 = H if you want to write to right half of the LCD display?
Yes, see previous comment.
RST = ??? little bit explanation please??
Reset the display controller. Set low to reset, then high to operate, much like the reset for the PIC cpu.
Vout = ???
This is the output of the negative voltage generator, used to make the bias for setting Vo.
 
Top