Questions and discussions about the software that runs on the TD RF module itself.
thomas110594
 
Posts: 6
Joined: Thu Jun 09, 2016 7:09 am

GPS and accelero in the same time

by thomas110594 Fri Jul 08, 2016 9:10 am

Hi !

Can we use the GPS and the accelerometer in the same time? Because, I'm always forced to stop the accelerometer when I want the localisation and when I start the accelerometer, the GPS stops.

Do you have any explanation about this?

Thank you.
User avatar
lcheminade
 
Posts: 146
Joined: Mon May 11, 2015 7:47 am

Re: GPS and accelero in the same time

by lcheminade Fri Jul 08, 2016 9:27 am

Hi,

This should work fine if you call the geloc_init and accelero_init only once at startup. They both share the same SPI bus so it is sometimes tricky to get them to live together. Are you on TD1204 or TD1205? Could you share some piece of code please?

Regards.
thomas110594
 
Posts: 6
Joined: Thu Jun 09, 2016 7:09 am

Re: GPS and accelero in the same time

by thomas110594 Fri Jul 08, 2016 10:09 am

Yes I call the geloc_init and accelero_init only once at the TD_USER_Setup function.

void TD_USER_Setup(void)
{
TD_UART_Options_t options = {LEUART_DEVICE, LEUART_LOCATION, 9600, 8, 'N',
1, false};

// Open an I/O stream using LEUART0
TD_UART_Open(&options, TD_STREAM_RDWR);

// Set flash variables version
TD_FLASH_DeleteVariables();

// Set the device as a Sensor transmitter
TD_SENSOR_Init(SENSOR_TRANSMITTER, 0, 0);

// Geoloc and accelerometer initialization
TD_GEOLOC_Init();
TD_ACCELERO_Init();

// Start GPS forever
TD_GEOLOC_TryToFix(TD_GEOLOC_NAVIGATION, TD_GEOLOC_INFINITE, GPSFix);

// Monitor accelerometer data-
TD_ACCELERO_MonitorData(true,
true,
TD_ACCELERO_50HZ,
TD_ACCELERO_ALL_AXIS,
TD_ACCELERO_8G,
0,
TD_ACCELERO_STREAMFIFO,
31,
DataCallback);
}

Like this it doesn't work... In the respective callback function, I just print some value.
Return to Firmware

Who is online

Users browsing this forum: No registered users and 27 guests