
Originally Posted by
Darrel Taylor
All you've done is treat the symptom.
The problem is still there.
And you've created some new problems in the process.
Changing the LCD DEFINEs to LATA/B just overcomes the R-M-W (Read-Modify-Write) problem when ports are set to analog mode. It might seem like it's working fine, but it's not the right way to go.
By doing that, the LCDOUT routines can't find the TRIS registers. Normally it finds TRIS by adding 12h to the Defined PORTx address. PORTA is F80h, if you add 12h, you get F92h which is the correct address for TRISA. But when you specify LATA (F89h), add 12h and you get F9Bh which is the OSCTUNE register.
The only reason it worked is because you had already set all pins to output with the TRISA and TRISB assignments. (and you weren't using the internal oscillator)
But, here's the good news.
ADCON1 = $0F
should fix it.
Be sure to change the LCD DEFINEs back to PORTA/B
Bookmarks