CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

Interfacing LCD 2X16 JHD162A with PIC18F46K22
Goto page Previous  1, 2, 3
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Ttelmah



Joined: 11 Mar 2010
Posts: 19278

View user's profile Send private message

PostPosted: Wed Jan 08, 2014 2:16 am     Reply with quote

One of the old recommendations applies here.

KISS.
Write a simple program, that toggles one pin. Perhaps 1 second delay in the loop. Nothing else.
A total of about four lines of code.

Then run this, and verify that the pin does toggle and at the right speed. LED, or scope.

Only try to write any other code, once the pin _is_ toggling at the defined rate. Otherwise you are on a 'hiding to nowhere'.
senur



Joined: 11 Dec 2013
Posts: 13

View user's profile Send private message

PostPosted: Thu Jan 09, 2014 9:43 am     Reply with quote

I have fixed the problem. It is weird but it worked for me. I don't know why I'm getting this problem. It was specified clearly in the datasheet that the speed for writing is 40us.
But in my case it is 60us. I've tried a lot with every possible number but 60 was the only one that gave me the right output.
I simply modified the "flex_lcd.c" function lcd_send_byte() to delay_us(60)
and surprise surprise I got the expected output. Very Happy
You guys told me that it was a timing problem but I never thought of this number. Till now I'm still confused why this number even though it was written in the datasheet 40us. Confused

Thank you for helping me.
gpsmikey



Joined: 16 Nov 2010
Posts: 588
Location: Kirkland, WA

View user's profile Send private message

PostPosted: Thu Jan 09, 2014 9:47 am     Reply with quote

One of the things that often bites people here (especially people like students/experimenters) is that the parts they buy from surplus outfits etc. often are there for a reason - they may not meet the published specs (timing, leakage etc.). Parts obtained from ebay and various surplus places may function correctly, just not within the published specs (like timing).
_________________
mikey
-- you can't have too many gadgets or too much disk space !
old engineering saying: 1+1 = 3 for sufficiently large values of 1 or small values of 3
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2, 3
Page 3 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group