PIC16F688 & 2 x 20 LCD

t06afre

Joined May 11, 2009
5,934
Just shooting in the dark.
Try rewriting the LCD_STROBE( ) macro as a separate subroutine
and put some delay between going high and low.

Call lcd_init( ) twice in main( ).

Check timings on the scope and make sure you are not running too fast.
Increase the delays where necessary.
The base of this code is from microchip examples. I have used in many projects. But they have all been 4MHz projects. What I remember from a typical LCD datasheet. A LCD need around 250 nano sec to detect the EN pulse. So with a 8 MHz clock it should detect the EN pulse. But anyway this is a simple thing to try out
 

atferrari

Joined Jan 6, 2004
4,769
I cannot read your code because I am not C conversant.

A frequent error of mine: trying to handle the 4 bit in the lowest nibble of the output port. My code demands using the high output nibble (PortX b7:b4).

When I do the porting to new micros I just keep in mind that.

HTH
 
Last edited:

thatoneguy

Joined Feb 19, 2009
6,359
Maybe going too fast. The attachment is from the E bit.

Which reminds me... I had a problem with some ADC acquisition. The error message/warning said something about less that 1.60uS. How can I slow down?
What is the width of the spikes in uS? What effective bandwidth does the scope have? It looks like some of the pulses aren't reaching full logic level for any period of time, unsure if that is how the scope is displaying it, or maybe the display/screen capture causing the effect?
 

Thread Starter

nerdegutta

Joined Dec 15, 2009
2,684
After a night of sleep, I thought I'd give it another try.

I powered on where I left yesterday, and same result. I used the probe from the scope to see if I could get some good measures. Now it's nothing. Zero. Zip.

I then disconnected the powersupply, and tried to power the IC from the PICKit 3.

Now I got an error message:

PK3Err0035: Failed to get Device ID
I have to start all over.

BTW:
PK3Err0035 - reminds me of Error 37 (Be warned, some swearing in the video)

Anyways... Thank you for your time, and Merry Christmas and all that stuff. :)
 

spinnaker

Joined Oct 29, 2009
7,830
I then disconnected the powersupply, and tried to power the IC from the PICKit 3.

Now I got an error message:

I have to start all over.

BTW:
PK3Err0035 - reminds me of Error 37 (Be warned, some swearing in the video)

Anyways... Thank you for your time, and Merry Christmas and all that stuff. :)

Did you remember to reconnect the supply? :)

Is this a supply you built or is it a supply you purchased?
 

bug13

Joined Feb 13, 2012
2,002
Your code here:
Rich (BB code):
#define    LCD_STROBE()    ((LCD_EN = 1),(LCD_EN=0))
isn't it suppose to be like this?
Rich (BB code):
#define    LCD_STROBE()    ((LCD_EN = 1);(LCD_EN=0))
I recently play with a couple lcd1602 and lcd0802, I got the same thing as the op, my problem is in my lcd_initial();.
 

Markd77

Joined Sep 7, 2009
2,806
Which reminds me... I had a problem with some ADC acquisition. The error message/warning said something about less that 1.60uS. How can I slow down?
I've had the same error in the simulator. If you have set the "A/D Conversion Clock Select" bits correctly for your clock speed don't worry about the warning.
I managed to get rid of the warning by changing the order that I loaded the FSRs that set up the ADC, but it didn't make any difference to the how the program worked. If you want to get rid of the warning, get it to break on errors and then move the instruction it breaks on slightly later in the configuration.
 

Thread Starter

nerdegutta

Joined Dec 15, 2009
2,684
Did you remember to reconnect the supply? :)

Is this a supply you built or is it a supply you purchased?
Yes, I did. :)

Your code here:
Rich (BB code):
#define    LCD_STROBE()    ((LCD_EN = 1),(LCD_EN=0))
isn't it suppose to be like this?
Rich (BB code):
#define    LCD_STROBE()    ((LCD_EN = 1);(LCD_EN=0))
I recently play with a couple lcd1602 and lcd0802, I got the same thing as the op, my problem is in my lcd_initial();.
I don't know. Could be. Have to try.

I've had the same error in the simulator. If you have set the "A/D Conversion Clock Select" bits correctly for your clock speed don't worry about the warning.
I managed to get rid of the warning by changing the order that I loaded the FSRs that set up the ADC, but it didn't make any difference to the how the program worked. If you want to get rid of the warning, get it to break on errors and then move the instruction it breaks on slightly later in the configuration.
I think the errors are due to some initial settings or oscillator settings.

Right I'm into something else, and have put this project on the side for a bit.

Thanks for your time and effort.:)
 
Top