Gaining write access to DPS310 registers via SPI

Announcements

Measure CO2 When It Matters - Infineon’s XENSIV™ PAS CO2 now comes in SparkFun Red. Check it now!

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
RichardCoSi
Level 1
Level 1
First question asked Welcome!

Dear Community,

First, sorry for the wrong forum assignment, but I didn't find the suiting forum.

We are accessing a DSP310 pressure sensor via SPI interface. The sensor's registers can be read, so I obtain expected values reading registers:

0x0D => 0x10 (Product ID)

0x08 => 0xC0 (default MEAS_CFG)

But I cannot write any register, which would be necessary to start a measurement. For a very simple approach, I tried to enable FiFo, (setting register 0x09 to 0x02). But when I read back the register, the value is 0x00 (default). I took care for the cleared high bit during write access. We are using 4-wire SPI.

The SPI-interface was only used by DPS310 in our first HW Setup. We needed another SPI device (MEMS), so we connected it to the same CLK, MOSI and MISO PINS (CS of course on another PIN than DPS310_CS).

For the MEMS, it is possible to read and write registers without any modification of the interface program.

So, the occurring question is, is there a special mechanism to "unlock" DPS310 registers for SPI-write? Is there anything else that could be tested on why the write access fails?

Best regards,

Richard

0 Likes
1 Solution
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hi @RichardCoSi 

Can you let me know if there is any update on this query?

The register -  Interrupt and FIFO configuration (CFG_REG, address: 0x09) that you trying to write is by default readable and writable. So you should be able to write to it directly without the need to unlock it.

You should be able to write to it by following the steps suggested in section 6 of the DPS310 datasheet as mentioned in my previous reply. In case you are still facing the issue, there are a few other things you can check:

1. Ensure that the SPI mode '11' is correctly selected at the at SPI Master end also.

2. In order to perform a SPI write the CSB line should be set low and a control byte followed by register data. should be sent. The following is the format for sending the data:

Ekta_0-1641979728728.png

 where R/W bit =  0 in case of a write operation.

3. Another thing that you can check is the data on the SDO line. In case you are using a 3 wire SPI interface the data you are sending through the SDI line should be reflected on SDO line as can be seen in the image above.

Are you able to see any data on the same?

Best Regards
Ekta



View solution in original post

0 Likes
2 Replies
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hi Richard,

I went through the DPS310 datasheet, but I could not find any specific information regarding unlocking DPS310 registers for SPI-write. I will try to search internally if I could find information on this.

Till then could you please let me know how you are writing to the registers?

Also could you please confirm if you are following the guidelines mentioned in section 6 of the DPS310 datasheet regarding configuring the SPI interface?

Best Regards
Ekta

0 Likes
Ekta_N
Moderator
Moderator
Moderator
750 replies posted First like given 250 solutions authored

Hi @RichardCoSi 

Can you let me know if there is any update on this query?

The register -  Interrupt and FIFO configuration (CFG_REG, address: 0x09) that you trying to write is by default readable and writable. So you should be able to write to it directly without the need to unlock it.

You should be able to write to it by following the steps suggested in section 6 of the DPS310 datasheet as mentioned in my previous reply. In case you are still facing the issue, there are a few other things you can check:

1. Ensure that the SPI mode '11' is correctly selected at the at SPI Master end also.

2. In order to perform a SPI write the CSB line should be set low and a control byte followed by register data. should be sent. The following is the format for sending the data:

Ekta_0-1641979728728.png

 where R/W bit =  0 in case of a write operation.

3. Another thing that you can check is the data on the SDO line. In case you are using a 3 wire SPI interface the data you are sending through the SDI line should be reflected on SDO line as can be seen in the image above.

Are you able to see any data on the same?

Best Regards
Ekta



0 Likes