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

New PICDEM2 LCD problem
Goto page Previous  1, 2, 3  Next
 
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: Wed Feb 07, 2007 3:02 pm     Reply with quote

It could be this one.
It's a COG display. It uses the NT7605 controller. It sort of looks like
the one on the new Rohs version of PicDem2-Plus board.
http://www.azdisplays.com/prod/c1602u.php

Here's a data sheet for the controller:
http://www.ocularlcd.com/pdfs/driver/NT7605v0.4.pdf

I can look at this documentation later tonight.

----------------
I made my post above before I noticed that you had edited your post.

The 16x2 Ocular LCDs have data sheets that say Arizona Displays on them. So I think they are the actual manufacturer.
http://www.ocularlcd.com/18.html
The p/n that you posted isn't for a COG display. The one shown on
in the photo of the PicDem2-Plus is a COG type.

On the Ocular website, the LCD that looks the most like the one on
the PicDem2-Plus board is this COG one here:
http://www.ocularlcd.com/pdfs/cog_character/drawing/cc1622Rpreliminary.pdf

--------

Edited to remove comment about the company location. They are
actually located in California.


Last edited by PCM programmer on Wed May 07, 2008 11:51 am; edited 2 times in total
mindstorm88



Joined: 06 Dec 2006
Posts: 102
Location: Montreal , Canada

View user's profile Send private message

PostPosted: Wed Feb 07, 2007 3:07 pm     Reply with quote

i was just a bit faster than you Very Happy , see my post before your last , on my side i will try to figure out how they do in their demo , but i'm not really good in asm !! Embarassed
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 07, 2007 3:12 pm     Reply with quote

See my latest edits right above.
mindstorm88



Joined: 06 Dec 2006
Posts: 102
Location: Montreal , Canada

View user's profile Send private message

PostPosted: Wed Feb 07, 2007 3:21 pm     Reply with quote

OM16214 is really a COG i have the Ocular datasheet in my hand !! it is not on their site , not even the display ( i think it is a custom order ) do you want a copy of the datasheet ?
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 07, 2007 3:39 pm     Reply with quote

I don't think I need it. The init procedure given in the NT7605 data
sheet for 4-bit mode looks like the sample MPASM driver from Microchip
for the Rohs PicDem2-Plus. I'll translate it to C source later tonight
and post it. I'll also check the data sheet for any timing differences.
mindstorm88



Joined: 06 Dec 2006
Posts: 102
Location: Montreal , Canada

View user's profile Send private message

PostPosted: Wed Feb 07, 2007 6:24 pm     Reply with quote

I've just tried my ICD2 for the first time and it seem that after writing "Hello wo" to the display , it get stuck in a loop waiting for the busy bit !!!

So i guess timing is the problem !!!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 07, 2007 6:41 pm     Reply with quote

I think it's the initialization. "Hello Wo" is exactly 8 characters.
That's an important clue. I think the LCD is being initialized as
a 1x16 display. The memory map for a 1x16 display is (in hex):
Quote:

|00|01|02|03|04|05|06|07|40|41|42|43|44|45|46|47|

Notice a break in the addresses after the first 8 characters.

Later tonight, I will post a new lcd_init() routine that I believe will work.
I can't do right now.
mindstorm88



Joined: 06 Dec 2006
Posts: 102
Location: Montreal , Canada

View user's profile Send private message

PostPosted: Wed Feb 07, 2007 7:33 pm     Reply with quote

i did try , that display need 0x28 instead of 0x20 to be initialised as 2 lines , but it didn't make any differences , that the only thing i changed in the init !!!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Wed Feb 07, 2007 10:01 pm     Reply with quote

Here are the changes that I think should be made to the lcd_init()
function so it will work with the Rohs version of the PicDem2-Plus.
The changes are marked in the comments. You need to add two
lines and comment out a section. See the code below.

The main difference between the NT7605 controller and the HD44780
is that it doesn't want to get the three sets of '3' sent to it at the
beginning. The Microchip driver doesn't do that.

The Microchip driver also has a slightly different init string than is
normally used. The normal way is this: 0x28, 0x0C, 0x01, 0x06.
The Microchip driver is same except for the last byte. They use 0x02.
Initially, you ought to try it with just the changes shown below.

The Microchip driver also doesn't poll the Busy bit to see when a
command is finished. It substitutes a fixed delay. I don't see
anything in the Arizona Displays data sheet that says the Busy
won't work. It should work. So I don't recommend changing that
code at this time.

Try the changes that are shown in the comments:
Code:

//----------------------------
void lcd_init(void)
{
int8 i;

output_high(LCD_POWER);   // *** Add this line
delay_ms(40);             // *** Add this line

output_low(LCD_RS);

#ifdef USE_LCD_RW
output_low(LCD_RW);
#endif

output_low(LCD_E);

//-----------------------
// *** Comment out this section. ***

/*
delay_ms(15);

for(i=0 ;i < 3; i++)
   {
    lcd_send_nibble(0x03);
    delay_ms(5);
   }
*/

//------------------------

lcd_send_nibble(0x02);

for(i=0; i < sizeof(LCD_INIT_STRING); i++)
   {
    lcd_send_byte(0, LCD_INIT_STRING[i]);
   
    // If the R/W signal is not used, then
    // the busy bit can't be polled.  One of
    // the init commands takes longer than
    // the hard-coded delay of 60 us, so in
    // that case, lets just do a 5 ms delay
    // after all four of them.
    #ifndef USE_LCD_RW
    delay_ms(5);
    #endif
   }

}


Here's the definition for the power pin. It was posted earlier in the
thread but here it is again, for completeness.
Code:
#define LCD_POWER PIN_D7
mindstorm88



Joined: 06 Dec 2006
Posts: 102
Location: Montreal , Canada

View user's profile Send private message

PostPosted: Thu Feb 08, 2007 5:41 am     Reply with quote

Saddly Sad , no change at all , seems that the busy bit is only good for the fist 8 char Confused
mindstorm88



Joined: 06 Dec 2006
Posts: 102
Location: Montreal , Canada

View user's profile Send private message

PostPosted: Thu Feb 08, 2007 9:25 am     Reply with quote

Good Day PCM , i got it working!!! but not the way we usually do , i did comment :
Code:
//#ifdef USE_LCD_RW
//while(bit_test(lcd_read_byte(),7)) ;
//#else
delay_us(100); 
//#endif


so now it is working using a delay instead of watching busy bit !!! the same way the microchip demo code works !!!

is my display bad?? nobody else has commented this problem on that new board !!!

edit : just saw that our friend put back his driver in the other thread, but no go for me, so i suspect that my display is defective as far as busy bit, the board is new so i'll ask microchip for replacement !!!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Feb 08, 2007 12:36 pm     Reply with quote

I'm glad you got it working. I sent an email to Ocular LCD
to ask them why the Busy bit doesn't work with the OM16214.
I showed them the sample code from the Microchip driver,
where the programmer skipped testing the Busy bit and called
a fixed delay routine instead.
If they send me an answer then I'll post it here.
mindstorm88



Joined: 06 Dec 2006
Posts: 102
Location: Montreal , Canada

View user's profile Send private message

PostPosted: Fri Feb 09, 2007 12:45 pm     Reply with quote

Microchip is sending me a replacement display , so we'll see if mine is defective or the entire lot !!!
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Feb 13, 2007 6:22 pm     Reply with quote

I've ordered one of the new Rohs PicDem2-Plus boards. I've also been
in contact with tech support at Ocular LCD. When I get the board I'll
try their recommendations and post the results early next week.
mindstorm88



Joined: 06 Dec 2006
Posts: 102
Location: Montreal , Canada

View user's profile Send private message

PostPosted: Tue Feb 13, 2007 6:57 pm     Reply with quote

Hey PCM , any clue of these recommendation!!! , cause even without the busy bit check , sometimes it does not print first few character on startup !!!

Thanks
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  Next
Page 2 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