Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC16F84A can't get a bit out of it, any example hex?

Status
Not open for further replies.
OK lol figured you'd get to here, and it not working.. :) Here's a simple pseudocode example for how to get it working, it can take forever if you're trying to 'fix' an already built complex routine. Of course set up the DDR and use the commands for this.

Just keep copying the block, and do everything manually, with a wait between every flipping of a bit. Then you can make a decently long wait, and be sure there is plenty of time between any lines changing. May be leaving something out since just from memory, go by the data for clearing display, get to first character, and send a character. Key is delays, enough delay between setting lines and enable, set the bits with separate instructions, and a good separate enable then wait then off, and then to do everything manually until you start getting a response from the LCD. Doing it this way is just less troublesome to get an unknown display up and working the first time, especially when you don't have already known correct working code to start from.. (It works for whoever had the site, but that doesn't mean it'll work on any random other LCD from different timings.)

Also note you really need to divide for the contrast line, some displays you really just won't see anything unless contrast is in a mid 0-5v range..



Power on
wait
Data out (reset/clear of course the first command)
wait
read/write
wait
register select
wait
enable
wait
enable off
wait

Data out (usually home or similar)
wait
read/write
wait
register select
wait
enable
wait
enable off
wait

Data out (just a character)
wait
read/write
wait
register select
wait
enable
wait
enable off
wait

loop goto loop

Cut paste the send section like 30 times once you get to the characters, that way if something else is messed up with where it starts it'll wrap around. Won't hurt to send a ton until you get it working, and something will show on screen then figure out problems later..
 

I've searched other HD44780 datasheets and I found timings to be the same. Other drivers though use some longer delay routines, which seems to prove to be the cause of malfunction in my driver. Meanwhile, I have just finished a prototype board layout drawing on the PC and I'm going to build it on a breadboard. I'll make some tests soon using different delays. I'll report back when finished testing.
 

I have built now the circuit and programmed the PIC. Unfortunately I had no good response. The LCD keeps showing the all dots squares (uninitialized) and the PIC seems to be unable to make it work. I have tried many different delays but none has made the difference. The crystal is oscillating and the PIC seems to run fine (I have a test-good led, I made it to blink and it blinks fine), but the driver is not.
Can you recommend me any C driver for HD44780 LCD displays? Maybe one you've used already and it's know to work.

p.s. I've attached the schematic and the PCB I'm using.

EDIT
Guys, I found the issue. The LCD display I am using is broken. I managed to get a proper display output twice in ... a few hundred tests, but as soon as I reset the circuit it won't show the writings again (simple 01234..ABCDEF chars using LCD_WriteString from my driver). I suspect either the LCD is using very different timings (although, I've increased all my timings to at least 1ms even where 1us was requested) or the (HW) driver circuit is broken. I now tested the PIC with another LCD using the same HD44780 controller and it work flawlessly.

Thank you very much to anyone back in this thread who helped me!
 

Attachments

  • PCB.png
    PCB.png
    31.5 KB · Views: 63
  • Schematic.png
    Schematic.png
    31.6 KB · Views: 56
Last edited:

I'm using an LCD driver in 'C' right now but I can't give you the code for contractual reasons.

There is one obvious mistake in your schematic. The LCD pin marked VO is the contrast setting and it should be connected to the wiper of a potentiometer (10K will do) wired across Vss and Vdd. It may be that it is actually working but you have the contrast set so high that the character background is the same as the foreground.

Brian.
 

I agree with betwixt, the display may work with the contrast control set to 5V in single line mode but will fail when set to two line mode, You should start with the contrast control wiper set to ground and then adjust contrast to suit.
 

I have already noticed it and connected a potentiometer instead of grounding the V0 pin. It changes nothing, I still only see the uninitialized display squares and no matter how I set the potentiometer wipe, it won't show any characters (it only changes the squares contrast).
As I said before, I've been able to see the characters on the display twice. I don't know how did I manage to make it work those 2 times, but it never repeated again. Instead, another display I have is working just fine, even with very small delays. I've checked the display datasheets for both of them and I couldn't notice any difference in the instructions timing. Probably they're only referencing the original timings of the HD44780 controller but for sure the display is not following them all, or the controller is broken.

Well, I won't bother finding out why that display is not working. I am already using another display that's working fine and that's good enough. I am having very little time to complete a project and I can't keep working on that malfunctioning display; as soon as I finish the project I'll make other tests on it hoping it will show some good results.

Again, thank you for your help and interest guys!
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top