AnsweredAssumed Answered

stm32f3 discovery Gyroscope issue (L3GD20)

Question asked by ali.med on Nov 20, 2014
Latest reply on Nov 21, 2014 by ali.med
Hi guys,
I am working on the L3GD20 embeeded in the stm32f3 discovery board.
I came with this code which gives me 0 on the 3 axes even when i move the board.
any suggestions please?
#include "stm32f3_discovery_l3gd20.h"
 
 
 
void init_Gyro()
{L3GD20_InitTypeDef Gyro_init;
L3GD20_FilterConfigTypeDef Gyro_filter;
Gyro_filter.HighPassFilter_Mode_Selection=L3GD20_HPM_NORMAL_MODE ;
Gyro_filter.HighPassFilter_CutOff_Frequency=L3GD20_HPFCF_2;//3.5 hz
Gyro_init.Power_Mode=L3GD20_MODE_ACTIVE;
Gyro_init.Output_DataRate=L3GD20_OUTPUT_DATARATE_2;     //190 hz
Gyro_init.Axes_Enable=L3GD20_AXES_ENABLE ;
Gyro_init.Band_Width=L3GD20_BANDWIDTH_4;       //25 hz
Gyro_init.BlockData_Update=1;//no update until data read
Gyro_init.Endianness=0;
Gyro_init.Full_Scale=L3GD20_FULLSCALE_500;
L3GD20_Init(&Gyro_init);
L3GD20_FilterConfig(&Gyro_filter);
 
L3GD20_FilterCmd(L3GD20_HIGHPASSFILTER_ENABLE);
}
void GyroRead(uint8_t *GyropBuffer)
{
    L3GD20_Read(GyropBuffer,L3GD20_OUT_X_L_ADDR, 6);
 
 
}
 
 
 
int main(void)
{
    uint8_t GyroBuffer[6]={0,0,0,0,0,0};
 
 
init_Gyro();
 
while(1)
    {GyroRead(GyroBuffer);
    }
return(1);
}

Outcomes