Hi everyone.
It's my first post here, so i'd like to thank everyone posting in this tread for sharing their knowledge
I also have a question: Has anyone figured out the screen scrolling on phillips controller? The display works fine for me, i just can't make the contents scroll: if i understood correctly, i have to send the VSCRDEF command, with three arguments describing what portion of the screen is to be scrolled, and then i can continuously send SEP commands with one argument each, describing how far i want the screen to scroll. But this sequence doesn't work for me. Am i missing anything here?
@dak246 - good to see a fellow assembly programmer around
I think i can see your problem. Your data transfer protocol seems to be faulty.
When you do:
Code:
btfss TXByte,0 ;Skip next line if the bit to send is set
bcf PORTB,DATAP ;Send a 0 bit
btfsc TXByte,0 ;Skip next line if bit to send is clear
bsf PORTB,DATAP ;Send a 1 bit
bsf PORTB,CLK ;Bring the clock pin high
rrf TXByte,1 ;Shift the bits of the byte being sent to the right
you check the least significant bit of the data, then shift bits right, cecking the second bit, etc.
AFAIK, you should transmit the
most significant bit first (at least this is the case with phillips controller), so this portion of code should be:
Code:
btfss TXByte,7 ;check the most significant bit
bcf PORTB,DATAP ;if it's low, send 0
btfsc TXByte,7 ;else
bsf PORTB,DATAP ;Send a 1 bit
bsf PORTB,CLK ;Bring the clock pin high
rlf TXByte,1 ;Shift the bits of the byte being sent to the LEFT
Otherwise than that your code seems fine.
Here's my sending routine:
Code:
SPI_sendCmd
CLK0
SDA0
CLK1
goto SPI_sendByte
SPI_sendData
CLK0
SDA1
CLK1
goto SPI_sendByte
SPI_sendByte
movlw 0x08
movwf TEMP1
sendBit
CLK0
cpbit SHIFT_REG, 7, SDA
rlf SHIFT_REG, f
CLK1
decfsz TEMP1, f
goto sendBit
return
with defines and macros put in the header, just to make life a bit easier:
Code:
#define CLK PORTA,0
#define SDA PORTA,1
#define CS0 bcf CS
#define CS1 bsf CS
#define CLK0 bcf CLK
#define CLK1 bsf CLK
#define SDA0 bcf SDA
#define SDA1 bsf SDA
cpbit macro FROM_R, FROM_B, TO_R, TO_B ;copy bit between registers
btfsc FROM_R, FROM_B
bsf TO_R, TO_B
btfss FROM_R, FROM_B
bcf TO_R, TO_B
endm
Works like a charm for me.
And if you want to make sure what controller you have in your lcd, i'd suggest to use the program from this site:
http://electronique.marcel.free.fr/LCD% ... leurs.html
It can drive both epson and phillips-based lcd's, so if one of them works, you'll know which lcd you have. If neighter works - well, you'll just have to get a new display
I hope it helps.