cc2500 interfacing with Arduino

hey,
im trying to interface my Arduino Duemilanove with a cc2500 module through a max232cpe ic.the connections are given below.

my question is, whien i write Serial.begin(9600), do i need to specifiy pinModes for pin # 1 and 0?

the reason why i am asking is because when i power the aruidno with the usb cable and check if the data is being serially sent from the arhuino to the Serial monitor, there is no problem, i.e the data can be seen on the monitor, the rx and tx leds are lighting when they should.

But as soon as i power the arduino with an external battery and run the same code, the rx and tx leds dont light up at all! what is the problem?

i realize that Serial.print() commands sends the data to a buffer and if there is nothing connected to the rx and tx pins then this buffer gets filled up after which no data is transmitted i.e the tx pin stops glowing. In my case, the tx pin doesnt even start glowing, even though the same code works for the serial monitor.

this means that there is somthing rong between the arduino and the cc2500 module. Please help!!

as soon as i power the arduino with an external battery

That means either :-

  1. the battery is not the right voltage
  2. the battery can't supply enough current
  3. you havent connected the ground of the arduino to the -ve of the battery

i dont think the power is the problem.. the power leds in both the arduino and cc2500 are glowing properly...
robosoftsystems.co.in/blog/?p=433
have a look at this link.. i have used the same battery which they have used(given in the illustrations)

ther is a seperate battery for the arduino and the cc2500 with common ground(i kno i havnt shown this in the diagram but i have tested it out with 2 batteries also) so im pretty suer the current is not the issue.

the rx and tx leds dont light up at all!

Is this when the USB is plugged in?

The TX and RX lights are not controlled by the arduino but by the USB driver in the host computer. On the bridge chip these are just GPIO and the driver flashes them to show something is happening. Is this fooling you into thinking something is wrong?

the tx led lights up(in 1 sec intervals according to the program arduino 1) when the program is running and the output is displayed properly in the serial monitor.
this is obviously when arduino is powered by the usb.

but when i connect the same rx and tx pins to the max232 (which is connected to the cc2500), and the power is given by external 9 v batteries(1 for arduino and 1 for cc2500), instead of the usb,no rx and tx leds light.

i tried another thing, i connected the rx of 1 arduino to the tx of arduino 2 and simmilarly the tx of 1 arduino with rx of arduino2, the program still works. in the sense that the led (pin 13) lights up properly.

here is the code i am using fot the testing:

//Arduino 1
void setup()
{
Serial.begin(9600);
}
void loop()
{
Serial.print(1);
delay(1000);
Serial.print(0);
delay(1000);
}

//arduno 2
void setup()
{
Serial.begin(9600);
pinMode(13,OUTPUT);
}
void loop()
{static int in;
if(Serial.available()>0)
{
in=Serial.read();
if (in==1)
digitalWrite(13,HIGH);
else
digitalWrite(13,LOW);
}
}

the job of the max232 is to convert the TTL signals from the arduino to the RS232 signals used by the cc2500 module.

is there any problem in interfacing the arduino with the max232

just checking, arduino does work with TTL signals right?

but when i connect the same rx and tx pins to the max232 (which is connected to the cc2500), and the power is given by external 9 v batteries(1 for arduino and 1 for cc2500), instead of the usb,no rx and tx leds light.

Yes as I said these lights are not controlled by the arduinos TX & RX lines they are controlled by the USB / serial chip commanded by the PC. So with no PC there is no TX & RX LEDs lit up. So what you see is what is to be expected and is not an indication of something going wrong.

just checking, arduino does work with TTL signals right?

Yes

is there any problem in interfacing the arduino with the max232

No I do it all the time.

Make sure you wire the output of the MAX232 correctly to the cc2500. There is a difference between DTR and CTR, this means you might have to connect TX to RX OR you might have to connect RX to RX.
This is because a label of RX can define either an input or an output. So make sure the output of the max232 is connected to the input on your cc2500 and the output of the cc2500 is connected to the input of the max232. And that the grounds are connected.

hmm.. ive done everthing i could.. ill try it again tom morn and post what happens, in the mean time, thanks for everything!