Richard,
that looks good so far.
How about the other pins on the LCD controller?
Richard,
that looks good so far.
How about the other pins on the LCD controller?
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Hi Ralph
The other pins are tied to either GND, or 5V as per the circuit drawing that comes with the LCD. The LCD pdf can be downloaded here:
http://www.lcd-module.de/eng/pdf/doma/dog-me.pdf
I am using 5V, SPI interface, as every other pin on the PIC will be used (eventaully). At the moment, the extra PIC pins are not connected.
Best regards
Richard
Sorry to butt-in here, but I noticed a few things that might cause you problems.
Change OSCCON = %01101110 to OSCCON = %01101100. This jives with your particular oscillator configuration.
You're writing to SSPCON configuring it for "SPI Master", but you're not using this hardware with shiftin/shiftout. Don't setup SPI hardware if you don't use it. This affects RB1, RB2, and RB4.
Hi Bruce
I was originally using SEROUT, but then it was pointed out that for SPI mode, I should be using SHIFTOUT. I have since corrected it, and resposted the code.
Later, I will attach a A/D on the SPI bus, so it is important to get these things right !
Best regards
Richard
Richard,
Bruce is absolutely right regarding the OSCCON and SSPCON settings.
The latest code you have posted still contains incorrect values.
(I had mentioned OSCCON earlier)
I'm not sure if writing to SSPCON would have any negative effect, but as you are not using the MSSP module it doesn't help either, so just remove that line.
To help any further I would have to have a closer look to the datasheet.
(I will when I find time to)
P.S.
There is one more thing you could try:
run some loops that set "contrast" and "bias" vlaues from $00 to $FF
at some point "black boxes" should appear on the LCD.
regards
Ralph
_______________________________________________
There are only 10 types of people:
Those who understand binary, and those who don't ...
_______________________________________________
Hi Ralph
Checking the forums before sleep huh ? Heheh
Good suggestions about running loops. Will add fixes, and try it out, and see.
I still think it is something stupid I am missing ......
Best regards
Richard
Hi,
I hate to butt into a long thread - but,
This module will also work in the "normal" 4 or 8 bit parallel mode, why don't you try usinging it in 4 bit parallel mode with the standard LCDOUT command?
This would prove that the basic display is working OK. SPI is like RS232 in that it's a standard with many variables. It's not the best choice for your first project, especially with a device that has not been used with PBP before (as far as we know).
HTH Robert.
Hi guys
Okay, so I hooked up the display in 4bit mode, and it works fine.
Unfortunately, I need to use it with a SPI connection which will be shared with an A/D. Going to a bigger device is not an option for various reasons.
So, if I want to be using SPI, should I be using SEROUT, or SHIFTOUT ?
I basically have 3 pins on the LCD. SerialIn, Clock, and RegisterSelect (we can hold ChipSelect low, since the LCD is the only SPI device on the breadboard at the moment). How hard can it really be ? Its meant to be BASIC !
Best regards
Richard
Bookmarks