Bluegiga WT32 & Duemilanove

Sorry if this issues has been asked and answered but I can not find a solution.

I connected WT32 to Arduino pro
3.3 to VCC
gnd to gnd
pin 7 to BTEN
pin 6 to Reset
pin 12 to TX0
pin 13 to RX0

Using the same code as Yves did in "serial communication troubles... arduino and wt32" posted 6/7/09 but I only get Goodnight moon! and some garbage.

Do I need additional code to address CTS/RTS? I have search this forum and Sparkfun but can not find the basic setup to begin programming.

Thank you for any help.

#include <NewSoftSerial.h>
NewSoftSerial mySerial(12, 13);

int resetpin = 6;
int btenpin = 7;

unsigned long now;


void setup()  
{
  Serial.begin(9600);
  Serial.println("Goodnight moon!");

  // set the data rate for the NewSoftSerial port
  mySerial.begin(9600);



  pinMode(resetpin, OUTPUT);
  pinMode(btenpin, OUTPUT);
  digitalWrite(resetpin, LOW);
  delay(200);
  digitalWrite(resetpin, HIGH);
  delay(200);
  digitalWrite(resetpin, LOW);
  delay(200);
  digitalWrite(btenpin, HIGH);
  delay(500);
  digitalWrite(btenpin, LOW);

  now = millis();
}

void loop()                     // run over and over again
{

  if (mySerial.available()) {
    Serial.print((char)mySerial.read());
  }
//  if (Serial.available()) {
//    mySerial.print((char)Serial.read());
//  }

  if (millis() - now > 10000){
    mySerial.println("INQUIRY 6");
  }
}

The NewSoftSerial constructor expects the receive pin first, then the transmit pin. Your comments seem to imply that they are supplied in the reverse order.

I tried both ways and still nothing. If TX0 is connected to pin 13 then I do not get anything, otherwise I get garbage.

Is the WT32 (whatever that is) talking at 9600 baud? If it's a bluetooth device, that seems awfully slow.

You cant use pin 13 for input.

Swap your TX and RX around (physically and in code), and see if that works.

Thanks for the advice of changing the TX and RX. I did that but still nothing.

I have the WT32 board in a bread board and have connected a USB to TTL serial converter cable. Using RealTerm I get the right output from the WT32. Without disconnecting the RealTerm connection I also connect additional wires to the Arduino to match my code. The new program is below. The problem seem to be in the Serial.print((char)mySerial.read()); statement.

RealTerm is displaying correctly but the serial monitor in Arduino displays garbage. I tried switching the code and wires for RX and TX and got the same result.

#include <NewSoftSerial.h>
NewSoftSerial mySerial(12, 13);
unsigned long now;

void setup()  
{
  Serial.begin(115200);
  Serial.println("Goodnight moon!");

  // set the data rate for the NewSoftSerial port
  mySerial.begin(115200);
  now = millis();
}

void loop()                     // run over and over again
{

  if (mySerial.available()) {
    Serial.print((char)mySerial.read());
  }
}

By default bluegiga modules come with following UART settings:

115200,8n1 hardware flowcontrol enabled

flowcontrol can be disabled by hardware if you connect CTS to ground and leave the RTS floating

I do no longer have a problem with flow control. I tried connecting a USB to serial cable using RealTerm without hardware flow control and it worked. My problem is I cannot see useful data from within the Arduino serial monitor.