RX/TX issues with BLE

Hi,

I'm having trouble with interfacing with a Bluetooth 4.0 BLE Module, type DBM01. This is the datasheet of the module. I have a minimal Arduino (328p) on a protoboard happily blinking it's led. To program the board, i'm using the ICMP header pins and an USBasp programmer to flash the chip using the Arduino 1.0.5 IDE.

To skip the difference in voltage level, i am running the ATMega at 3.3v. I have the module wired up as follows: - Gnd-Gnd - 3v3 - 3v3 - RX -> AtMega TX (pin 3 / D1) - TX -> AtMega RX (pin 2 / D0)

I can send data no problem. My problem is receiving data over the RX pin. The serial.Read() simply returns 0. I checked with a logic analyser and everything looks ok, the module does transmit the data, but the atmega isn't picking up anything.

Here's the sketch i'm using, i'm pretty sure it is good:

int led = 13;

void setup() {                
  pinMode(led, OUTPUT);  

  Serial.begin(38400);  
  
  digitalWrite(led, true);
}

void loop() 
{
    if(Serial.available() > 0)
    {
      int data = Serial.read();
      if(data & 1)
      {
         digitalWrite(led, true);
      }
      else
      {
        digitalWrite(led, false);
      }
    }
}

The following problems come to mind: - even though the cpu runs at 3.3v the levels of the ble module are not high enough to signal the cpu that data is coming in - use of the internal crystal of the 328p @8Mhz isn't coping with 38400 baud at 3.3v.

Any help would be welcome.