thanks for the replay
well,

I was using another code and when i run the matlab code i provided before, portc.6 which is RS232 RX blink twice. that means the pic is receiving the data.the problem is how to read that data. the OSC value is 4 and the pic is on a flash-lab 77 that has max233 built on it. I am using 9600 baud rate for matlab, pic and my pc.


the code that shows a blinking in the RX pin is:

Include "bs2defs.bas"
DEFINE OSC 4
SerI var PORTC.0
TRISD = %00000000
PortD = %00000000
Received var byte
High PORTA.1
pause 1000
Serin seri,N9600, ["3"],Received 'to receive i
PORTD = received
low porta.1
end