could be many things here. But at least, can you confirm all of the following tests- Is a simple led blink work on both of your PIC
- Is the LCD work on your 16F877
Another thing... is the SERIN Idle state may cause you a grief? idle what? look at the following post...
http://www.picbasic.co.uk/forum/show...86&postcount=5
Be sure you set the transmitter pin to the corect state before sending something.
You DEFINE OSC is not correctly writen.. no problem anyway, it will not be considered. Chances are that the default OSC is 4. DEFINE spelling and writing is often discussed here... almost every week/month. They must be written as state in the manual, in UPPERCASE.
DEFINE OSC 4 without any underscore.
Also, when using 12Fs with internal osc in a serial comm, you should consider using the OSCCAL value to ensure a better Oscillator precision. Personnally i always use it, serial comm or not. it's just a simple code line after all
SET OSCCAL_1K 1
If you have a good device programmer, and if you're lucky, the OSCAL value is still there. To check it, just read your PIC and look at the last memory location... should different of 3fff
what else... maybe enough to start i guess
what about ...
Code:
' 12F675
@ DEVICE INTRC_OSC, WDT_OFF, MCLR_OFF, PWRT_ON
DEFINE OSCCAL_1K 1
DEG VAR BYTE
CMCON=7
ANSEL=0
TRISIO.0=0
GPIO.0=0 ' Set corect idle state
DEG=1
BASLA:
PAUSE 3000
SEROUT2 GPIO.0,16780,["A",DEG]
PAUSE 200
goto BASLA
You don't need to attach the R/W pin of your LCD to the PIC if you don't plan to read from. Just connect it to GND.
Bookmarks