A quick look at your code shows that you are setting the E flag, then moving the data to PORTB, then clearing the E flag. You must move the data to PORTB first, then set E, then reset E.
Dear Gordz, I think you are right. I used simulator with same program but with 20 MHz frequency. LCD worked in simulator again..What does it mean? I think it means simulator is not sensitive for timing...Other side I made long initial silence period. But this lcd didnt work again. I want to try next step of my project. But it made me crazy as I coudnt pass this step. There is a print on my lcd circuit : ATM1602B is it an important detail?
That is merely a part number and is not importamts at the moment. When initialising an LCD module like this is is important to allow the time delays required for commands to complete. If you look at the code I posted there are delays at certain points in the initialisation sequence, perhaps this is where your problem lies. Try a VERY slow clock speed and if it works then this is your problem.
Dear Gordz I changed program according to your reccommends..No this ...hit circuit doesnt work..I attach my the newest version of my program. Please comment
Perhaps I shouldn't have been so adamant that setting the E flag must come after setting up the data. It is permissible to set the E flag early as long as the data is set long enough before the E flag is set back to zero. Setting the data before setting the E flag is just safer.
I looked at your code some more and it all looks okay. Since you are waiting for the LCD to not be busy (the call to MESGUL) the delays really shouldn't be necessary.
The init sequence appears to be okay. It sets:
8-bit mode, 2 display lines
Display on, cursor on
cursor moves in positive direction
clears the display
sets the cursor position to 0
The commands you are sending all look okay. Are you sure that the connections between the PIC and the LCD are all correct?
Were you able to adjust the contrast? In the picture you showed, the dark blocks on the first line indicate the need to adjust the contrast.
Also, the corrected DELAY10ms routine actually delays about 25 ms.
When you added all those calls to DELAY10ms in KOMUTYAZ you lost the instruction that clears the E flag. You need to put that back in.
These last two bugs weren't in the original program that you posted here. You need to verify your code again. Remove the delays and fix these bugs and post it here again. I'll look at it.
Dear my brother Mike ,I made circuit two times. Then I thought maybe I make mistake and wanted a technician to make it for me. He made it two times also. I used different components in each tried circuit. It will make me crazy...
Attach the latest version of your code and I will go through it. Also, if you can do it, a photograph of the board and connections to the LCD would help. And post the CONFIG settings you are programming into the chip.