Start small and work your way up!
I don't know how much programming you've done, if you've made a blinky LED, follow a switch, etc.etc.
The program below should (according to the datasheet) reset the LCD back to defaults (forget about that switch, the backlight, the serial communications, etc.) and just output the alphabet, one character every 1/4 second and repeat itself over and over again...
@ DEVICE PIC16F88,INTRC_OSC_NOCLKOUT
@ DEVICE PIC16F88,PROTECT_OFF
@ DEVICE PIC16F88,WDT_OFF
@ DEVICE PIC16F88,PWRT_ON
@ DEVICE PIC16F88,MCLR_ON
@ DEVICE PIC16F88,BOD_OFF
@ DEVICE PIC16F88,LVP_OFF
@ DEVICE PIC16F88,CPD_OFF
@ DEVICE PIC16F88,DEBUG_OFF
@ DEVICE PIC16F88,CCPMX_OFF
OSCCON = %01100000 '4MHz
INCLUDE "modedefs.bas"
ANSEL = %00000000
TRISB.1 = 0
TRISB.0 = 1
dataout var byte
Waitloop:
serout portb.1 , n9600 , [ $32 ] 'according to serlcdv2.5 datasheet, should reset LCD back to 9600 (defaults) if it's stuck on some other baud rate
for dataout = 64 to 89
serout portb.1 , n9600 , [ dataout ]
pause 250
next dataout
goto waitloop
end
Also, according to the datasheet, are you even seeing the 'splashscreen' during power up? If not, you've got other problems. Read the datasheet, you'll see it.
EDIT:
I forgot to mention...
The 4mhz internal oscillator isn't exactly accurate. If you're getting random characters, that might be the reason.
9600 baud is at the upper end of SEROUT's usability at 4mhz. In this case, it should be ok, but if your 4mhz internal oscillator is a bit low, it might end up being TOO low.




Bookmarks