plzz help..serial problem!!

I am using the rabbit RCM 4010 dev. kit for serial communication. my code:

#class auto

// change serial buffer name and size here

#define DINBUFSIZE 7
#use “RCM40xx.lib”
// change serial baud rate here
#ifndef _232BAUD
#define _232BAUD 57600

// Define timeout between bits being received
#define MAXS 100

void main()
// Declaratioins
auto char cOut;
auto int tranflag;
char s[8];
char t[8];
char init[2];
auto int length;
auto int written;
auto int read;
auto int n;

// Define variables
length = sizeof(s);
init[0] = 128;
init[1] = 131;

// Open serial, clear buffers, turn off Flw Cntrl

// Initialize communicatin and put robot in X mode

       s[0] = 128;
       s[1] = 128;

       // Query Robot
       //written = serDwrite(s,length);

     //printf("peek %d

read = serDread(t, 2, MAXS);
if (read != 0)
printf("Read: %d




there is a lot of extra crap in there from me debugging and etc. Basically i have a device that spits out serial data at 5v ttl and i wanna read it and send commands to it. so i have the transmit of my device going into the receive of the board which is pc1 and my (i’m using port D as my serial port) and the receive of my device connected to transmit of the board.

The strange part is that i can send and receiver perfectly fine when i connect a computer to the db9 cable connected to the header on the little dev. board that the rabbit core plugs into (this is rs232 and just used to test). Also i can send serially to my device with no problem using pc0 pin (ttl level). When i try to receive though on pc1 it won’t read anything…just says the receive buffer is empty(using the serDpeek() function). i read somewhere that you might have to remove the 0 ohm resistors to use the 5/3.3v ttl level pins (pc0 and pc1). Do i need to do this…i can’t figure this out so any ideas are welcome.

Basically when i use RS232 with the db9 cable from the proto board Tx and Rx work fine. When i use PC0 and PC1 to talk to my device i can only transmit…it won’t receive anything.


I am just a new guy for RCM 4010 Dev. Kit and just got my own kid yesterday. I also have my own problem and just posted it yesterday� When I read the HTML help file, I found something but not sure this would answer your question. This is what they said…
�RS-232 serial communication on header J4 on both Prototyping Boards is supported by an RS-232 transceiver installed at U3. This transceiver provides the voltage output, slew rate, and input voltage immunity required to meet the RS-232 serial communication protocol. Basically, the chip translates the Rabbit 4000’s signals to RS-232 signal levels. Note that the polarity is reversed in an RS-232 circuit so that a +3.3 V output becomes approximately -10 V and 0 V is output as +10 V. The RS-232 transceiver also provides the proper line loading for reliable communication.
RS-232 can be used effectively at the RCM4000 module’s maximum baud rate for distances of up to 15 m.�
On my 8051 project, I used Line Driver Max 232 chip, so I do not know this will help you or not, just a opinion�