New PICDEM2 LCD problem

Discussion of PIC® MCUs.

Postby PCM programmer » Wed Feb 07, 2007 3:02 pm

It could be this one. The company is in Arizona, the same as Microchip.
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_chara ... minary.pdf
Last edited by PCM programmer on Wed Feb 07, 2007 3:11 pm, edited 1 time in total.
PCM programmer
 

Postby mindstorm88 » Wed Feb 07, 2007 3:07 pm

i was just a bit faster than you :grin: , 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 !! :oops:
mindstorm88
 

Postby PCM programmer » Wed Feb 07, 2007 3:12 pm

See my latest edits right above.
PCM programmer
 

Postby mindstorm88 » Wed Feb 07, 2007 3:21 pm

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 ?
mindstorm88
 

Postby PCM programmer » Wed Feb 07, 2007 3:39 pm

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.
PCM programmer
 

Postby mindstorm88 » Wed Feb 07, 2007 6:24 pm

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 !!!
mindstorm88
 

Postby PCM programmer » Wed Feb 07, 2007 6:41 pm

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):
|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.
PCM programmer
 

Postby mindstorm88 » Wed Feb 07, 2007 7:33 pm

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 !!!
mindstorm88
 

Postby PCM programmer » Wed Feb 07, 2007 10:01 pm

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: Select all
//----------------------------
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: Select all
#define LCD_POWER PIN_D7
PCM programmer
 

Postby mindstorm88 » Thu Feb 08, 2007 5:41 am

Saddly :sad: , no change at all , seems that the busy bit is only good for the fist 8 char :confused:
mindstorm88
 

Postby mindstorm88 » Thu Feb 08, 2007 9:25 am

Good Day PCM , i got it working!!! but not the way we usually do , i did comment :
Code: Select all
//#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 is 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 !!!
mindstorm88
 

Postby PCM programmer » Thu Feb 08, 2007 12:36 pm

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.
PCM programmer
 

Postby mindstorm88 » Fri Feb 09, 2007 12:45 pm

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

Postby PCM programmer » Tue Feb 13, 2007 6:22 pm

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.
PCM programmer
 

Postby mindstorm88 » Tue Feb 13, 2007 6:57 pm

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
mindstorm88
 

PreviousNext

Return to PIC® MCU General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest

cron