MPU6000 read register function problem with Energy Micro µC

By leise , 17 July 2013

Hello!

I am trying to read the Sensor data from the MPU6000 Evaluation Board. I connected to an Energy Micro Evaluation Board (EFM32G890F128 STK) and with the help of SPI i try to read first the REVID Register.

The Problem is that after configuring the SPI at 500 KHz I llok with the osciloscope and I can see the CLK, CS and TX line but from the sensor on the Rx line I get no answear.

The Pins I connected as following:

Pin 24 from MPU6000 EVAL BOARD is connected to the Rx of the µC from Energy MIcro (pin configured as Input)

Pin 22 from MPU6000 is connected to the Tx of the µC

Pin 20 of MPU6000 is connected to the CLK Signal of µC

Pin 8 of the MPU6000 Eval Baord is connected to the CS of the µC (which is active on 0 logic)

Pin 23 of the MPU6000 Eval board is connected to the 3,3V power supply of the µC

Pin 17 of MPU6000 is connected to GND.

The Jumper is configured to VDDSEL3V0 and to VLOGIC3V0. Should I Change it to VCC? I measured the current at the Output of the voltage Regulator on the eval board and there is 3,3V.

The REVID Register value is 0. On the osciloscope Comes out 0, but the Tx line and also CLK and CS are ok. What I send I can see there.
This is my read function.
The USART_Tx and USART_Rx are functions that send or receive from the µC library and I used them in other Projects and work properly with SPI and the same Settings.

void MPU6000_ReadRegister(int8_t reg, void *data)

{
int8_t first ;
int8_t *rxBuffer = (int8_t *) data;

/* Address to be shifted left by 2*/
/*RW bit to be set*/
reg |= 0x80; //read bit is set to 1 and is the MSB

/*first we send the register address*/
first= reg;

/* Enable chip select , CS = 0 */
GPIO_PinOutClear(SPI_CS_PORT, SPI_CS_PIN);

/* Disable interrupts. */
__disable_irq();

/*send first packet*/
USART_Tx(SPI_USED, first);

/* Ignore first packet */
USART_Rx(SPI_USED);

/* Read data back by sending a dummy byte and save the received bytes*/
USART_Tx(SPI_USED, 0x00);
*rxBuffer++ = USART_Rx(SPI_USED);


/* Enable interrupts. */
__enable_irq();

/* Disable chip select, CS=1*/
GPIO_PinOutSet(SPI_CS_PORT, SPI_CS_PIN);


}

Can you give me any ideeas what am i doing wrong?

Thank you very much.

phpbb Topic ID
15450