eng_h_elfalaky
Joined: 29 Mar 2010 Posts: 2
|
ra8835 problem |
Posted: Mon Mar 29, 2010 4:52 pm |
|
|
++++++++++++++++++++
Locking.
Reason: MikroBasic is off-topic for CCS forum
- Forum Moderator
++++++++++++++++++++
Hi everybody,
Please I am in the middle of a project and I have a Graphic lcd. Type is lm2029c. Its a Topway lcd, 320x240 with touch screen.
Please somebody tell me whats wrong. I tested the connection and hardware. Only backlight is active no pixels shows anywhere.
The controller is RA8835, the equivalant of sed1335. The problem is its not working at all. I tried everything I know. In the datasheet this is the connection:
Quote: |
1--gnd
2--vcc
3--pot between vcc and pin18 in lcd
4-wr
5-rd
6-cs
7-a0
8-rst
9---16 I/o portb
|
This is the code
Code: |
'****************************************************************
'* Compiler:MIKROBASIC6 *
'* Date:28/3/2010 *
'* Program: Operating of GLCD LM2029C with SED1335 controller *
'* IC: PIC18F252 *
'* Oscillator : 8Mhz Highspeed osc *
'****************************************************************
program GraphicLcdSED1335
symbol data = portb
symbol a0 = portc.1
symbol res = portc.0
symbol wr = portc.3
symbol rd = portc.4
symbol cs = portc.5
symbol button1 = portc.6
symbol button2 = portc.7
const value1 as byte[8] = ($30,$87,$00,$28,$45,$EF,$28,$00)
const value2 as byte[8] = ($00,$00,$EF,$00,$00,$EF,$00,$00)
const strings as byte[6] = (65 , 69 , 67 , 32 , 64 , 64)
dim var_data,dummy as byte
dim varCommand as BYTE
dim varCursor as BYTE
dim varByte as BYTE
dim varLoop1 as BYTE
dim varLoop2 as BYTE
dim varAddress as WORD
const conSet = $40
const conScroll = $44
const conCursorForm = $5d
const conCursorAddress = $46
const conCursorRight = $4c
const conOverlay = $5b
const conWrite = $42
const conDisplayON = $59
const conDisplayOFF = $58
const conCharPerLine = $28
sub procedure senddata
CS=0
A0=0
RD=1
WR=1
delay_us(1)
portb = varbyte
WR=0
delay_us(1)
WR=1
delay_us(1)
CS=1
A0=0
end sub
sub procedure sendcommand
CS=0
wr = 1
portb = varcommand
A0=1
rd=1
WR=0
delay_us(1)
WR=1
delay_us(1)
CS=1
delay_us(1)
end sub
sub procedure InitDisplay
'uchar i=0;
CS=0
RES=1
delay_ms(1)
RES=0
delay_ms(100)
RES=1
delay_ms(100)
RD=1
WR=1
A0=1
delay_ms(100)
varCommand = 0x40
SendCommand
delay_ms(1)
varByte = 0x30
SendData
varByte = 0x87
SendData
varByte = 0x07
SendData
varByte = 41
SendData
varByte = 0x40
SendData
varByte = 239
SendData
varByte = 0x41
SendData
varByte = 0x00
SendData
delay_ms(1)
varCommand = 0x44
SendCommand
delay_ms(1)
varByte = 0x00
SendData
varByte = 0x00
SendData
varByte = 0xf0
SendData
varByte = 0x70
SendData
varByte = 0x26
SendData
varByte = 0xf0
SendData
varByte = 0xd0
SendData
varByte = 0x02
SendData
varByte = 0x00
SendData
varByte = 0x00
SendData
delay_ms(1)'; //Set display start address of layer1&2 at VRAM area
varCommand = 0x5a
SendCommand
delay_ms(1)
varByte = 0x06
SendData
delay_ms(1)' //SET HORIZONTAL SCROLL POSITION HDOT SCR
varCommand = 0x5b
SendCommand
delay_ms(1)
varByte = 0x0d
SendData
delay_ms(1)'; //SET DISPLAY OVERLAY FORMAT
varCommand = 0x46
SendCommand
delay_ms(1)
varByte = 0x00
SendData
varByte = 0x00
SendData
delay_ms(1)
varCommand = 0x5d
SendCommand
delay_ms(1)
varByte = 0x04
SendData
varByte = 0x86
SendData
delay_ms(1)
varCommand = 0x59
SendCommand
delay_ms(1)
varByte = 0x04
SendData
varCommand = 0x4c
SendCommand
delay_ms(1)
varCommand = 0x51
SendCommand
delay_ms(1)
varByte = 0x01
SendData
delay_ms(1)
varCommand = 0x42
SendCommand
delay_ms(1)
varByte = 65
SendData
varByte = 66
SendData
varByte = 67
SendData
end sub
main:
delay_ms(100)
trisa = 0xff
trisb = 0x00
trisc = %00000000
initDisplay
delay_ms(5000)
lop:
goto lop
end. |
|
|