| View previous topic :: View next topic |
| Author |
Message |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Mar 26, 2011 2:52 pm |
|
|
Their _Lcd8_Cmd routine has two different delays at the end, depending
on whether it's sending data or an instruction to the LCD. If it's data, the
delay is 50us. If it's an instruction, the delay is 5500us. You need to
fix your send_byte() function to do this. Test the 'address' parameter
with an if-else statement. If address == 1 then do a 50us delay, else
do a 5500 delay.
Of course, for a quick test, you can just edit the code and make it always
be a 5500us delay. The long delay should work for both instructions and
data, and it will prove quickly if that's the problem.
Also, in places where they have a 5500us delay, I don't think you should
shorten it to 5ms. Just use delay_us(5500). Until you know what the
problem is, it's safer to follow their example as closely as possible.
I didn't look at the ASM code any farther than this. If what I posted
above doesn't fix the problem, then I'll look at it some more. |
|
 |
demonspells
Joined: 06 Jan 2011 Posts: 26
|
|
Posted: Sat Mar 26, 2011 3:02 pm |
|
|
okay i tried adding this to the end of lcd_send_byte()
| Code: |
if(address)
delay_us(50);
else
delay_us(5500);
|
still nothing
I also noticed they used 16.5ms delay before initialization, I also tried it instead of 35ms or 50ms, nothing came along _________________ Badr Ghatasheh |
|
 |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Mar 26, 2011 3:46 pm |
|
|
What happens if you remove the if-else and only use delay_us(5500) ?
I also note that you have changed the order of the initilization bytes
in your init array, from the order used by them in the ASM code.
They do:
48, 48, 48, 56, 8, 1, 6, 12
in Hex:
0x30, 0x30, 0x30, 0x38, 8, 1, 6, 0x0c
Last edited by PCM programmer on Sat Mar 26, 2011 3:50 pm; edited 1 time in total |
|
 |
demonspells
Joined: 06 Jan 2011 Posts: 26
|
|
Posted: Sat Mar 26, 2011 3:49 pm |
|
|
the same _________________ Badr Ghatasheh |
|
 |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Mar 26, 2011 3:50 pm |
|
|
Read my post above. I was making an edit to add more while you
were posting. |
|
 |
demonspells
Joined: 06 Jan 2011 Posts: 26
|
|
Posted: Sat Mar 26, 2011 3:57 pm |
|
|
| Code: | int8 const LCD_INIT_STRING[8] =
{ 0x30,0x30,0x30, 0x38, 8, 1, 6, 12 }; |
and still nothing
is that even possible !!!!
i've checked the routines over and over and over
so if it's not initialization sequence, and not the delays, what else would it be !
i can't see any difference _________________ Badr Ghatasheh |
|
 |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Mar 26, 2011 4:56 pm |
|
|
I'm not in my office today, so I can't really do my normal method of
trouble-shooting, which includes testing things in hardware. I can do
that maybe tomorrow afternoon. I can't do anything more today. |
|
 |
demonspells
Joined: 06 Jan 2011 Posts: 26
|
|
Posted: Sun Mar 27, 2011 2:53 am |
|
|
thanks PCM
I'll keep trying till then, and will keep you posted for any updates _________________ Badr Ghatasheh |
|
 |
demonspells
Joined: 06 Jan 2011 Posts: 26
|
|
Posted: Sun Mar 27, 2011 7:45 am |
|
|
I've got something,
whenever I use Lcd8_Init() I have to call Lcd8_Cmd(LCD_CURSOR_OFF);
which is nothing more than sending 0x0C after the initialization sequence
if I don't call this function, nothing appears on the lcd
I've tried adding another 0x0C to the sequence, and got nothing _________________ Badr Ghatasheh |
|
 |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Mar 27, 2011 1:38 pm |
|
|
| I don't know your status. Is it now working ? |
|
 |
demonspells
Joined: 06 Jan 2011 Posts: 26
|
|
Posted: Sun Mar 27, 2011 3:02 pm |
|
|
Not really.
I can't think of anything else to fix this routine
I think I'll buy another pair of LCDs tomorrow
Thank you for everything PCM, it didn't work, but now I know every little detail in Alphanumeric LCDs, all thanks to you _________________ Badr Ghatasheh |
|
 |
|