Show Posts
Pages: [1]
1  Using Arduino / Microcontrollers / Re: 2 months with the same problem GPS give rubbish with Arduino Uno. on: April 04, 2011, 04:39:43 pm
Lefty... you are really what I call ENGINEER...

in fact I the max232 inverted incoming data... so rubbish was outputed all the time no matter the code.

thank you ever so much and very a lot
2  Using Arduino / Microcontrollers / Re: 2 months with the same problem GPS give rubbish with Arduino Uno. on: April 04, 2011, 03:37:24 pm
Hello guys, as posted at the start I get rubbish from the GPS S1315R the I have. I try all the code that I could find online with the same result: rubbish.
 I went through the datasheet again
http://docs-europe.electrocomponents.com/webdocs/0df9/0900766b80df94d1.pdf

and it says SERIAL INTERFACE 3.3V LVTTL LEVEL.
I am using the max232 that give TTL.

is there any possibility that the problem might come from a non matching device?

thank you
3  Using Arduino / Microcontrollers / Re: 2 months with the same problem GPS give rubbish with Arduino Uno. on: April 04, 2011, 03:05:43 pm
Well, Daneel it still give rubbish. I order a new arduino... since I played a lot with this one I wander if I have not damaged it... or something.... I will check with the new one and give some updates...
4  Using Arduino / Microcontrollers / Re: 2 months with the same problem GPS give rubbish with Arduino Uno. on: April 02, 2011, 02:13:48 pm
thanks for you replies,

Daneel, I will try what you said and update you as soon as it is finished
5  Using Arduino / Microcontrollers / Re: 2 months with the same problem GPS give rubbish with Arduino Uno. on: April 01, 2011, 06:50:14 pm
There is a small mistake of } on the last message I posted... pls disregard.
6  Using Arduino / Microcontrollers / Re: 2 months with the same problem GPS give rubbish with Arduino Uno. on: April 01, 2011, 06:42:34 pm
see below the code I normally use to do get the information from the GPS.

The way you guys mention about the baud rate I feel like Serial.begin(9600); is not enough of a initialisation of a baud rate...?

what else should I do then if it is the case?

the code is a bit different that the first one.

void setup()
 {
   lcd.begin(16, 4);           
   pinMode(rxPin, INPUT);
   Serial.begin(9600); 
 }       


 }       

 void loop()
 {
if (Serial.available() > 0)
  {
      // read the incoming data:
  incomingdata = Serial.read();

if (incomingdata)
{
  j = 0;
  dataRead[j] = incomingdata;  //  include each char read to the array

     dataRead[j+1] = '\0';
     Serial.print(dataRead[j]);
     j++;
      }
  }
  else
  {
  Serial.print("Not found \n");
  delay(1000);
  }
 
  }

7  Using Arduino / Microcontrollers / Re: 2 months with the same problem GPS give rubbish with Arduino Uno. on: April 01, 2011, 05:42:20 pm
sorry to disappoint you, the baud rate was ok... during investigation that's the reason I have not mention it
8  Using Arduino / Microcontrollers / Re: 2 months with the same problem GPS give rubbish with Arduino Uno. on: April 01, 2011, 05:37:24 pm
Hello Westfw

I am using the max232 with the GPS S1315R. the GPS work with 9600bps which I used on the hyper terminal. in fact when I connect to the hyper terminal it does not do through the arduino and the result is great. I get the format I want. but through the arduino it is just something else... pretty much nonsense....

since everything work well with the hyper terminal... the conclusion is that there is no problem with the connections.
9  Using Arduino / Microcontrollers / Re: 2 months with the same problem GPS give rubbish with Arduino Uno. on: April 01, 2011, 05:30:49 pm
Spycathcer
The GPS receiver I use is defaulted to 9600. and can use the 115200 baud rate and some more. I checked the datasheet. so on the hyper terminal it was set on 9600.
10  Using Arduino / Microcontrollers / Re: 2 months with the same problem GPS give rubbish with Arduino Uno. on: April 01, 2011, 05:28:05 pm
Thank you for your answers...

That's your mistake.  You can't run NewSoftSerial AND hardware serial on the same two pins!

Pick two OTHER pins for NewSoftSerial.

I changed the port but I get exactly the same rubbish
11  Using Arduino / Microcontrollers / 2 months with the same problem GPS give rubbish with Arduino Uno. on: April 01, 2011, 03:07:57 pm
Hello brave sparkies
I should better cut the long story short. So, I interfaced the GPS with the arduino Uno using the serial port (0, 1). my goal is to reveice data from GPS.

I wrote a few codes with the help of www.arduino.cc but I face the same problem at the end.
I do receive data but the problem is they are all rubbish. here is the code I used for the last one, which is not mine... I just copy from http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1280535694

#include <NewSoftSerial.h>
NewSoftSerial nss (0,1);

void setup() {
  Serial.begin(115200);
  nss.begin(57600);
}

void loop() {
  if(nss.available()) {
    Serial.print(nss.read(),BYTE);
  }
}

What I received on the serial monitor is something close to ÆÑÙÝ-àÆÆÆ-ÉÎü,ÿÿÆÆññÆÆÆ
and bunches of different rubbish.

With the same GPS reciever I get this on the hyper terminal on the computer.

$GPGSV,1,1,01,09,00,000,20*43
$GPRMC,184045.000,V,0000.0000,N,00000.0000,E,000.0,000.0,010411,,,N*7F
$GPVTG,000.0,T,,M,000.0,N,000.0,K,N*02
$GPGGA,184046.000,0000.0000,N,00000.0000,E,0,00,0.0,0.0,M,0.0,M,,0000*62
$GPGSA,A,1,,,,,,,,,,,,,0.0,0.0,0.0*30

beside I have a second GPS receiver that behave exactly like the first one on the arduino UNO and on the hyper terminal (for those of you who has Window XP).

I investigated for quite sometime now (at least 2 months) and I think I do not have a clue of what do next anymore.
I tried to change the parity, stop bit and data lenght and different stuff with no avail.

at the end I suspected that the code I wrote was not correct so I used someone else code that worked (the one up there). it gives me exactly the same rubbish like any other algorithm.

from the troubleshooting I have done so far, I know for sure that the problem is from the microcontroller atmega328 (arduino). is it the programming? is it the parity, stop bit, data length?

can anyone provide me a code to set up the parity, stop bit and data lenght. I have done it but I am not certain that it was the right way.

should one point me in the right direction, it will be desperately appreciate.
12  Topics / Robotics / 2 months with the same problem GPS give rubbish with Arduino Uno. on: April 01, 2011, 03:07:04 pm
Hello brave sparkies
I should better cut the long story short. So, I interfaced the GPS with the arduino Uno using the serial port (0, 1). my goal is to reveice data from GPS.

I wrote a few codes with the help of www.arduino.cc but I face the same problem at the end.
I do receive data but the problem is they are all rubbish. here is the code I used for the last one, which is not mine... I just copy from http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1280535694

#include <NewSoftSerial.h>
NewSoftSerial nss (0,1);

void setup() {
  Serial.begin(115200);
  nss.begin(57600);
}

void loop() {
  if(nss.available()) {
    Serial.print(nss.read(),BYTE);
  }
}

What I received on the serial monitor is something close to ÆÑÙÝ-àÆÆÆ-ÉÎü,ÿÿÆÆññÆÆÆ
and bunches of different rubbish.

With the same GPS reciever I get this on the hyper terminal on the computer.

$GPGSV,1,1,01,09,00,000,20*43
$GPRMC,184045.000,V,0000.0000,N,00000.0000,E,000.0,000.0,010411,,,N*7F
$GPVTG,000.0,T,,M,000.0,N,000.0,K,N*02
$GPGGA,184046.000,0000.0000,N,00000.0000,E,0,00,0.0,0.0,M,0.0,M,,0000*62
$GPGSA,A,1,,,,,,,,,,,,,0.0,0.0,0.0*30

beside I have a second GPS receiver that behave exactly like the first one on the arduino UNO and on the hyper terminal (for those of you who has Window XP).

I investigated for quite sometime now (at least 2 months) and I think I do not have a clue of what do next anymore.
I tried to change the parity, stop bit and data lenght and different stuff with no avail.

at the end I suspected that the code I wrote was not correct so I used someone else code that worked (the one up there). it gives me exactly the same rubbish like any other algorithm.

from the troubleshooting I have done so far, I know for sure that the problem is from the microcontroller atmega328 (arduino). is it the programming? is it the parity, stop bit, data length?

can anyone provide me a code to set up the parity, stop bit and data lenght. I have done it but I am not certain that it was the right way.

should one point me in the right direction, it will be desperately appreciate.
13  Using Arduino / Interfacing w/ Software on the Computer / HMC6352 not accurate on: February 20, 2011, 05:40:51 pm
Hello everyone,

I have been battling with the programing of the compass HMC6352 to get accurate reading but so far all what I have done has not work...
Well I am using arduino UNO atmega328P. see below the code I used.
while I upload the code, I have readings but the problem comes when I rotate the compass 90degrees. the resulting indication on the serial monitor does not reflect the same 90degrees. I would like to calibrate and I wrote the code for calibration with which I tested the compass once more. but no change.

can anyone lead me or provide me with the calibration code... or anything that will help me move forward...

thank you

#include <Wire.h>
#include <LiquidCrystal.h>

//LiquidCrystal lcd(12, 11, 5, 4, 3, 2);       // initialize the numbers of the interface pins

int compass_address = 0x42;                  // initialization of the address of the compass
int slave_address, i, current_value, heading_value; // declaration of variables
byte heading_data[2];                        // declaration of heading_data as array

void setup()
{

slave_address = compass_address >> 1;        // this shift the bit right one position results in 0x21 as the address to pass to TWI
Serial.begin(9600);   // determine the speed of data transmission
// set up
  CLKPR = (1<<CLKPCE);
  CLKPR = 0;
Wire.begin();
// lcd.begin(16, 4);                           // set the LCD's number of columns and rows
// lcd.setCursor(0, 0);                        // set the cursor to column 0 and line 1
// lcd.print("Robot heading");                 // Print a message to the LCD
}

void loop()
{
  Wire.beginTransmission(slave_address);     // start of data transmission
  Wire.send("A");                            // get current data
  Wire.endTransmission();                    // end of data transmission
  delay(100);                               // delay of 1s before refreshing the data

  Wire.requestFrom(slave_address, 2);        // request the 2 bytes heading of 8 bits each
  i = 0;
  while(Wire.available() && i < 2)
  {
    heading_data = Wire.receive();
    i++;  
  }
  heading_value = (heading_data[0]*256 + heading_data[1]);  // add the first byte (MSB) and second byte (LSB)

  current_value = heading_value/10;
//  lcd.setCursor(0, 1);
  Serial.print(current_value);
  Serial.print(".");
  Serial.print(heading_value %10);
 // Serial.setCursor(7, 1);
  Serial.print("degrees\n");
  delay(100);                // only 70 microseconds are necessary
  }
Pages: [1]