SD746 3D Gyro+ 3D ACC working with APM

Hi Guys,

 

I have been busy with testing the SD746, or lets say get it to output some data so the AMP can work with it.

The SD746 combines a 3D accelerometer with a 3D gyroscope and signal conditioning circuitry in a tiny QFN package. It provides calibrated and temperature compensated rotation-rate and acceleration output signals via SPI or I²C.

 

I modified the AP_ADC_ADS7844.cpp code in such a way that it uses the SPI bus were also the dataflash is connected to. I like to free the UART, which is normally connected to the ADS7844, to use it for other purposes.

The first problem I found is that the sensor uses SPI mode 0 but the dataflash  uses SPI mode 3.

To solve this I switch the SPI mode in the ADC interrupt routine to SPImode0 and back to mode3 when leaving the interrupt routine.

An other problem, or could be a problem are the synchronous and asynchronous processes. Until now I "disabled" the dataflash but as you can see in my code I have made a provision to manage this problem.

I modified the AP_IMU_Oilpan.cpp code to have the correct sensor assignment, but I could do this also in the ADC code, what should be preferred here?.

 

When I'm back from my business-trip I will at the modified code files for your interest and hopefully you can give me some feedback about this try. Maybe my way of thinking is wrong about putting the gyro+acc to the same SPI bus as the dataflash but If I have the right input from you guys I can do some performance test (lets say how long does the interrupt routine take at max?).

 

To be continued....

 

 

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Activity