Pic18f87j90 porth not working for LCD

Thread Starter

igeorge

Joined Jul 2, 2010
60
the pic dem lcd module it is completely ridiculous.
i had so many problems that i regret i bought it.
beside the fact that i still have unanswered issues from previous tickets, now i have a new problem again !!!
i needed to free some pins from lcd to use the additional functions on the pin, or as a digital i/o.
i moved the segments 12,16 and 17 to porth, segment 40, 41,and 42
i enabled the lcdse5 ,all the segments on the lcd configuration routine
lcdse5 = $ff
i made on the startup all pins on port h as outputs
trish = 00
The datasheet is confusing and say make them inputs, but the demo code said to be outputs
i remapped my display to fit the new segments location
symbol s13a = lcddata5.s40c0
symbol s13b = lcddata11.s40c1
symbol s13c = lcddata17.s40c2
symbol s13d = lcddata23.s40c3

and

symbol s16bc = lcddata17.s41c3
symbol s17a = lcddata23.s42c3
symbol s17b = lcddata17.s42c2
symbol s17c = lcddata11.s42c1
symbol s17d = lcddata5.s42c0
symbol s17e = lcddata5.s41c0
symbol s17f = lcddata17.s41c2
symbol s17g = lcddata11.s41c1
the display for this segments now is blank !!!
the project perfect with segments on seg12,16, and 17 , but not in the new loaction
it is no way that i can turn the segments on
I could'ev finish the project 3 weeks ago just using an holtek lcd driver, but i wanted an elegant solutions with one chip does all.
i think i was completely wrong.
Please help
Thank you
ion
 

Thread Starter

igeorge

Joined Jul 2, 2010
60
here is the manual
the issue i believe it is not the board or schematic.
all the these pins are not used as i removed the original LCD.
now they are free
the issue is with pic18f87j90 which does not activate porth
thank you
 

Attachments

spinnaker

Joined Oct 29, 2009
7,830
Have you tried writing a test program and test each input to the LCD to see if you can make it go high and low? Just to make sure it is wired the way you think it is wired.


And can you please use capital letters at the beginning of your sentences? They make a paragraph a lot easier to read.

What is porth? Do you mean port? port high?
 

Thread Starter

igeorge

Joined Jul 2, 2010
60
If you read my post , you maybe can see that the program works fine in other Ports for LCD
I just moved 3 wires from one pin to another.
The Port I have problem it is Port H
If you are familiar with this processor you will understand from the lines of code i posted what it is going on.
The program itself has more than 3000 lines and it will be a jungle to try to go through it.
I will attach the data sheet in case you need to look.
This port, has only two functions Digital or Segment driving.
If you select in the LCD configuration the pins as segment driver, it will overwrite the port. No brainier here. One line of code and make all Port H driver for LCD segments.
Regards
Ion
 

Attachments

spinnaker

Joined Oct 29, 2009
7,830
You don't say anywhere that it was working. All you say is "believe it is not the board or schematic.".


But you are right the manual is very confusing. I have found that Microchip is not know for it's documentation.

You submitted a ticket. Have you tried posting on the microchip forum?
 

thatoneguy

Joined Feb 19, 2009
6,359
I think you are missing the point of that uC.

The LCD isn't a display with a controller chip built it, it is JUST an LCD. The uC has an onboard GLCD display controller with all the functions, BUILT INTO THE MICROCONTROLLER. If you do not use the pins for the LCD controller that the uC provides, the LCD won't work, because it's not getting the signals it needs to run.

Think of it this way.
A 16x2 character display, everybody knows how to write to it, since all of them use the Hitachi controller.

Now, take a Bare 16x2 display, no circuit board, no controller, and write to it using Hitachi commands - It won't work, and you have a ton more wires you need to deal with than if you had the hitachi controller attached.

So just as PWM only works on some ports, and ADC only works on some pins, and USB must be on certain pins, THE LCD also needs to be on certain pins, you can't swap them around.


If you needed more ports, why didn't you use the ones you "moved" the LCD to? That might answer your question for you.
 

Thread Starter

igeorge

Joined Jul 2, 2010
60
thank you Thatoneguy, but this is the issue, i cannot use port H for digital purpose either.
The reason to move the 3 segments from the original location is that i need to have my spi pins free
Regards
Ion
 

Thread Starter

igeorge

Joined Jul 2, 2010
60
I am sorry for my ignorance, but i would like to make it clear .
In my case , RC3,4, and 5 are the dedicated SPI pins for this chip.
Originaly i used them for segments display.
On the datasheet of the controller it state that if you select the LCD function of a pin, all other functions are disabled for that pin
LCD Segment 17 output; disables all other pin functions. Page 124 of the data sheet
RC<7:1> pins are multiplexed with LCD segment drives, controlled by bits in the LCDSE1, LCDSE2,
LCDSE3 and LCDSE4 registers.
I/O port functionality is only available when the LCD segments are disabled.
Page 123 of data sheet
Regards
Ion
 

thatoneguy

Joined Feb 19, 2009
6,359
Then you have 2 choices:

Use a separate LCD for display, or a separate uC for your comms and send info to this uC for LCD display.

You purchased a demo board, and those aren't very flexible compared to something like an LCD Development board, which allows for many configurations, and have an LCD with an integrated driver.

Why not use the default LCD pins and not use PortB SPI for LCD? The manual states that isn't the default case.

You could use a bit banging routine for SPI as well.
 

Thread Starter

igeorge

Joined Jul 2, 2010
60
Thanks for support
I will try to use other pins
You are right about MC boards
They are very rigids, and not too much room left for user configuration.
 

thatoneguy

Joined Feb 19, 2009
6,359
There are a few MC boards that are Extremely flexible, such as their High Pin count dev board, 44 pin dev board, mid range dev board, and low pin count dev board.

Most of the board is perfboard, with a surface mount or socket PIC installed, then LEDs and switches as well as a potentiomter on one side that are hooked up by default, but can be jumpered.

I've built many robots based on the 44 pin development board, since they are extremely cheap! Buy one with a processor, get 3 blank PCBs free, and (through their awesome sampling policy) you essentially get 4 44 pin dev boards for under $50!

However, if you get an mtouch demo board or LCD demo board or Motor Driver demo board, don't expect it to do much other than what is described. If it is demoing a peripheral, that's going to be pretty much what is available. On the other hand, if it is a PIC32 demo board, you get everything to play with, since it is the controller itself that is being demonstrated. I hope that makes sense for your future acquisitions.
 
Top