Rex Knepp - 2009-11-17

I have just started interfacing to an DIGI XBEE wireless unit using an 18F4525.  I have not been able to find very clear documentation on how to define the RS232 parameters on the PIC.  By trial and error I have discovered that I need to use Channel 3 in my commands.  Can someone point me to concise documentation on how to configure the RS232 port?  At this point I have data transmitting, but I am only receiving garbage.  I have checked my parameters on both ends and they appear to be the same.  Are there other commands that allow you to send or receive more than one character?  Here is a code fragment:

    #chip 18f4525, 20
    #config OSC=HS
    #define SendCHigh Set PORTc.6 ON
    #define SendCLow Set PORTc.6 OFF
    Dir PORTc.6 Out 'Set TX pin to out for Serial Use
    Dir PORTC.7 In  'Set RX pin to in for Serial Use
    InitSer(3,r9600,1+WaitForStart,8,1,none,normal)
    loop1:
    SerSend 3, h'FF'
    wait 500 ms
    SerSend 3, h'F0'
    wait 500 ms
    SerSend 3, h'0F'
    wait 500 ms
    goto loop1