• We recently switched our forum platform. If you experience any issues please email support@crystalfontz.com

initializing CFAF320240F 035TTSCB with a dsPIC30F microcontroller

mpholmes

New member
I've had a board made for 8080 8 bit communication between a dsPIC30F4011 microcontroller and the touch screen in the title (long name. haha). I've converted the initialization code line by line for initializing the display and then just drawing a single color on the screen, but the darn thing won't do anything except just show white. Is there a mistake in this code?
http://www.crystalfontz.com/products/document/2038/CFAF320240F_8_bit.zip

Are there any common pitfalls anyone could suggest that could get the screen working? I really have no idea even where to begin debugging. Could a long ribbon cable adversely affect communications? (3 feet)

Is the Solomon driver datasheet correct when it says you should tie unused DB's to ground? Also, there are a few other pins it suggests tying to ground if they are unused. Is that correct?

I don't know if this is a motivating factor, but if I can get it working, it's going in hundreds of pieces of equipment per year for Tinitron.

-Paul
Looking for additional LCD resources? Check out our LCD blog for the latest developments in LCD technology.
 
Last edited:
I've done a fair bit of code for this display (posted on this site), and for a quick comparison of the init section, your code looks almost identical to mine. I didn't examine it thoroughly, though.

Are there any common pitfalls anyone could suggest that could get the screen working? I really have no idea even where to begin debugging.
Possibilities:
Timing problems... pulse widths too short, insufficient setup/hold times.
Voltage problems... signal levels, noise, poor grounding, etc.
Code errors... leaving a control signal in the wrong state; e.g. RD & WR both active, RST held active, display set to wrong mode.
Wiring errors... for 8 bit mode, data bus is DB10-DB17

Could a long ribbon cable adversely affect communications? (3 feet)
Yes, for sure, but its not a guarantee of problems. Can you look at the signals at the input to the display with a scope? You'd be looking for noise, particularly ringing, on the signal transitions.

Is the Solomon driver datasheet correct when it says you should tie unused DB's to ground?
I suppose they know best for their product, but I've left unused pins unconnected, with no apparent problems.

Also, there are a few other pins it suggests tying to ground if they are unused. Is that correct?
I suppose so; which pins are you referring to?

I think you're using PORTD for mode control; setting that to 0xF8 puts you in 6800 18-bit mode, which doesn't seem like what you want. For 8080 8-bit, you want 0x03.
https://www.crystalfontz.com/products/document/2236/CFAF320240F_Interface_Table.pdf
 

mpholmes

New member
Thanks for your helpful suggestions!! I found out what it was. I watched the outputs of the micro, and where I was doing the following was causing problems:
EXAMPLE:
_RB0 = 1;
_RB1 = 1;
_RB2 = 1;
_RB3 = 1;

It would only set every other bit! Then it hit me! These are read, modify, write commands! It's reading portB, modifying it, and writing it without a Nop() like the datasheet says. If I canged all PORTx commands to LATx commands, then everything works! I would have never figured that out in a million years without your suggestion. Thanks!
 
Top