PORT A and PORT B using LCD

Status
Not open for further replies.

cobra1

New Member
Hi Guys

I am having a problem with an LCD im using,

I made a PCB origionally to use the LCD on PORT A, on the latest version of PCB i changed it to PORT B as it was easier to lay out.

Now the problem is that on PORT B it doesnt work properly, it will display a splash screen but after that, the display becomes corrupted and will not display text.

Im using a PIC 18F26K20 and the LCD uses a ST7565R chipset, wired for serial use. (5 wires)

Ok, the question, is PORT A and different to PORT B??
Also why would i be experiencing corruption using PORT B but not PORT A??

**broken link removed**
 
Im not sure, i use flowcode for coding because im a bit thick when it comes to C. I set PORT B to digital I/O on reset if thats what you mean.

Do you have any idea why it will display some things but not others??
 
sounds like a interrupt issue like its triggering when it feels like
 
Last edited:
RB0, RB1, RB2 are control lines, RB3, RB4 are data and clock.

Is there anything i can do to correct the problem? failing that its another PCB design back to PORT A i think.
 
try this:
Code:
INTCON = 0x00; //No interrupts
INTCON2 = 0x80; //No pullups
INTCON3 = 0x00; //No Interrupts (again) just in case
 
Hi, i added that code in, but no luck, just does exactly the same thing.

Im just totally confused as to why it is doing this as all i have done is changed the 5 lines to a different port.
 
silly question are you sure you set all the old PORTA to PORTB ? Maybe you missed some ? Can you post code ? is there a demo of this flow code program ?

Found the demo, do you have version 3 or 4 ?
 
Last edited:
Yeah i changed the port over to PORT B, heres the code:

Code:
//Flowcode Defines
#define MX_CONTROL_PORT			portb	//%a
#define MX_CONTROL_TRIS			trisb	//%b
#define MX_CS1				0	//%c  - CS1
#define MX_CON_RES			1	//%d	- RST
#define MX_DAT_INST			2	//%e	- A0
#define MX_SCLK				3	//%f	- SCLK LCD-D6
#define MX_SDATA			                4	//%g	- SDATA LCD-D7



This is the only part that requires changing to set ports

heres what im getting just trying to print the number 23

**broken link removed**
 
Last edited:
are you sure thats all you changed ? looks like a timing or miss alignment more than it not working
 
yeah thats all, if i change it back to porta, trisa. i can use that on another board i made perfectly, obviously it uses PORT A instead for the LCD
 
yeah tried that too, i even built a second board up to try, using my last LCD both do exactly the same thing,

I have 50 of these boards, i didnt think this would be an issue when i had them made.
 
wow! this is a weird issue tho. PORTB should be technically the same.

Im reading the datasheet and only difference i see is...PORTB has the below which PORTA doesnt have:

Interrupts
Internal Pullup Resistors

it seems like your program is working meaning the LCD is getting data but not all the time. or at the right time.
perhaps its a hardware issue. are there any resistors you might have forgotten to move from PORTA to PORTB like

for the CS, SCL,SDA lines ? Is this a SPI LCD ? may i ask where did you get it from. It looks so cool!
 
The LCD can be used in both parallel or serial, im using serial/SPI

I dont have any resistors on either of the ports so nothing to move, the LCDs are from NEWHAVEN DISPLAY
 
wow just wait... im sure other people will also try to help.

ah you have one of these:
**broken link removed**
 
Last edited:
Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…