ms6511 over spi

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
kamil
Posts: 15
Joined: Mon Oct 13, 2014 10:32 pm

ms6511 over spi

Post by kamil »

I found some misunderstanding about SPI using.

I need to read some 16bit registers from MS5611:
Image

If I try to read using non-blocking function:

Code: Select all

txbuf[0] = MS5611_CMD_PROM_READ_C1;
txbuf[1] = 0x00;
rxbuf[0] = 0x00;
rxbuf[1] = 0x00;

spiStartExchange(&MS5611_SPI, 2, txbuf, rxbuf);
chThdSleepMilliseconds(10);


values reads great, but if I use blocking function:

Code: Select all

spiExchange(&MS5611_SPI, 2, txbuf, rxbuf);


spiExchange function blocks and doesn't return.

What I can miss? Or maybe I dons't understand something?
User avatar
Giovanni
Site Admin
Posts: 14892
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 996 times

Re: ms6511 over spi

Post by Giovanni »

From the code you posted I see nothing wrong. The SPI driver is very stable so the cause should be elsewhere, like a DMA conflict or something else.

Giovanni
Post Reply