??? 01/30/07 06:54 Read: times |
#131696 - Ah lcd problems! Responding to: ???'s previous message |
That's the second time this week!
Firstly, we don't know how fast you're clock the 2051. It can work up to 24mhz last time I used one of these. So, we need to know how fast your cpu is. This influences the instruction timing and your delay timing. Currently, we can see you're doing a delay, but what the actual delay is, is anyone's guess. Depending on your clock speed, you may not be allowing enough setup time for R/!W and RS before you set EN high. At 12MHz, you're ok, any faster you need to add some NOPs. With your delay - one delay does not fit all (unless it is the longest delay required) , for the EN high to low delay, this only needs to be a few cycles at most whereas for the LCD controller delay, this varies depending on the instruction. LCD_INI: CLR A MOVC A,@A+DPTR JZ GO_B1 ;<-zero test here! LCALL COM LCALL DELAY INC DPTR SJMP LCD_INI GO_B1: RET So calculate the required delays carefully and re-read the datasheet carefully. |