LCDInfo.com
http://forum.lcdinfo.com/

Switching CS problem CrystalFontz CFAG12864B-TMI-V
http://forum.lcdinfo.com/viewtopic.php?f=9&t=1213
Page 1 of 1

Author:  spadusa [ Thu May 26, 2005 16:35 ]
Post subject:  Switching CS problem CrystalFontz CFAG12864B-TMI-V

I'm having a problem with stray bytes on my lcd when i switch the CS. This is the code im using to switch CS

Code:
Sub fctnCS()
If CurCS = 1 Then
    WriteItC ReadItC And Not 4
    WriteItC ReadItC And Not 2
    CurCS = 2
Else
    CurCS = 1
    WriteItC ReadItC Or 2
    WriteItC ReadItC Or 4
End If
End Sub

Sub WriteItC(bytInfo As Byte)
    DlPortWritePortUchar 890, bytInfo
End Sub

Function ReadItC() As Byte
    ReadItC = DlPortReadPortUchar(890)
End Function


My LCD is wired using the Liquid MP3 schematic found on that website.
What happens is when i execute that code i get something that looks like this

0
0
0
1
1
1
0
1

and it adds one to each side of the lcd each time i execute the sub.
its really frustrating because its not consistant

if i have data on the LCD...for instance picture that measure 128 x 64 and i execute the sub it just erases data starting at x=0. however, if im in the middle of drawing the picture, and the sub is executed to work on the other side, the first byte of the row gets corrupted....its very frustrating...andy help is appreciated. thanks in advance

SpaDusA

by the way....the code was visual basic 6.0[/img]

Author:  seulater [ Fri Mar 17, 2006 15:32 ]
Post subject: 

I have used this display, I admit was a bit rough in the beginning. but after much trial I finally got it.

from what I remember the screen is slip into two halves a left side and a right side. CS1 is for the left and CS2 is for the right. before we tackle CS2 can you turn on and off the correct pixels on the left side ?

Author:  seulater [ Fri Mar 17, 2006 16:00 ]
Post subject: 

I Just remembered I wrote some code a long while ago for the CFAG12864B-YYH-V LCD. Should be almost the same as yours.

Anyway... try to leave the code in main all in tact because It gives a cool example of what the LCD code can do. Has things like Line, Box, Circle, Pset and so on.

Go to this group and then to the files section, and get the file called "128 x 64 LCD Driver"

[url] http://groups.yahoo.com/group/netburner_group/ [/url]


Good Luck!

Page 1 of 1 All times are UTC + 2 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/