Beginner need help in gyroscope serial communication
Hi all,
I am a beginner about the Javelin stamp. Currently I work on a project that uses a gyroscope cruizcore XG1010. The gyro has a regular RS232 interface,
it provides RX, TX cable, but it does not have RTX and CTX cable. I use the Javelin Stamp Demo Board, I connect the TX to com port no.2 and RX to port no.3, and I connect the demo board com port no2, no 3 to stamp pin 3 and pin 4 respectively. I suppose to get the data like FF FF 70 00 C8 00 37 01. However I cannot get any data. I use labview to test the gyro the gyro is working.
Below is the programming, anyone got any idea that where I go wrong? maybe I need to do some data conversion before I can read the data.
Thank you very much.
import stamp.core.*;
public class gyrotest{
final static int TX = CPU.pin3;
final static int RX = CPU.pin4;
final static int RTS = CPU.pin5;
final static int CTS = CPU.pin6;
static Uart rxUart = new Uart(Uart.dirReceive,RX, Uart.dontInvert, RTS, Uart.speed9600, Uart.stop1);
static Uart txUart = new Uart(Uart.dirTransmit,TX, Uart.dontInvert, CTS, Uart.speed9600, Uart.stop1);
public static void main() {
txUart.sendString("$MIB,RESET*87");
while (true) {
System.out.print((char)rxUart.receiveByte());
}
}
}
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The truth in physics is changed with time.
I am a beginner about the Javelin stamp. Currently I work on a project that uses a gyroscope cruizcore XG1010. The gyro has a regular RS232 interface,
it provides RX, TX cable, but it does not have RTX and CTX cable. I use the Javelin Stamp Demo Board, I connect the TX to com port no.2 and RX to port no.3, and I connect the demo board com port no2, no 3 to stamp pin 3 and pin 4 respectively. I suppose to get the data like FF FF 70 00 C8 00 37 01. However I cannot get any data. I use labview to test the gyro the gyro is working.
Below is the programming, anyone got any idea that where I go wrong? maybe I need to do some data conversion before I can read the data.
Thank you very much.
import stamp.core.*;
public class gyrotest{
final static int TX = CPU.pin3;
final static int RX = CPU.pin4;
final static int RTS = CPU.pin5;
final static int CTS = CPU.pin6;
static Uart rxUart = new Uart(Uart.dirReceive,RX, Uart.dontInvert, RTS, Uart.speed9600, Uart.stop1);
static Uart txUart = new Uart(Uart.dirTransmit,TX, Uart.dontInvert, CTS, Uart.speed9600, Uart.stop1);
public static void main() {
txUart.sendString("$MIB,RESET*87");
while (true) {
System.out.print((char)rxUart.receiveByte());
}
}
}
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The truth in physics is changed with time.
Comments
static Uart rxUart = new Uart(Uart.dirReceive,RX, Uart.dontInvert,·Uart.speed9600, Uart.stop1);
static Uart txUart = new Uart(Uart.dirTransmit,TX, Uart.dontInvert,·Uart.speed9600, Uart.stop1);
That should do it.
regards peter
Actually I tried cancel the handshake pins, it still cannot get the data.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The truth in physics is changed with time.