
before:wires stripped
after: soldered to 22 guage wire, then wrapped around with scotch tape. I don't have electrical tape or shrink tubing on me now, nor the automotive operational skills to get any...

connector and arduino plugged into the breadboard.
Things aren't working! I tried connecting the GPS module to the connector. The red led lit up, then after a while started blinking, which according to the datasheet means that the position is fixed. Yay! That's great.
As for communicating with the EM406 chip via serial, it's not working. The arduino is supposed to communicate through serial, at 4800 baud, but I can't find the protocol online to request data. I swear that I found a series of timing diagrams on a pdf somewhere with the signals that have to go to rx and tx pins, but I can't find it now.
Benedetta Simeonidis was also working on interfacing the Arduino and the EM406. She seems to have got it working, but her code doesn't work for me. I tried my own code, which doesn't work either. Here's the code anyways.
#define rxPin 7
#define txPin 8
#define ledPin 13
#define bit4800Delay 188
#define halfBit4800Delay 94
//definitions for 4800 baud communication
byte val;
boolean ledPinOn;
void setup() {
// define pin modes for tx, rx, led pins:
pinMode(rxPin, INPUT);
pinMode(txPin, OUTPUT);
pinMode(ledPin, OUTPUT);
digitalWrite(txPin, HIGH); //set transmit pin to high
digitalWrite(ledPin, HIGH); //turn on debug led
ledPinOn = true;
// set the data rate for the SoftwareSerial port
Serial.begin(4800); //4800 is the baud rate for EM306
}
int SWread()
{
byte val = 0;
Serial.println("waiting for start bit");
while (digitalRead(rxPin))
{
Serial.println(digitalRead(rxPin), BIN);
}
//wait for start bit
Serial.println("done waiting");
if (digitalRead(rxPin) == LOW) {
Serial.println("rxPin is low");
delayMicroseconds(halfBit4800Delay);
for (int offset = 0; offset < 8; offset++) {
delayMicroseconds(bit4800Delay);
val |= digitalRead(rxPin) << offset;
//iterate through bit mask.
//Or, in other words, each bit is sent after a bit4800delay,
//from MSB to LSB. get the first most significant bit, shift it left, etc.
}
//wait for stop bit + extra
delayMicroseconds(bit4800Delay);
delayMicroseconds(bit4800Delay);
Serial.println("got data");
return val;
}
Serial.println("rxPin is not low");
}
void loop() {
Serial.println("started loop");
Serial.print(SWread(), BYTE);
if(ledPinOn == true) ledPinOn = false;
else ledPinOn = true;
digitalWrite(ledPin, ledPinOn);
// toggle an LED just so you see the thing's alive.
// this LED will go on with every OTHER character received:
}
The point at which things get stuck is at
while (digitalRead(rxPin)); //wait for start bitwhere the protocol for communicating with the GPS chip seems to involve waiting for the receiving rx pin to be low briefly, then to initiate data input. This seems strange.
Where can I find that datasheet??
update: it works.
Comments (2)
HI
Same problem here have tried several code but no output did you find a code that is working.
Thanks
Jurie
Posted by Jurie | August 4, 2008 11:46 AM
Ah yeah -- I did, a few days later. I added an update link, or you can go here:
http://www.provolot.com/projectlog/2007/05/works1.html
Posted by provolot | August 11, 2008 2:33 AM