Page 1 of 1

ms6511 over spi

Posted: Mon Nov 10, 2014 11:21 pm
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?

Re: ms6511 over spi

Posted: Tue Nov 11, 2014 8:59 am
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