![]() |
|
|||||||
| Proton Plus Compiler v3 Coding problems and general discussion related to the Development Suite |
![]() |
|
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
#1 |
|
Licensed User
![]() Join Date: Sep 2004
Location: E.Yorkshire
Posts: 76
![]() |
Hi,
I have come across a low cost reflective graphic (EA DOGXL160-7) LCD 160 x 104 res with UC1610 serail/I2c controller, touch screen, 3.3v and has very low profile. Has any one used one of these with pic basic who could speed my flight instrument project up with a few pointers. regards Jez |
|
|
|
|
|
#2 |
|
Licensed User
![]() |
link with specs???
|
|
|
|
|
|
#3 |
|
Licensed User
![]() Join Date: May 2007
Location: Canada
Posts: 516
![]() |
|
|
|
|
|
|
#4 |
|
Licensed User
![]() |
try the 2 wire serial to send datas from pic use the schematic from the pdf and make the tests if you need code for the touch ask it and i will post it
http://www.lcd-module.com/eng/pdf/gr...ogxl160-7e.pdf |
|
|
|
|
|
#5 |
|
Licensed User
![]() Join Date: Sep 2004
Location: E.Yorkshire
Posts: 76
![]() |
no worries guys
Its not arrived yet but reading the data I think I will be able to fire it up. I will see how I get on and post the results good or bad. Dave I would appreciate an assist with the touch screen code as I have not used one before and I am looking at using touch for all control aspects. cheers Jez |
|
|
|
|
|
#6 |
|
Licensed User
![]() |
I have attached a part of code with the EA DIP240J-7KLWTP glcd display from the same manifacturer and it is working directly without touch controller it has virtual keyboard function and 4 points callibration
(this is from my machine and this touch has pass all the emc tests without any problem ) this code is from this forum users collected informations and belong to all of us !!!!! if anyone need extra informations about the touch it will be my pleasure to help...!!! http://www.lcd-module.de/eng/pdf/grafik/dip240-7e.pdf |
|
|
|
|
|
#7 |
|
Licensed User
![]() Join Date: Sep 2004
Location: E.Yorkshire
Posts: 76
![]() |
dave,
thanks, this code looks just what i am after, the LCD is about ten days delivery so I'll crack on with the non screen stuff. I will let you know how it goes when it comes ![]() cheers Jez |
|
|
|
|
|
#8 |
|
Licensed User
![]() Join Date: May 2007
Location: Canada
Posts: 516
![]() |
|
|
|
|
|
|
#9 |
|
Licensed User
![]() Join Date: Sep 2004
Location: E.Yorkshire
Posts: 76
![]() |
brian,
thanks jez |
|
|
|
|
|
#10 |
|
Licensed User
![]() Join Date: Sep 2004
Location: E.Yorkshire
Posts: 76
![]() |
HI,
I have recieve said display today , I have figured I need to write a few functions to make it usable such as clear the screen print at etc. I have little experience in this area but have managed to read the data sheets and managed to get it working pretty easily. after it initialises it has random pixels all over so I gather a CLS is required to clear the RAM. I have managed to select the starting page and colum address and can clear a single page but how do you iincrement the page number because the page numbers 0 to 31 are derived from the last five bits? bits 7,6 and 5 are always 011 and bits 4-0 i need to increment in loop I reckon. cheers Jez Code:
Device = 18F2525
Xtal = 8
All_Digital = true
Dim initialise As Byte
Dim index As Byte
Symbol CD = PORTC.7
Symbol CS = PORTC.6
Symbol DTA = PORTC.5
Symbol CLK = PORTC.4
Init_LCD:
Low CD
Low CS
Low PORTB.5
SHOut DTA,CLK, msbfirst, [$F1] 'Set last COM electrode To 103
DelayMS 30
SHOut DTA,CLK, msbfirst, [$67]'Set last COM electrode To 103
DelayMS 30
SHOut DTA,CLK, msbfirst, [$C0] 'SEG (column) And COM (row) normal
DelayMS 30
SHOut DTA,CLK, msbfirst, [$40] 'Set Display Startline To 0 LSB
DelayMS 30
SHOut DTA,CLK, msbfirst, [$50] 'Set Display Startline To 0 MSB
DelayMS 30
SHOut DTA,CLK, msbfirst, [$2B] 'Set Panelloading To 28..38nF
DelayMS 30
SHOut DTA,CLK, msbfirst, [$EB] 'set bias
DelayMS 30
SHOut DTA,CLK, msbfirst, [$81] 'set contrast
DelayMS 30
SHOut DTA,CLK, msbfirst, [$5F] 'set contrast
DelayMS 30
SHOut DTA,CLK, msbfirst, [$89] 'set aut increment
DelayMS 30
SHOut DTA,CLK, msbfirst, [$AF] 'display on
DelayMS 30
SHOut DTA,CLK, msbfirst, [$A4] 'set all pixels on but i have this off!!!!
DelayMS 30
High CS
DelayMS 500
High PORTB.5 'just let me know its done all this
Low CS
SHOut DTA,CLK, msbfirst, [$60] 'page address 0 to 31
DelayMS 30
SHOut DTA,CLK, msbfirst, [$00] 'column address LSB thinks these start at top left
DelayMS 30
SHOut DTA,CLK, msbfirst, [$10] 'column address MSB .... no idea why it needs two????
High CS
High CD
For index = 0 To 158 'display is 160 x 104
Low CS
SHOut DTA,CLK, msbfirst, [$00] 'sets pixel to off
High CS
Next index
Low CD
Stop
|
|
|
|
|
|
#11 |
|
Licensed User
![]() |
how you controll the clock frequency????
|
|
|
|
|
|
#12 |
|
Licensed User
![]() Join Date: Sep 2004
Location: E.Yorkshire
Posts: 76
![]() |
David,
Page 382 In the shin/shout command ref "will generate the clock signal on the clock pin" to collect the data. I reckon its right because the screen is working ok and I can send commands to clear a line of pages of which there are 31 . Next I would like to write a routine to clear the whole screen . A for next loop will do it but struggling a little on how to increment the page numbers which are in hex ,may be I need to convert to dec ? .Then a Print At type command, Any help I can get on this one would be appreciated. The LCD looks great the extra size and very low profile makes all the difference over my 128x64 without being to big. Its low power as well my whole test circuit eats just 3.5ma so I have got to get this thing working. cheers ![]() Jez |
|
|
|
|
|
#13 |
|
Licensed User
![]() |
in theory everybody can tell you everything send me the part nr of your screen i will order one to make my tests and we will work in this together mabie it fits with my machine i have buy a lot of parts and some has help me in the past mabie this will help me ....!!!!!
|
|
|
|
|
|
#14 |
|
Licensed User
![]() Join Date: Sep 2004
Location: E.Yorkshire
Posts: 76
![]() |
The LCD is a EA DOGXL 160 -7 160x104 UC1610 Yellow/Green refective. Managed a clear screen routine. If any one could set me off in the right direction in providing a print routine prehaps with a font table I would be abliged.
jez Code:
Device = 18F2525
Xtal = 8
All_Digital = true
Dim initialise As Byte
Dim index As Byte ' dim for column selecting
Dim lcd_page As Byte ' dim for page increments
Dim page_index As Byte
Symbol CD = PORTC.7
Symbol CS = PORTC.6
Symbol DTA = PORTC.5
Symbol CLK = PORTC.4
Main:
GoSub Init_LCD
GoSub Clear_Screen
Stop
Init_LCD:
Low CD ' Prepare LCD for command send
Low CS ' select LCD
Low PORTB.5
SHOut DTA,CLK, msbfirst, [$F1] '$F1 'Set last COM electrode To 103
DelayMS 30
SHOut DTA,CLK, msbfirst, [$67] '$67 'Set last COM electrode To 103
DelayMS 30
SHOut DTA,CLK, msbfirst, [$C0] '$C0 'SEG (column) And COM (row) normal
DelayMS 30
SHOut DTA,CLK, msbfirst, [$40] '$40 'Set Display Startline To 0 LSB
DelayMS 30
SHOut DTA,CLK, msbfirst, [$50] '$50 'Set Display Startline To 0 MSB
DelayMS 30
SHOut DTA,CLK, msbfirst, [$2B] '$2B 'Set Panelloading To 28..38nF
DelayMS 30
SHOut DTA,CLK, msbfirst, [$EB] '$EB 'Set Bias
DelayMS 30
SHOut DTA,CLK, msbfirst, [$81] '$81 'Set Contrast
DelayMS 30
SHOut DTA,CLK, msbfirst, [$5F] '$5f 'Set Contrast
DelayMS 30
SHOut DTA,CLK, msbfirst, [$89] '$89 'Set Auto-Increment
DelayMS 30
SHOut DTA,CLK, msbfirst, [$AF] '$AF 'Display On
DelayMS 30
High CS ' de selects LCD
High PORTB.5 ' just lets me knoe the code above has run OK
Return
'********************************CLEAR SCREEN ***********************************
' this function clears the screen by selecting each row in turn and setting each
' pixel to zero in each row, then it selects the next row and so on
'********************************************************************************
Clear_Screen:
Low CD 'prepare LCD for command send
For page_index = 0 To 25 ' 0 - 25 pages on screen
lcd_page = LookUp page_index,[96,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120] ' these are the column page addresses 0-25
Low CS
SHOut DTA,CLK, msbfirst, [lcd_page\8] 'page address
High CS 'de select lcd
High CD 'prepare LCD for data send
For index = 0 To 159 '160 columns
Low CS 'select lcd
SHOut DTA,CLK, msbfirst, [$00] 'turn each pixel off in column
High CS 'de select lcd
Next
Low CD 'select command send
DelayMS 10 'slow it down a bit
Next
Return
'*********************************************************************************
|
|
|
|
|
|
#15 |
|
Licensed User
![]() Join Date: Aug 2004
Location: North Yorkshire
Posts: 300
![]() |
Hi Jez
You could adapt this http://picbasic.org/forum/showthread...ht=large+fonts or I might post/share some GLCD drivers I wrote for the Nokia 7110, 3310 and the Ks0108 for more than 2 screens, if I can find them. The print routine prints any font hight or width, if I can find the most recent files, they have not been worked on for a long while. Dave |
|
|
|
|
|
#16 |
|
Licensed User
![]() Join Date: Sep 2004
Location: E.Yorkshire
Posts: 76
![]() |
dave,
I need to do a lot of reading to grasp how LCD controllers work, the data sheets are OK if you understand the terminology in the first place. I have managed to write a 4x4 square starting on column 1 on any page(line) I want on the screen up to now. I will look forward to seeing it evolve into text. thanks jez |
|
|
|
|
|
#17 | |
|
Licensed User
![]() Join Date: Jan 2004
Location: Wellington, New_Zealand
Posts: 724
![]() |
Quote:
Paul V. |
|
|
|
|
|
|
#18 |
|
Licensed User
![]() Join Date: Sep 2004
Location: E.Yorkshire
Posts: 76
![]() |
Hi,
After much reading. I have managed to modify some code for a nokia 3310 which seems to have a similar LCD arrangement to the UC1610. The modified code works ok and I can print text on the screen now. The text however is restricted to one row high i.e four pixels. How would I increase the size of the font and therefore use two or more rows?. Also the column address's use the LSB from one command and the MSB from another and together they address a pixel wide column. Is there a way to easily take both LSB and MSB from two seperate numbers and join them together to arrive at the X axis column? cheers JEz Code:
Device = 18F2525
Xtal = 8
All_Digital = true
Dim index As Byte 'dim for column selecting
Dim lcd_page As Byte 'dim for page increments
Dim page_index As Byte 'dim for the for next loop to clear pages in clear screen routine
Dim Col_MSB As Byte 'column MSB part
Dim Col_LSB As Byte 'column LSB part
Dim LCD_Row As Byte 'selects Row
Dim i As Byte
Dim j As Word
Dim k As Byte
Dim PosX As Byte
Dim PosY As Byte
Dim TempVar1 As Word
Dim FontCache[6] As Byte
Dim LcdStr[26] As Byte
Dim Lcd_Data As Byte
Dim char_mode As Byte
Symbol CD = PORTC.7
Symbol CS = PORTC.6
Symbol DTA = PORTC.5
Symbol CLK = PORTC.4
char_mode =1 ' have not a clue what this does yet
GoSub Init_LCD
GoSub Clear_Screen
GoTo main
'****************************Initialise the LCD ********************************
Init_LCD:
Low CD ' Prepare LCD for command send
Low CS ' select LCD
Low PORTB.5 'just let me know its started
SHOut DTA,CLK, msbfirst, [$f1,$67,$c0,$40,$50,$2b,$eb,$81,$5f,$89,$AF]
High CS ' de selects LCD
High PORTB.5 ' just lets me knoe the code above has run OK
Return 'go back to old kent road
'********************************CLEAR SCREEN ***********************************
' this function clears the screen by selecting each row in turn and setting each
' pixel to zero in each row, then it selects the next row and so on
'********************************************************************************
Clear_Screen:
Low CD 'prepare LCD for command send
For page_index = 0 To 25 ' 0 - 25 pages on screen or rows
lcd_page = LookUp page_index,[96,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121] ' these are the column page addresses 0-25
Low CS
SHOut DTA,CLK, msbfirst, [lcd_page\8] 'page address
High CS 'de select lcd
High CD 'prepare LCD for data send
For index = 0 To 159 '160 columns
Low CS 'select lcd
SHOut DTA,CLK, msbfirst, [$00] 'turn each pixel off in column
High CS 'de select lcd
Next
Low CD 'select command send
DelayMS 10 'slow it down a bit
Next ' increment to next row
Return 'go back to old kent road
'*********************************************************************************
main:
PosY=100:GoSub Lcd_GotoXY ' selects row dec 100 which is row 5
Str LcdStr="Test printing on Screen",0 ' loads text into string
GoSub Lcd_SentString
Stop
'===================================LCD SUBROUTINE=====================================
Lcd_SentByte:
Low CS
SHOut DTA,CLK, msbfirst, [ Lcd_Data ]
High CS
Return
'**************************************************************************************
Lcd_SentChar:
j=Lcd_Data * 6
For i=0 To 5
Lcd_Data=CRead font1+j+i
If char_mode=0 Then Lcd_Data = ~Lcd_Data
FontCache[i]=Lcd_Data
Next
High CD
Low CS
SHOut DTA,CLK, msbfirst, [ FontCache[0],FontCache[1],FontCache[2],FontCache[3],FontCache[4],FontCache[5] ]
High CS
Return
'***********************************************************************
Lcd_SentString:
For k=0 To 26 ' step -1
Lcd_Data=LcdStr[k]
If Lcd_Data=0 Then Break
GoSub Lcd_SentChar
Next
Return
'************************************************************************
Lcd_GotoXY:
Low CD 'send command
Lcd_Data= 99 :GoSub Lcd_SentByte 'Y
'Lcd_Data=%10000000 | PosX :GoSub Lcd_SentByte 'X
Return
'=============================================================================
' Font CDATA table
' Copy and paste this table into your own program
' If an internal font is required.
|
|
|
|
|
|
#19 |
|
Licensed User
![]() Join Date: Aug 2004
Location: North Yorkshire
Posts: 300
![]() |
Hopefully you are using the Proton pre-release version as this uses the pre-proccessor, if it works let me know and I'll update the driver as I'm flying blind there.
Sorry about no text box forgot how to do them. Dave $define GLCD_SendData(P1) DataByte = P1 : GoSub SendBytes ' Useage GLCD_SendData(DataByte) '************************************************* *************************** '* Name : GLCD_Write * '* Purpose : Write a Byte to the screen at current position * '* : Sends 2 Formated Bytes * '* Passed : DataByte * '************************************************* *************************** 'GLCD_Write LineNumber, Xpos, Value Dim LcdData[2] As Byte ' Pointer to the both pages of a column Dim NibPos As Byte Dim DataByteOut As Byte ' Used for bit banging SendBytes: LowNib = DataByte & $0F ' LSB 4 Pixels are saved to LowNib HighNib = DataByte & $F0 ' MSB 4 Pixels are saved to HighNib HighNib = HighNib >> 4 LcdData[0] = 0 'Zero Vars LcdData[1] = 0 'Zero Vars ' Each Pixel in the HighNib is converted to 2 Bits, 11 Pixel On - 00 Pixel Off If (HighNib & $01) = $01 Then LcdData[0] = LcdData[0] + $C0 If (HighNib & $02) = $02 Then LcdData[0] = LcdData[0] + $30 If (HighNib & $04) = $04 Then LcdData[0] = LcdData[0] + $0C If (HighNib & $08) = $08 Then LcdData[0] = LcdData[0] + $03 ' Each Pixel in the LowNib is converted to 2 Bits, 11 Pixel On - 00 Pixel Off If (LowNib & $01) = $01 Then LcdData[1] = LcdData[1] + $C0 If (LowNib & $02) = $02 Then LcdData[1] = LcdData[1] + $30 If (LowNib & $04) = $04 Then LcdData[1] = LcdData[1] + $0C If (LowNib & $08) = $08 Then LcdData[1] = LcdData[1] + $03 For NibPos = 0 To 1 ' Font Page Size 2 Pages 'NibPos - Would be different if screen fill set different 'AUTO INC ?? 'YOUR CURSOR ROUTINE 'YOUR CURSOR ROUTINE 'YOUR CURSOR ROUTINE GLCD_GoToYX(NibPos + Y_CursorPos, X_CursorPos) ' A Column that consists of two Pages is sent to the LCD High LCD_DataOrCmdPin 'Data Mode 'Could bit bang out try after you get it workin ' DataByteOut = LcdData[NibPos] ' Low LCD_ChipSelectPin ' Chip Enabled ' GoSub GLCDSendBits ' High LCD_ChipSelectPin ' Chip Disabled ' OR SHOut LCD_SerialDataPin,LCD_SerialClockPin, msbfirst, [LcdData[NibPos]] Next NibPos Return '************************************************* *************************** '* Name : GLCDSendBits * '* Purpose : Write a data byte to GLCD * '* : send 8 Bits of Data To GLCD by series bit bang * '* Passed : DataByteOut * '************************************************* *************************** GLCDSendBits: '(DataByteOut) Dim LcdDataBits As Byte For LcdDataBits = 0 To 7 Low LCD_SerialClockPin DelayUS 2 'DO WE NEED THIS 'Check MSB If (DataByteOut & $80) = 0 Then Low LCD_SerialDataPin Else High LCD_SerialDataPin EndIf High LCD_SerialClockPin DataByteOut = DataByteOut << 1 Next Return Last edited by DaveS; 14th February 2010 at 15:56. Reason: wrong vars passed |
|
|
|
|
|
#20 |
|
Licensed User
![]() Join Date: Aug 2004
Location: North Yorkshire
Posts: 300
![]() |
Hi Jes Just reliased thats not what you where asking for, a method is in the converted C code I sent you. Its a complicated one, looks like you set 4 bits then the next 4 bits on the next page down. Dave Code:
|
|
|
|
|
|
#21 |
|
Licensed User
![]() Join Date: Sep 2004
Location: E.Yorkshire
Posts: 76
![]() |
Dave,
thanks I have managed to sort the column address problem, this code works fine I can now select any colum from 0-159 using this Lcd_GotoXY: Low CD ' prepare to send command Lcd_Data= PosY :GoSub Lcd_SentByte ' page 0-25 Col_MSB = PosX >>4 Col_LSB = PosX <<4 Col_LSB = Col_LSB >>4 Col_MSB = Col_MSB + 16 Lcd_Data= Col_LSB:GoSub Lcd_SentByte ' X co-ord Lcd_Data = Col_MSB: GoSub Lcd_SentByte ' X co-ord Return I am fiddling with the nible code you posted to select two pages to write as one page. I do not fully understand your first posted nible code but I will work on it. cheers Jez |
|
|
|
|
|
#22 |
|
Licensed User
![]() Join Date: Aug 2004
Location: North Yorkshire
Posts: 300
![]() |
Good stuff
What I would do is try to set a byte on screen %10001111 for intance useing the code I sent you, hopefully you should get the pixels set. Page 0 1 1 1 1 Page 1 0 0 0 1 If that works try other position and if that works you are about there. Dave |
|
|
|
|
|
#23 |
|
Licensed User
![]() Join Date: Sep 2004
Location: E.Yorkshire
Posts: 76
![]() |
Dave,
long day messing with fonts but finaly got a result. I can print a 7x5 font anywere on the screen. The only difficulty is the normal font table is mirrored horatontaly. Solved this by re doing font table looks good LCD has great contast. code is all a bit messy at the moment but realy have learnt al lot. \i suppose it is possible just to doulbe everything up to get a bigger font?. regards JEz Code:
evice = 18F2525
Xtal = 8
All_Digital = true
Dim index As Byte 'dim for column selecting
Dim lcd_page As Byte 'dim for page increments
Dim page_index As Byte 'dim for the for next loop to clear pages in clear screen routine
Dim Col_MSB As Byte 'column MSB part
Dim Col_LSB As Byte 'column LSB part
Dim LCD_Row As Byte 'selects Row
Dim i As Byte
Dim j As Word
Dim k As Byte
Dim PosX As Byte
Dim PosY As Byte
Dim TempVar1 As Word
Dim FontCache[6] As Byte
Dim LcdStr[26] As Byte
Dim Lcd_Data As Byte
Dim char_mode As Byte
Dim Lcd_column As Byte
Dim LcdData[2] As Byte ' Pointer to the both pages of a column
Dim NibPos As Byte
Dim DataByteOut As Byte ' Used for bit banging
Dim DataByte As Byte ' Used for bit banging
Dim highnib As Byte
Dim lownib As Byte
Dim ColumnAddress[2] As Byte
Symbol CD = PORTC.7
Symbol CS = PORTC.6
Symbol DTA = PORTC.5
Symbol CLK = PORTC.4
char_mode =1 ' have not a clue what this does yet
LCD_Row = 100
Lcd_column = 40
NibPos = 0 'SET TO 0
GoSub Init_LCD
GoSub Clear_Screen
'*********************************************************************************
main:
PosY = 100 ' y page/row pos 0-25
PosX = 40 ' X column pos 0-159
Str LcdStr="S S S S X,Y",0 'loads text into string
GoSub Lcd_SentString 'goto string loading routine
Stop
SendBytes:
lownib = DataByte & $0F ' LSB 4 Pixels are saved to LowNib
highnib = DataByte & $F0 ' MSB 4 Pixels are saved to HighNib
highnib = highnib >> 4
LcdData[0] = 0 'Zero Vars
LcdData[1] = 0 'Zero Vars
' Each Pixel in the HighNib is converted to 2 Bits, 11 Pixel On - 00 Pixel Off
If (highnib & $01) = $01 Then LcdData[0] = LcdData[0] + $C0
If (highnib & $02) = $02 Then LcdData[0] = LcdData[0] + $30
If (highnib & $04) = $04 Then LcdData[0] = LcdData[0] + $0C
If (highnib & $08) = $08 Then LcdData[0] = LcdData[0] + $03
' Each Pixel in the LowNib is converted to 2 Bits, 11 Pixel On - 00 Pixel Off
If (lownib & $01) = $01 Then LcdData[1] = LcdData[1] + $C0
If (lownib & $02) = $02 Then LcdData[1] = LcdData[1] + $30
If (lownib & $04) = $04 Then LcdData[1] = LcdData[1] + $0C
If (lownib & $08) = $08 Then LcdData[1] = LcdData[1] + $03
For NibPos = 0 To 1 'Font Page Size 2 Pages
GoSub lcd_gotoxy 'Goto the x,y pos on screen
High CD 'Prepare to send data
Low CS
SHOut DTA,CLK, msbfirst, [LcdData[NibPos]]
High CS
Lcd_column = Lcd_column + NibPos ' advances each data byte one column
'above line needs to be here to stop bottom page stepping out one pixel messing up font
Next NibPos
Return
'****************************Initialise the LCD ********************************
Init_LCD:
Low CD ' Prepare LCD for command send
Low CS ' select LCD
Low PORTB.5 'just let me know its started
SHOut DTA,CLK, msbfirst, [$f1,$67,$c0,$40,$50,$2b,$eb,$81,$5f,$89,$AF]
High CS ' de selects LCD
High PORTB.5 ' just lets me knoe the code above has run OK
Return 'go back to old kent road
'********************************CLEAR SCREEN ***********************************
' this function clears the screen by selecting each row in turn and setting each
' pixel to zero in each row, then it selects the next row and so on
'********************************************************************************
Clear_Screen:
Low CD 'prepare LCD for command send
For page_index = 0 To 25 ' 0 - 25 pages on screen or rows
lcd_page = LookUp page_index,[96,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121] ' these are the column page addresses 0-25
Low CS
SHOut DTA,CLK, msbfirst, [lcd_page\8] 'page address
High CS 'de select lcd
High CD 'prepare LCD for data send
For index = 0 To 159 '160 columns
Low CS 'select lcd
SHOut DTA,CLK, msbfirst, [$00] 'turn each pixel off in column
High CS 'de select lcd
Next
Low CD 'select command send
DelayMS 10 'slow it down a bit
Next ' increment to next row
Return 'go back to old kent road
'**********************************************************************************
lcd_gotoxy:
LCD_Row = 100 + NibPos ' selects the row and one below it
Col_MSB = Lcd_column >>4 ' shifts data in MSB 4 places to right
Col_LSB = Lcd_column <<4
Col_LSB = Col_LSB >>4
Col_MSB = Col_MSB + 16 'need to add 16 as D4 is always 16
Low CD
Low CS
SHOut DTA,CLK, msbfirst, [LCD_Row,Col_LSB,Col_MSB] 'page address is 100 col=9=(9=lsb+16=msb)
High CS
Return
'===================================LCD SUBROUTINE=====================================
Lcd_SentChar:
j=DataByte * 6
For i=0 To 5
DataByte=CRead Font1+j+i
If char_mode=0 Then DataByte = ~DataByte
FontCache[i]=DataByte
GoSub SendBytes
DelayMS 10
Next
Return
'***********************************************************************
Lcd_SentString:
For k=0 To 26 ' step -1
DataByte=LcdStr[k]
If DataByte=0 Then Break
GoSub Lcd_SentChar
Next
Return
'=============================================================================
' Font CDATA table
|
|
|
|
|
|
#24 |
|
Licensed User
![]() Join Date: Aug 2004
Location: North Yorkshire
Posts: 300
![]() |
Jez
First - Post 22 did it display as I thought? If the above works, you should be able to use the standard Proton Font. Include "Font.INC" Will look at your code, but please answer above. Dave |
|
|
|
|
|
#25 |
|
Licensed User
![]() Join Date: Aug 2004
Location: North Yorkshire
Posts: 300
![]() |
Jez Are you still using compiler version 2.1.5, it's worth paying £37.50 +VAT to upgrade and download the pre-release version with the pre-processor, plus all the free plug-ins such as GLCD Data Mate to convert a image to data plus lots of others. Your codes a bit hard to follow eg. the var j But since your cracking on heres an image to try to print to screen Good Luck Dave Code:
|
|
|
|
|
|
#26 |
|
Licensed User
![]() Join Date: Sep 2004
Location: E.Yorkshire
Posts: 76
![]() |
Dave,
RE post 22 yes it did what it said and displayed the byte on the screen 1 1 1 1 0 0 0 1 ALL OK, however the FONT.INC prints Horizontally mirror. As for the variable j not sure what this does yet as LCD_SentChar routine was pinched from a nokia 3310 prog, I am only guessing , that it represents the 6 bytes in the font table. If I get rid of var j it does not work. I am struggling to follow that bit of code also and such would like to get rid if I can, but for the moment it works so I am stuck with it. My compiler is 3.2.5.5 and the IDE is 1.0.4.6 cheers Jez |
|
|
|
|
|
#27 |
|
Licensed User
![]() Join Date: Aug 2004
Location: North Yorkshire
Posts: 300
![]() |
Jez
Good, it should work with the Font.inc file theres something amiss. Also that code I posted for an image wont work, need better tracking of the cursor position. Upgrade to the Pre-release version in the Beta Section bottom of the main forum page and try that first code I sent you in your PM. Also where do you buy these displays, I might buy one if cheap enough. Dave |
|
|
|
|
|
#28 |
|
Licensed User
![]() Join Date: Aug 2005
Location: Kent.
Posts: 1,477
![]() |
Hi,
i am a little confused by this post, I have been contemplating getting one of the TFT displays from the same people. I have not looked at the display you have in depth but I think it has it's own controller on board so the way I thought it would work is you send it variables and control codes etc and it runs it's own program so you do not have to drive it that much at all. Have you used the simulator and looked at the demo programs? Regards, Bob |
|
|
|
|
|
#29 |
|
Licensed User
![]() Join Date: Aug 2005
Location: Kent.
Posts: 1,477
![]() |
Hmm,
I think I am looking at the wrong display, I looked at the KIT160/7 not the DOG160/7 ![]() Regards, Bob |
|
|
|
|
|
#30 |
|
Licensed User
![]() Join Date: Sep 2004
Location: E.Yorkshire
Posts: 76
![]() |
Bob,
Yes you are looking at the wrong display the one I have bought is a display on glass type with a UC1610 controller. cheers Jez |
|
|
|
![]() |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| LCD Trouble.. KS0066 | bitpick | Proton Plus v2.1.5.3 General Discussion | 45 | 7th February 2007 07:42 |
| Pic basic plus commands | Mikey | Proton Plus v2.1.5.3 General Discussion | 22 | 23rd November 2003 11:00 |
| Graphic LCD and cable problem | rsdiol | Proton Plus v2.1.5.3 General Discussion | 3 | 22nd January 2003 13:04 |