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.
LCD troubleshooting
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.
Should it count up close to "real" seconds? It is running fast. PIC clock speed set to 10000000 with 10MHz XT.
Thanks.
rvogel
- Steve
- Matrix Staff
- Posts: 3433
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
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.
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.
I have the clock set to XT and the other settings like this:
and
If I set _IESO_OFF (clock switching?), nothing comes up on the display.
Code: Select all
asm __CONFIG _CONFIG1, _XT_OSC & _DEBUG_OFF & _LVP_OFF & _BODEN_OFF & _MCLR_ON & _PWRTE_ON & _WDT_OFF
Code: Select all
asm __CONFIG _CONFIG2, _IESO_ON & _FCMEN_OFF
rvogel