16f1825 and LCD issues

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

chipfryer27
Posts: 68
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 46 times
Been thanked: 15 times
Contact:

16f1825 and LCD issues

Postby chipfryer27 » Fri Dec 22, 2017 11:37 am

Hi

Following on from a previous post regarding internal oscillator I'm now trying to use the 16f1825 running on Int Osc (500Khz) with a 16x2 RG1602A LCD module but without much success.

Connections are:-
A0 = Data 0
A1 = Data 1
A2 = Data 2
C0 = Data 3
C1 = R/S
C2 = E

Backlight connected and contrast adjustable with R/W connected to Ground and all continuity checked.

I have tried both Generic and EB005 components but neither seem to be doing anything. The LCD module itself does work as I tested it by connecting it to a breakout on Port B of the programmer using a 877A running the same test program (connections obviously changed to suit). All the program does is display the word "Test ", flash an LED for a few seconds then display "Stop" further along the line. The LED does flash at correct rate so code is running.

Any pointers? I'm leaning towards timing but could be way off.

Regards

User avatar
Benj
Matrix Staff
Posts: 12988
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 3742 times
Been thanked: 3598 times
Contact:

Re: 16f1825 and LCD issues

Postby Benj » Fri Dec 22, 2017 11:39 am

Hello,

The four data pins go to the upper nibble of the LCD data port as shown on the schematic here. Is this how you have wired up the display?

Image

https://www.matrixtsl.com/wikiv7/index.php?title=Component:_LCD_(Generic)_(Displays:_Alphanumeric)

If this is how you have it already then maybe try running the chip at a faster speed by configuring the INTOSC. 500KHz is pretty slow.

chipfryer27
Posts: 68
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 46 times
Been thanked: 15 times
Contact:

Re: 16f1825 and LCD issues

Postby chipfryer27 » Fri Dec 22, 2017 12:46 pm

Hi Benj

Connections as per your diagram. Just tried it at 1Mhz and 4Mhz. Display is illuminated and I've swept contrast but nothing is there. I'm using the same breakout arrangement used when I connected the 877A to test the display (it worked). Just the chip / port connections differ.

It is obviously something very stupid and probably very simple.

Regards

User avatar
medelec35
Valued Contributor
Valued Contributor
Posts: 7625
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2156 times
Been thanked: 3011 times
Contact:

Re: 16f1825 and LCD issues

Postby medelec35 » Fri Dec 22, 2017 1:07 pm

Can you post your flowchart and circuit diagram, so I can see if I can spot something?

Martin
If you read a post that is useful, please show appreciation by clicking on thumbs up Icon.

Martin

chipfryer27
Posts: 68
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 46 times
Been thanked: 15 times
Contact:

Re: 16f1825 and LCD issues

Postby chipfryer27 » Fri Dec 22, 2017 3:44 pm

Hi

Code attached

C-block for 4Mhz operation
Start LCD
wait 100ms
Print "test"
loop x 10
Led on
wait 1s
Led off
wait 1s
Loop
Print "stopped"

Connections as per diagram by Benj

Regards
Attachments
Flash.fcfx
(5.72 KiB) Downloaded 9 times

chipfryer27
Posts: 68
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 46 times
Been thanked: 15 times
Contact:

Re: 16f1825 and LCD issues

Postby chipfryer27 » Fri Dec 22, 2017 4:43 pm

Hi

Just did a flash test on all ports to verify chip was actually working.

All good except RA2/AN2/Int pin didn't do anything. It is dead. mV at pin measured to either rail. This is one of my data pins.

Now I may be thicker than a porridge milk shake, but I could be on to something.......

Regards

chipfryer27
Posts: 68
Joined: Fri Jun 06, 2014 3:53 pm
Has thanked: 46 times
Been thanked: 15 times
Contact:

Re: 16f1825 and LCD issues

Postby chipfryer27 » Fri Dec 22, 2017 5:02 pm

Hi

New chip and all is good (now you know why I chose this alias, I don't actually cook fish).

Thanks again to all that helped and Merry Christmas to everyone.

Regards