View previous topic :: View next topic |
Author |
Message |
Ttelmah
Joined: 11 Mar 2010 Posts: 19537
|
|
Posted: Wed Jan 08, 2014 2:16 am |
|
|
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
|
|
Posted: Thu Jan 09, 2014 9:43 am |
|
|
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.
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.
Thank you for helping me. |
|
|
gpsmikey
Joined: 16 Nov 2010 Posts: 588 Location: Kirkland, WA
|
|
Posted: Thu Jan 09, 2014 9:47 am |
|
|
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 |
|
|
|