BMP183 sensor with Due

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
gchrist
 
Posts: 88
Joined: Wed Jul 16, 2014 3:40 am

BMP183 sensor with Due

Post by gchrist »

Dear Adafruit Team,
I have purchased a BMP183 sensor and I am experiencing problems in making it work properly with an Arduino Due.
I have followed the instructions of the following site for the Arduino Due Hardware SPI ... http://21stdigitalhome.blogspot.gr/2013 ... e-spi.html and I have also checked the Due schematic for the SPI pins.
I have also implemented the following changes in the code of the Adafruit_BMP183.cpp file to adopt it to Due ARM processor
1)
#ifdef __avr__
#include <avr/pgmspace.h>
#include <util/delay.h>
#endif
#ifdef __arm__
#define _delay_ms(ms) delayMicroseconds((ms) * 1000)
#endif
#include <stdlib.h>

2)
#ifdef __avr__
SPI.setClockDivider(SPI_CLOCK_DIV16);
#endif
#ifdef __arm__
SPI.setClockDivider(10, 84);
#endif

The pins I have declared are the following:
// You can also use software SPI and define your own pins!
#define BMP183_CLK 110
#define BMP183_SDO 108 // AKA MISO
#define BMP183_SDI 109 // AKA MOSI

// You'll also need a chip-select pin, use any pin!
#define BMP183_CS 10

Unfortunately the only print out I get from the Serial is the following:
"BMP183 Pressure Sensor Test"

There is no problem with the sensor because I tested it with an Arduino Uno and it works perfectly.
Any help will be really appreciated!
Best regards
George

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: BMP183 sensor with Due

Post by adafruit_support_rick »

Which version of the Adafruit_BMP183 constructor are you using? You should be using the hardware SPI version:
Adafruit_BMP183 sensor = Adafruit_BMP183(BMP183_CS);

User avatar
gchrist
 
Posts: 88
Joined: Wed Jul 16, 2014 3:40 am

Re: BMP183 sensor with Due

Post by gchrist »

Hello Rick,
Thank you very much for your quick reply.
I am not currently using the hardware SPI version of the constructor so I will give a try tomorrow with this constructor and I will let you know about the outcome.
Best regards
George

User avatar
gchrist
 
Posts: 88
Joined: Wed Jul 16, 2014 3:40 am

Re: BMP183 sensor with Due

Post by gchrist »

Hello Rick,
I just tried with this constructor ... Adafruit_BMP183 bmp = Adafruit_BMP183(BMP183_CS);
but what I get is the following:
"BMP183 Pressure Sensor Test"
"Ooops, no BMP183 detected ... Check your wiring!"

I tried with both SPI (http://21stdigitalhome.blogspot.gr/2013 ... e-spi.html) and ICSP (http://arduino.cc/en/Reference/SPI) pins of Due.
Any help will be really appreciated!
Best regards
George

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: BMP183 sensor with Due

Post by adafruit_support_rick »

I'm going to have to get one of these sensors and try to port the library. It will take me a few days...

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: BMP183 sensor with Due

Post by adafruit_support_rick »

Download the library and try it now. Should work for both hardware and software SPI modes.
https://github.com/adafruit/Adafruit_BMP183_Library

User avatar
gchrist
 
Posts: 88
Joined: Wed Jul 16, 2014 3:40 am

Re: BMP183 sensor with Due

Post by gchrist »

Hello Rick,
Thanks for your help!
Unfortunately it is still not working. Which pins are you using, the SPI or the ICSP?
I am using the SPI and the hardware version constructor.
I am getting the following message:
"BMP183 Pressure Sensor Test"
"Ooops, no BMP183 detected ... Check your wiring!"

Best regards
George

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: BMP183 sensor with Due

Post by adafruit_support_rick »

For hardware SPI, you have to use the ICSP pins. You can use pins 11, 12, and 13 with Software SPI

User avatar
gchrist
 
Posts: 88
Joined: Wed Jul 16, 2014 3:40 am

Re: BMP183 sensor with Due

Post by gchrist »

Hello Rick,
Thanks for your support.
The Software SPI works perfectly! Well done!
On the other hand there is still problem with the hardware one.
I am using this information about SPI pins .... http://arduino.cc/en/Reference/SPI
and I checked connections with a multimeter too.
Best regards
George

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: BMP183 sensor with Due

Post by adafruit_support_rick »

That link isn't working for me for some reason. But here is the ICSP pinout I'm using. Note that there's a small white dot indicating Pin 1 on the Due:
ICSP pinout.png
ICSP pinout.png (9.88 KiB) Viewed 481 times
So, you should be using pins 1, 3, and 4

User avatar
gchrist
 
Posts: 88
Joined: Wed Jul 16, 2014 3:40 am

Re: BMP183 sensor with Due

Post by gchrist »

Hello Rick,
Sorry for my delayed reply.
I just made it working with the hardware version by using the SPI pins and not the ICSP. ICSP is just not working.
Thanks again for your excellent and quick support.
Best regards
George

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: BMP183 sensor with Due

Post by adafruit_support_rick »

Very strange. It works with my Due on ICSP. Perhaps there is something wrong with your Due?

User avatar
gchrist
 
Posts: 88
Joined: Wed Jul 16, 2014 3:40 am

Re: BMP183 sensor with Due

Post by gchrist »

Hello Rick,
I do not know if there is something wrong with my Due.
Could you please have a look also at the following website ... http://21stdigitalhome.blogspot.gr/2013 ... e-spi.html ?
It is noted the following ...
"Pins: Hardware SPI MISO, MOSI, and SCK pins are only on the SPI header (not to be confused with the ICSP header which is different on the Due)"
Thanks again for your excellent support.
George

User avatar
adafruit_support_rick
 
Posts: 35092
Joined: Tue Mar 15, 2011 11:42 am

Re: BMP183 sensor with Due

Post by adafruit_support_rick »

By golly, you're right! I never noticed that other 2x3 header. I've been using the one labeled "SPI"

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”