Hello?
I want to read data from PIC24FJ512GA606 and IIS3DWB via SPI communication.
The manual says that if I write 0x12 0x01 0x10 0x05 0x0F in order, the value 0x7B should be returned.
When reading data from the sensor, it says that I should give the value of (Sensor Address | 0x08).
However, in the logic analyzer, only the value 0xFF is read without any change.
What is wrong with my project?
Thank you.
IIS3DWB read spi help!
-
- Posts: 207
- http://meble-kuchenne.info.pl
- Joined: Thu Dec 03, 2020 1:43 pm
- Has thanked: 5 times
- Been thanked: 7 times
-
- Valued Contributor
- Posts: 1014
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 193 times
- Been thanked: 217 times
Re: IIS3DWB read spi help!
Hi Seokgi
0x12 0x01 is reset
0x10 0x05 is turn on
0x0F is read who i am
Just do this one time
and after send 0x0F add a read byte
You can use SPI not in softwaremode
Mod program:
0x12 0x01 is reset
0x10 0x05 is turn on
0x0F is read who i am
Just do this one time
and after send 0x0F add a read byte
You can use SPI not in softwaremode
Mod program:
-
- Valued Contributor
- Posts: 1014
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 193 times
- Been thanked: 217 times
Re: IIS3DWB read spi help!
Hi Seokgi
then I would switch back to software mode.
I only read the sensor once, maybe you can add a read for the senor to the interrupt
then I would switch back to software mode.
I only read the sensor once, maybe you can add a read for the senor to the interrupt
-
- Valued Contributor
- Posts: 1014
- Joined: Wed Dec 02, 2020 10:53 am
- Has thanked: 193 times
- Been thanked: 217 times
Re: IIS3DWB read spi help!
Hi Seokgi
Can you measure a clock signal on the B5 with this program?
Can you also measure a few signals on the Mosi signal?
If so, try to change the clockphase, clockpolar, samplepoint.
Also switch off the USE Auto CS
Can you measure a clock signal on the B5 with this program?
Can you also measure a few signals on the Mosi signal?
If so, try to change the clockphase, clockpolar, samplepoint.
Also switch off the USE Auto CS
Re: IIS3DWB read spi help!
I changed the MCU and sensor to complete this project.
MCU: PIC16F18326
Sensor: LIS3DHTR
But it doesn't run.
When I compile the MCU, the following error occurs.
"C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\PIC\PIC_CAL_String.c
: error: (1250) could not find space (256 bytes) for variable _tempSub"
And when I downgrade PIC\PIC_CAL_String.c from version 6 to version 5, it compiles.
And LIS3DTR uses the library (I2C) supported by FC10, but it doesn't work.
Can you show me an example?
I followed the manual for the sensor for SPI, but the SCLK, MOSI, and CS signals work fine, but the MISO data doesn't come out.
Please help me.
Thank you.
MCU: PIC16F18326
Sensor: LIS3DHTR
But it doesn't run.
When I compile the MCU, the following error occurs.
"C:\ProgramData\MatrixTSL\FlowcodeV10\CAL\PIC\PIC_CAL_String.c
And when I downgrade PIC\PIC_CAL_String.c from version 6 to version 5, it compiles.
And LIS3DTR uses the library (I2C) supported by FC10, but it doesn't work.
Can you show me an example?
I followed the manual for the sensor for SPI, but the SCLK, MOSI, and CS signals work fine, but the MISO data doesn't come out.
Please help me.
Thank you.