Trying to understand serial communications..
The aim is to load a large number of 5 digit numbers into a serial eeprom from a PC.
Step 1 is to master serial comms from PC.

Using serial communicator (Microcode Studio tool) I send "1234", BUT LCD displays "Received = 3846"

Any advice would be most welcome.

My code..

'**********************************
@ device PIC16F877a , hs_osc, wdt_on, lvp_off, protect_off
CLEAR
DEFINE OSC 8

DEFINE LCD_DREG PORTB ' Set LCD Data port
DEFINE LCD_BITS 4 ' Set LCD bus size (4 or 8 bits)
DEFINE LCD_DBIT 4 ' Set starting Data bit (0 or 4) if 4-bit bus
DEFINE LCD_RSREG PORTB ' Set LCD Register Select port
DEFINE LCD_RSBIT 2
DEFINE LCD_EREG PORTB ' Set LCD Enable port
DEFINE LCD_EBIT 3 ' Set LCD Enable bit

PortA = %00000000 'all outputs low
PortB = %00000000 'all outputs low
TrisA = %00000000 'All as outputs
TrisB = %00000000 ' B.0 as input all others as outs
TrisC = %11111111

include"modedefs.bas" ' includes aliases for modes
W0 var word
B0 Var byte
B1 var byte

LCDOUT 254, 1 'Clear Screen
pause 100
LCDOUT 254, 1 'Clear Screen
LCDOUT "W0 = " , dec W0
pause 1000
LCDOUT 254, 1 'Clear Screen
mainloop:

serin PortC.7,T2400,[] ,w0.lowbyte ,w0.highbyte

LCDOUT 254, 1 'Clear Screen
LCDOUT "Received =" , #W0
pause 1500

goto mainloop

end
'*******************************************