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 CCS Technical Support

Problem in Flex_420 LCD Driver
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Mar 26, 2011 2:52 pm     Reply with quote

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

View user's profile Send private message Yahoo Messenger MSN Messenger

PostPosted: Sat Mar 26, 2011 3:02 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Mar 26, 2011 3:46 pm     Reply with quote

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

View user's profile Send private message Yahoo Messenger MSN Messenger

PostPosted: Sat Mar 26, 2011 3:49 pm     Reply with quote

the same
_________________
Badr Ghatasheh
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Mar 26, 2011 3:50 pm     Reply with quote

Read my post above. I was making an edit to add more while you
were posting.
demonspells



Joined: 06 Jan 2011
Posts: 26

View user's profile Send private message Yahoo Messenger MSN Messenger

PostPosted: Sat Mar 26, 2011 3:57 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Sat Mar 26, 2011 4:56 pm     Reply with quote

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

View user's profile Send private message Yahoo Messenger MSN Messenger

PostPosted: Sun Mar 27, 2011 2:53 am     Reply with quote

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

View user's profile Send private message Yahoo Messenger MSN Messenger

PostPosted: Sun Mar 27, 2011 7:45 am     Reply with quote

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

View user's profile Send private message

PostPosted: Sun Mar 27, 2011 1:38 pm     Reply with quote

I don't know your status. Is it now working ?
demonspells



Joined: 06 Jan 2011
Posts: 26

View user's profile Send private message Yahoo Messenger MSN Messenger

PostPosted: Sun Mar 27, 2011 3:02 pm     Reply with quote

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
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
Page 2 of 2

 
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