Re: Interesting result on a 16F688 with ADC and LCD
OK I now have something on LCD but its jibberish. I moved chip and lcd to breadboard for time being, PORTC 0-3 is now starting bits, RS is C.4 and E is C.5, nothing else is hooked up except LCD. I will need to turn on ADC for PORTA 0 & 1 after LCD starts working.
heres the code, notes are beside respective lines
Code:
DEFINE LCD_DREG PORTC ' LCD Data bits on PORTD
DEFINE LCD_DBIT 0 ' PORTD starting address
DEFINE LCD_RSREG PORTC ' LCD RS bit on PORTD
DEFINE LCD_RSBIT 4 ' LCD RS bit address
DEFINE LCD_EREG PORTC ' LCD E bit on PORTD
DEFINE LCD_EBIT 5 ' LCD E bit address
DEFINE LCD_BITS 4 ' LCD in 4-bit mode
DEFINE LCD_LINES 4 ' LCD has 4 rows
ADCON0 = 0 ' Tried it with and without this line
ANSEL = 0 ' Tried it with and without this line
TRISA = %00000011 ' Left this cause it shouldnt hurt LCD
TRISC = %00000000
LCDOUT $FE, 1 ' Clear LCD
PAUSE 500 ' Wait 0.5sec for LCD to initialize
AGAIN:
LCDOUT $FE, 2
LCDOUT $FE, $80
LCDOUT "This is a Test"
pause 1000
GOTO AGAIN ' Repeat
Theres not much here to go wrong, anyone see anything?
Chris
Any man who has accomplished anything in electronics at one time or another has said... " STOP! WAIT! NOOO! Dangit.... Oh Well, Time to start over..."
Bookmarks