Page 2 of 3

Re: NUCLEO-G474RE BMP183 Output Problem

Posted: Sat May 22, 2021 6:07 pm
by fpiSTM
Ok you use the STM32 core anyway your sketch is not correct. Try the code I've put above.

Re: NUCLEO-G474RE BMP183 Output Problem

Posted: Sat May 22, 2021 6:30 pm
by MasterT
It's always good idea to test SPI separately, w/o sensor connected. Try build-in the IDE loop back test:
_ File/Examples/SRM32duino_Examples/NoNReg/SPI_Loop

Re: NUCLEO-G474RE BMP183 Output Problem

Posted: Sat May 22, 2021 7:18 pm
by enesert
fpiSTM wrote: Sat May 22, 2021 6:07 pm Ok you use the STM32 core anyway your sketch is not correct. Try the code I've put above.
I tried your sketch. It gave same output. Is there any possibility of a problem in library?

Re: NUCLEO-G474RE BMP183 Output Problem

Posted: Sat May 22, 2021 7:19 pm
by enesert
MasterT wrote: Sat May 22, 2021 6:30 pm It's always good idea to test SPI separately, w/o sensor connected. Try build-in the IDE loop back test:
_ File/Examples/SRM32duino_Examples/NoNReg/SPI_Loop
It can pass the test. There is no problem.

Re: NUCLEO-G474RE BMP183 Output Problem

Posted: Sun May 23, 2021 3:34 pm
by fpiSTM
enesert wrote: Sat May 22, 2021 7:18 pm
fpiSTM wrote: Sat May 22, 2021 6:07 pm Ok you use the STM32 core anyway your sketch is not correct. Try the code I've put above.
I tried your sketch. It gave same output. Is there any possibility of a problem in library?
And you properly wire the sensor on pin D9, D11,D12 and D13 ?
If the SPI loop works so probably an issue with the Library. Maybe SPI clock speed. Seems the max frequency for this sensor is 8MHz as stated here:
https://github.com/adafruit/Adafruit_BM ... pp#L78-L83

but by default max SPI clock speed is set to 4 MHz so this should be correct.

Re: NUCLEO-G474RE BMP183 Output Problem

Posted: Sun May 23, 2021 3:47 pm
by GonzoG
enesert wrote: Sat May 22, 2021 7:19 pm
MasterT wrote: Sat May 22, 2021 6:30 pm It's always good idea to test SPI separately, w/o sensor connected. Try build-in the IDE loop back test:
_ File/Examples/SRM32duino_Examples/NoNReg/SPI_Loop
It can pass the test. There is no problem.
Did it pass test when connected to D14/D15 ??

Re: NUCLEO-G474RE BMP183 Output Problem

Posted: Mon May 24, 2021 6:59 pm
by enesert
fpiSTM wrote: Sun May 23, 2021 3:34 pm
enesert wrote: Sat May 22, 2021 7:18 pm
fpiSTM wrote: Sat May 22, 2021 6:07 pm Ok you use the STM32 core anyway your sketch is not correct. Try the code I've put above.
I tried your sketch. It gave same output. Is there any possibility of a problem in library?
And you properly wire the sensor on pin D9, D11,D12 and D13 ?
If the SPI loop works so probably an issue with the Library. Maybe SPI clock speed. Seems the max frequency for this sensor is 8MHz as stated here:
https://github.com/adafruit/Adafruit_BM ... pp#L78-L83

but by default max SPI clock speed is set to 4 MHz so this should be correct.

Yes i wired it like that. Aha yes i think its about frequency. I will check it and write here results.

Re: NUCLEO-G474RE BMP183 Output Problem

Posted: Mon May 24, 2021 7:00 pm
by enesert
GonzoG wrote: Sun May 23, 2021 3:47 pm
enesert wrote: Sat May 22, 2021 7:19 pm
MasterT wrote: Sat May 22, 2021 6:30 pm It's always good idea to test SPI separately, w/o sensor connected. Try build-in the IDE loop back test:
_ File/Examples/SRM32duino_Examples/NoNReg/SPI_Loop
It can pass the test. There is no problem.
Did it pass test when connected to D14/D15 ??
Nope it passed D12 D11

Re: NUCLEO-G474RE BMP183 Output Problem

Posted: Mon May 24, 2021 8:15 pm
by enesert
enesert wrote: Mon May 24, 2021 6:59 pm
fpiSTM wrote: Sun May 23, 2021 3:34 pm
enesert wrote: Sat May 22, 2021 7:18 pm

I tried your sketch. It gave same output. Is there any possibility of a problem in library?
And you properly wire the sensor on pin D9, D11,D12 and D13 ?
If the SPI loop works so probably an issue with the Library. Maybe SPI clock speed. Seems the max frequency for this sensor is 8MHz as stated here:
https://github.com/adafruit/Adafruit_BM ... pp#L78-L83

but by default max SPI clock speed is set to 4 MHz so this should be correct.

Yes i wired it like that. Aha yes i think its about frequency. I will check it and write here results.
Why i cant change spi freq. How can i set to 8 mhz spi pins? I added this code to void setup:

Code: Select all

  SPI.begin();
  SPI.setClockDivider(6);
  

Re: NUCLEO-G474RE BMP183 Output Problem

Posted: Mon May 24, 2021 9:37 pm
by MasterT
Try:

Code: Select all

  // SPI.begin(CS_PIN);
  SPI.beginTransaction(CS_PIN, SPISettings(8000000, MSBFIRST, SPI_MODE0));