NUCLEO-G474RE BMP183 Output Problem

Post here first, or if you can't find a relevant section!
User avatar
fpiSTM
Posts: 1746
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: NUCLEO-G474RE BMP183 Output Problem

Post by fpiSTM »

Ok you use the STM32 core anyway your sketch is not correct. Try the code I've put above.
User avatar
MasterT
Posts: 33
Joined: Mon Apr 20, 2020 12:02 am

Re: NUCLEO-G474RE BMP183 Output Problem

Post 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
enesert
Posts: 11
Joined: Sat May 22, 2021 11:41 am

Re: NUCLEO-G474RE BMP183 Output Problem

Post 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?
enesert
Posts: 11
Joined: Sat May 22, 2021 11:41 am

Re: NUCLEO-G474RE BMP183 Output Problem

Post 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.
User avatar
fpiSTM
Posts: 1746
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: NUCLEO-G474RE BMP183 Output Problem

Post 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.
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: NUCLEO-G474RE BMP183 Output Problem

Post 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 ??
enesert
Posts: 11
Joined: Sat May 22, 2021 11:41 am

Re: NUCLEO-G474RE BMP183 Output Problem

Post 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.
enesert
Posts: 11
Joined: Sat May 22, 2021 11:41 am

Re: NUCLEO-G474RE BMP183 Output Problem

Post 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
enesert
Posts: 11
Joined: Sat May 22, 2021 11:41 am

Re: NUCLEO-G474RE BMP183 Output Problem

Post 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);
  
User avatar
MasterT
Posts: 33
Joined: Mon Apr 20, 2020 12:02 am

Re: NUCLEO-G474RE BMP183 Output Problem

Post by MasterT »

Try:

Code: Select all

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

Return to “General discussion”