Serial not working on Cheapduino

Hi guys,

I am trying to build a GPS tracking collar for my dog using: Xbees, an adafruit ultimate GPS module, and a Cheapduino (Cheapduino (5PCS) - DFRobot). I know it's not strictly Arduino, but it uses the Arduino NG bootlader \w ATmega8 microprocessor and I don't think there is a better place for a post like this.

Anyways, my problem is with trying to use the UART Tx and Rx pins on the cheapduino. I know the soldering connects are fine because when I connect the GPS module directly to the UART pins and open a serial monitor in the Arduino IDE, I get the NMEA outputs which I should be getting. However, when I read the data into the cheapduino and send that data over the xbees, it doesn't work. I also know my Xbees are setup fine because when I connect the GPS module directly to the xbees and open a terminal, I get the proper NMEA output. So it looked like the reading/writing from the Cheapduino was the problem.

So I set up a simple circuit to test out my theory. I am trying to send something over the xbees and have the cheapduino basically echo it back. Here is the code:

void setup()
{
  Serial.begin(9600);
}

void loop()
{
  while (Serial.available() ) {
    Serial.write(Serial.read()); // reply with whatever you receive
  }
}

Here is the picture of my setup:

and here is a schematic of it:

On the receiving Xbee, it is connected directly to my computer via an FTDI adapter.

When I open the serial monitor on the computer, I don't get anything. It appears that when I use Serial to output stuff directly from the cheapduino to the computer terminal, everything works fine. I can print stuff to the terminal and I can send commands. However, when I disconnect from the computer and try to read/write over the UART pins, it doesn't work.

I am fairly new to Arduino programming, but from everything I have seen on the internet, this should work. I have also tried loading the Dimmer example onto the cheapduino and controlling an LED, but that doesn't work either... and I did change the pin number to match the Cheapduino in the example. I also have selected the correct board type and baud rate in the Arduino IDE. I have spent two days googling and trying to get this to work, but I am stumped.

Here is the documentation for the Xbee: http://ftp1.digi.com/support/documentation/90002173_N.pdf
Here is the closest thing to documentation for the Cheapduino: CheapDuino_(SKU_DFR0236)-DFRobot

Any help would be appreciated. Thanks in advance.

Cheers,

  • Peter

OK nice now post your code in full, as is!

Mark

That is the full code. All I want to do is get the cheapduino to echo back anything I type into the serial monitor. I got the code from:
Inkling.

But with only this uploaded onto the cheapduino, wouldn't anything I type into the serial monitor get sent via my xbee attached to my computer by an FTDI adaptor, to the xbee attached to the cheapduino, where then on the cheapduino it is read in and then sent directly back to my computer via the xbees?

Your diagram shows the battery symbol the wrong way round. If it's just an error in the drawing, no problem. If you do have the battery or power supply wired with the positive terminal to ground then you have a problem.

Pete

Sorry, it is an error in the diagram. I have the positive wired to the positive on the breadboard and ground to ground as well. I believe it should also be in the picture.

Peter

I think i figured it out! It seems to be a hardware issue. It seems the Tx and Rx pins are mislabeled on the board... who knew? The labeled Tx pin is actually the Rx pin and vice versa. I found that out when I programmed it to just print a string "Test" instead of receiving input and then printing. When I checked the pins with the multimeter, I was picking up a voltage on the labeled Rx pin. Then I switched the Tx and Rx pins, and voila.... I was getting the string printed on my screen. I hope this anyone else who was/will have trouble with this in the future.

Seeing as this is now a hardware issue with the microcontroller, can a moderator move this into the correct category? I would but I am unsure of how to do that/I don't even know if I am able to.

Cheers,

  • Peter