LCD troubleshooting

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

Moderators: Benj, Mods

Post Reply
rvogel
Posts: 21
Joined: Mon Sep 18, 2006 11:20 pm

LCD troubleshooting

Post by rvogel »

I am playing around with an LCD display and a PIC16F84A. I can get "HELLO WORLD." to display but it flickers. This rate of flicker changes when I change the PIC clock speed in FlowCode. When I set it to 10000000 the flicker is least ( I am running with a 10MHz XT and all my connections seem to be good). I tried the 16F88 chip as the Tutorial21 (F88_TUT_21) uses, but nothing shows up on the display. I think it might be a PIC configuration issue.

My two questions:

1) What might be causing the flicker?
2) How should I configure the 16F88 to get it to work with that chip?

Thanks.
rvogel

rvogel
Posts: 21
Joined: Mon Sep 18, 2006 11:20 pm

Post by rvogel »

OK. I should have had the configuration for the 84A set to WDT off and PWRTE on. Had them switched. I loaded the Clock Tutorial (#22) and noticed that the count was not advancing on the display, so I played with the config and solved the flicker.

Should it count up close to "real" seconds? It is running fast. PIC clock speed set to 10000000 with 10MHz XT.

Thanks.
rvogel

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post by Steve »

I think this program expects the clock speed to be 3.2768MHz. If you run with a 10MHz crystal, the clock should run approx 3 times too fast.

To get the program running closer to "real" seconds, you must change the interrupt frequency in the "interrupt" icon of the "initialise" macro to 25Hz. Unfortunately, the 10MHz crystal does not divide down to give you a 25Hz frequency - so such a program will not be exact.

The "seconds" macro will also need to be edited in this case - when the interrupt is occuring at 25Hz, the "seconds" variable gets increased each time the "seconds_counter" reaches 25. You should change this "25" to the frequency set in the "interrupt" icon.

To get an exact divide down, you need to use a different crystal.

As for the config settings, yes - WDT must be off (otherwise the program continually resets itself - causing the flickering). With the 88, make sure LVP and "debug" are disabled, and RA5/MCLR is set to MCLR.

rvogel
Posts: 21
Joined: Mon Sep 18, 2006 11:20 pm

Post by rvogel »

Thanks. That helped. I've got it running close to real time, which is good enough.
Another problem: I changed the target PIC to a 16F88 with the same settings and 10MHz XT, but it runs very slow- about 1 second tic on the display every 5 minutes. Why would that be?
rvogel

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post by Steve »

Sounds like the oscillator settings in the configuration are wrong and it is running using its internal oscillator block.

Make sure the clock settings are XT (or maybe HS), and disable the last two options (fail safe monitor and clock switching).

rvogel
Posts: 21
Joined: Mon Sep 18, 2006 11:20 pm

Post by rvogel »

I have the clock set to XT and the other settings like this:

Code: Select all

asm __CONFIG _CONFIG1, _XT_OSC & _DEBUG_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_ON & _PWRTE_ON & _WDT_OFF
and

Code: Select all

asm __CONFIG _CONFIG2, _IESO_ON & _FCMEN_OFF
If I set _IESO_OFF (clock switching?), nothing comes up on the display.
rvogel

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Post by Steve »

Try HS instead of XT - XT is only really applicable for crystals of 4MHz or less.

rvogel
Posts: 21
Joined: Mon Sep 18, 2006 11:20 pm

Post by rvogel »

That did it. Thanks.
rvogel

Post Reply