sunil21
Advanced Member level 4
- Joined
- Dec 2, 2010
- Messages
- 119
- Helped
- 4
- Reputation
- 8
- Reaction score
- 5
- Trophy points
- 1,298
- Activity points
- 2,514
I have a PICKIT2 clone.
I am trying to interface LCD with PIC16F876A.
As seen in most of the examples, I grounded the RW.
When I used MPLAB HITECH C first , no matter what I did it didn't work. Only showing square black blocks on the first row.
Then I tried mikroe C for pic. It worked fine - Great..
but the code crashed most of the time and was unable to debug without a Mikroe programmer.
so with no option I had to switch back to MPLAB.
I tried the demo board with 12mhz crystal. I tried codes from net for LCD interface.
Lot of delays here and there.. Played with it adjusted... Okay I got it working.
Then I had to work with TIMER1 interrupt and for calculation with FOSC/4 thing , I tried with 12mhz (effective 3mhz (12/4 - I think instruction period is fraction or something).
I found it better to use 4mhz or 8mhz XL so that timing calculations will be easy.
I replaced 12MHZ with 8MHZ Crystal. Now in HITECH C , I again get square blocks.
I tried Mikroe.. it is perfect.
Please tell me what magic mikroe guys have in their code ... Is there some other way to read busy flag??
May be I have to use the RW pin also. One more thing: When I simuate the Mikroe code in proteus it works fine. But with hitech c code it is blank.
Got 10 messages , 1 says : Controller received command whilst busy (must be timing - delay duration)
Any suggestions ?
I am trying to interface LCD with PIC16F876A.
As seen in most of the examples, I grounded the RW.
When I used MPLAB HITECH C first , no matter what I did it didn't work. Only showing square black blocks on the first row.
Then I tried mikroe C for pic. It worked fine - Great..
but the code crashed most of the time and was unable to debug without a Mikroe programmer.
so with no option I had to switch back to MPLAB.
I tried the demo board with 12mhz crystal. I tried codes from net for LCD interface.
Lot of delays here and there.. Played with it adjusted... Okay I got it working.
Then I had to work with TIMER1 interrupt and for calculation with FOSC/4 thing , I tried with 12mhz (effective 3mhz (12/4 - I think instruction period is fraction or something).
I found it better to use 4mhz or 8mhz XL so that timing calculations will be easy.
I replaced 12MHZ with 8MHZ Crystal. Now in HITECH C , I again get square blocks.
I tried Mikroe.. it is perfect.
Please tell me what magic mikroe guys have in their code ... Is there some other way to read busy flag??
May be I have to use the RW pin also. One more thing: When I simuate the Mikroe code in proteus it works fine. But with hitech c code it is blank.
Got 10 messages , 1 says : Controller received command whilst busy (must be timing - delay duration)
Any suggestions ?