Hello folks... I am using a 16F690 to attempt to read the serial output of a sensor module. It's a sonar module from Maxbotix that is supposed to output an 8-bit distance in inches preceded by an ASCII "R" at 9600 baud inverted.

Below is my code. It just times out and jumps to "comm" every time. I've tried several different variations on the serin command with the same result.

----------
@ DEVICE INTRC_OSC_NOCLKOUT, MCLR_OFF,WDT_OFF,PROTECT_OFF
Include "modedefs.bas"
DEFINE OSC 8
ADCON1 = 7 '
ANSEL = %00000000


OSCCON = %01110000 ' 8MHz

distance var byte
distance = 0

TRISC.5 = 0 ' output
TRISC.4 = 1 ' input
TRISC.2 = 1 ' input

range:
'SERIN PORTC.2,N9600,["R"],distance
SERIN2 PORTC.2,16468,1000,comm,[wait ("R"), DEC distance]
pause 100


comm:
SEROUT PORTC.5,N2400,[#distance,10,13]
SEROUT PORTC.5,N2400,["ok",10,13]
goto range
----------

Is there something I'm missing in my configuration? All those configuration bits are definitely my weak point - I always end up with more questions than answers when I read about them in the datasheets.

Here's the FAQ for the module if you're interested: http://maxbotix.com/MaxSonar-EZ1__FAQ.html