Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

GLCD...What am I doing wrong?!

Status
Not open for further replies.

Wilksey

Member
Hi Folks,

Just had a quick play with a GLCD screen, hooked it up to a 18F46K22, ran through a Simulator, all worked OK, went to program the device and thought I had a problem, turned out I needed to hook up the contrast POT, oops :)

Enter problem,

It may be something very simple that I am doing wrong, I have looked at several different circuits and they are all showing the same to hook the pot between vee and 0v, I tried that, and I have since hooked it up the same way the manufacturer of the GLCD (Midas) recommends which is between vee and +5v, anyway, once programmed everything works as it did on the Simulator (after swapping the CS pins around!), the problem is that with the POT in the circuit the PIC won't program properly comes up with read errors when programming, with the pot in circuit turned up to around 5v it seems to sometimes program sometimes not.

PIC is hooked up as usual, two decoupling caps, 7805 and a few more caps, 10k pull up to +5V on MCLR, ICSP wired in, as soon as I introduce the POT it comes up with programming errors, the POT is connected to Vee and +5V of the GLCD and the wiper is connected to V0 which is the contrast adjust, seems that -2.5v is around the viewing contrast for me.

What can I do to allow me to keep my contrast whilst programming? I have checked for shorts etc, all seems to be fine.

Any help appreciated!

Thanks guys, and sorry for the looong post, just wanted to be as descriptive as I can!

Kind Regards

Wilksey
 
First guess is your PIC is sharing programming lines with the port pins running the display. Usual technique to avoid these problems is just a couple of strategically-placed resistors. Need a schematic to figure out more.

What kind of programmer are you using? Are you powering the rest of the circuit while programming?
 
Hi Duffy,

Hmm, PORTB is the GLCD Data bus, pins RB6 and RB7 are D6 and D7 which is the PGC and PGD lines, would this cause issues?

PIC ICD3 for the programmer, and yes the rest of the circuit is being powered whist programming.

PORTB only has the GLCD data bus and nothing else, why would the pot affect this?

Schematic (Apologies for the mess of it):
View attachment 64587

Regards

Wilksey
 
Last edited:
how many ohms is the pot? i had trouble like this when i used a 500 ohm pot it was fixed when i changed to a 10k pot, funny thing was only happened on K22 chips???
 
thats my therory out the window then :D humour me and try a 5k on the mclr just a random thought but like i said before i had a simmilar issue with this chip (and other issues) a few last thoughts, is the compiler and mplab upto date? again i had real trouble because of this with this chip
 
yeah, its definitely the hardware, used the ICD3 to program a 26k22 fine and a 32mx fine, all using the same MPLAB version.

I can try a 5k on the MCLR, i was thinking maybe the POT had interfered with the circuit somehow, I have checked for shorts etc, and it all buzzes out fine, I used two meters even for confidence.

I have always used 10K on the PICs for MCLR, do they require a different value from 10k?

Cheers
 
10k is the norm but i ended up with using a 5k on the same chip because of other problems i did a thread ranting about the ICD3 etc i think you even posted to it, after all the trouble i had it turned out to be mainly the compiler needed updateing (it was updated in the first place because microchip had known problems with the c18 compiler and that k22, microchip support told me that), there is also alot of errata for the chip so might be an idea to have a quick peep in there.
like i said great chip but i had no end of trouble with it, unfortunately it was the first chip i tried with pickit3 and ICD3 so i thought they were faulty
 
Off the top of my head I don't recall, but I downloaded a new set of installers last month as I started playing with a 32MX and needed the C32, so downloaded all new compilers and IDE (not X).

It is strange as it seems to program fine without the pot in place.
 
thats why i was thinking maybe with a 10k pot and 10k on mclr it might be pulling too low, so i thought if you lowered the mclr to below the pot it might be better, maybe even try 2,5k on mclr. purely guess work but my money is on that
sorry i meant to say try 4k7 on mclr and make sure the pot is set higher than this then try to program.
 
Last edited:
OK, thanks for the tip, I will try, is there a "lower" value limit for the MCLR pull up, i.e. would it matter if I used a 1k for example?

Cheers
 
yes there must be a lower limit as no pic pin can sink or source more than around 20Ma per pin. personaly i wouldnt go too low and remember the MCLR pin has 11v on it dureing programing, try 4k7
 
Okie, i'll try with a 4.7k tomorrow, thanks for all the info, i'll let you know if it solved the issue or not!

Cheers
 
i hope you solve it let us know how you get on. one last thought change the pot! you never know it might just be that one lol
 
I have already changed the pot, I chewed the head on it with a screwdriver, so I replaced it with a new one :)

Will let you know how I get on though,

Thanks again!!
 
Looks like you need a couple of resistors in series with D6 and D7 on the GLCD. The programmer uses those two lines, and right now it is trying to drive both the PIC and the GLCD. The GLCD may be floating in a "write" state during programming the PIC, the 1k resistors are big enough to fix that and small enough to not affect writes. Check the ICSP app notes for more.
 
Ghostman, Duffy, many many thanks for your suggestions, I tried the MCLR resistor change and it made no difference, after reading the ICSP AN as Duffy suggested I went with 10k resistors for the "isolation" circuit, and that solved the problem, programmed at least 20 times with varying the contrast pot and programmed perfectly each time, I usually avoid the PGC and PGD pins, but sometimes you can't avoid them, won't be overlooking those isolation resistors again!

Thank you all very much again for your help.

It's quite embarrassing that after so many years of using these micros that I would overlook a simple thing such as the isolation resistors! I'm going to blame the insane heatwave we have had!

Regards

Wilksey
 
nice one wilksey glad its working! at least we were on the right track just the wrong pins :D lol thanks duffy my next sugestion was to get wilksey to stand on one leg when programing!! well it used to help the signal on my old grans telly lol
 
Status
Not open for further replies.

Latest threads

Back
Top