Hi Albert,

[email protected] wrote:

> Just finished by 18f USB board with RS-232 and a 44780 LCD, the board
> has a 20MHZ osc, but using the internal PLL to get a target clock of
> 48 MHz. During debugging of the board to get the LCD to work, I
> noticed that the enable pulse is out of spec, looking in the
> lcd_hd44780_4 file, I saw there is just one NOP
> 
>    asm nop                                      -- delay (> 400 ns)

The lcd lib seems indeed be based on the assumption that 20 MHz is the 
maximum speed of a PIC.

> the end there was another problem with the board, so when I
> reverted back to the original lcd_hd44780_4
> file it did work, but probably it is better to replace it with a
> delay_1us(), so it will work by design and not by accident.

When you look in the ASM expansion the nop is not the only instruction 
between switching the EN bit on and off. So in practice their may be not 
a problem (until the PICs become faster or the compiler more clever).
So a _usec_delay(1) is more safe.

BTW In the ASM listing of a test program I think I see another issue: 
the data port is updated *after* lcd-en = high, while it is supposed to 
be set before it. Looks like the compiler shuffled instructions.   I 
have to figure this out... (but I'm afraid not today).

Regards, Rob

-- 
Rob Hamerling, Vianen, NL (http://www.robh.nl/)

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to