Hi there,
Just running the example lsm9doftest for the LSM9DS0 breakout... however it's not recognizing the the software SPI initialization of the of the Adafruit_LSM9DS0 object. I keep receiving the following error:
'SPCR' was not declared in this scope... indicating that it's trying to initiate a hardware SPI of my lsm9ds0 sensor.
Is there something I am missing?
LSM9DS0
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- adafruit_support_bill
- Posts: 88152
- Joined: Sat Feb 07, 2009 10:11 am
Re: LSM9DS0
Post the complete error output.
- mld1988
- Posts: 17
- Joined: Fri Mar 07, 2014 7:37 pm
Re: LSM9DS0
Arduino: 1.5.7 (Mac OS X), Board: "Arduino Due (Programming Port)"
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp: In member function 'bool Adafruit_LSM9DS0::begin()':
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp:77:16: error: 'SPCR' was not declared in this scope
SPCRback = SPCR;
^
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp:79:25: error: 'SPI_CLOCK_DIV8' was not declared in this scope
SPI.setClockDivider(SPI_CLOCK_DIV8);
^
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp: In member function 'void Adafruit_LSM9DS0::write8(boolean, byte, byte)':
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp:363:18: error: 'SPCR' was not declared in this scope
SPCRback = SPCR;
^
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp:372:7: error: 'SPCR' was not declared in this scope
SPCR = SPCRback;
^
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp: In member function 'byte Adafruit_LSM9DS0::readBuffer(boolean, byte, byte, uint8_t*)':
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp:413:18: error: 'SPCR' was not declared in this scope
SPCRback = SPCR;
^
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp:424:7: error: 'SPCR' was not declared in this scope
SPCR = SPCRback;
^
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp: In member function 'bool Adafruit_LSM9DS0::begin()':
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp:77:16: error: 'SPCR' was not declared in this scope
SPCRback = SPCR;
^
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp:79:25: error: 'SPI_CLOCK_DIV8' was not declared in this scope
SPI.setClockDivider(SPI_CLOCK_DIV8);
^
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp: In member function 'void Adafruit_LSM9DS0::write8(boolean, byte, byte)':
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp:363:18: error: 'SPCR' was not declared in this scope
SPCRback = SPCR;
^
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp:372:7: error: 'SPCR' was not declared in this scope
SPCR = SPCRback;
^
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp: In member function 'byte Adafruit_LSM9DS0::readBuffer(boolean, byte, byte, uint8_t*)':
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp:413:18: error: 'SPCR' was not declared in this scope
SPCRback = SPCR;
^
/Users/mobe/Documents/Arduino/libraries/Adafruit_LSM9DS0/Adafruit_LSM9DS0.cpp:424:7: error: 'SPCR' was not declared in this scope
SPCR = SPCRback;
^
This report would have more information with
"Show verbose output during compilation"
enabled in File > Preferences.
- mld1988
- Posts: 17
- Joined: Fri Mar 07, 2014 7:37 pm
Re: LSM9DS0
In fact I am getting the same error, whether I use the hard SPI lines, or the I2C connections.
- adafruit_support_bill
- Posts: 88152
- Joined: Sat Feb 07, 2009 10:11 am
Re: LSM9DS0
There are a lot of library changes in 1.5.x beta. I'm not sure if the LSM9DS0 library has been ported to the Due yet. I'll check with our Due expert.
- adafruit_support_rick
- Posts: 35092
- Joined: Tue Mar 15, 2011 11:42 am
Re: LSM9DS0
The LSM9DS0 needs to be ported to the Due. It will not compile as is, since it references several AVR hardware registers directly
- mld1988
- Posts: 17
- Joined: Fri Mar 07, 2014 7:37 pm
Re: LSM9DS0
Okie.... so what does this mean? What am I supposed to do with this information?
- mld1988
- Posts: 17
- Joined: Fri Mar 07, 2014 7:37 pm
Re: LSM9DS0
Does this also apply to the Adafruit_Sensor library that accompanies the Adafruit_LSM9DS0 library?
- mld1988
- Posts: 17
- Joined: Fri Mar 07, 2014 7:37 pm
Re: LSM9DS0
You know what, it's okie. I will just remove the instances involving the hardware SPI, as I will be using the software SPI anyways, as I am linking up 4 of these, amongst other things.
Thank you for your help.
Thank you for your help.
- adafruit_support_bill
- Posts: 88152
- Joined: Sat Feb 07, 2009 10:11 am
Re: LSM9DS0
Since 1.5.7 is still in development, porting libraries to work with it is an ongoing process. It will probably be some time before there is a stable release. Until then, we can't guarantee that everything will work with it.
- mld1988
- Posts: 17
- Joined: Fri Mar 07, 2014 7:37 pm
Re: LSM9DS0
Understandable.
I am encountering a different problem though...
After removing the Hardware SPI references in the, the code compiles and works wonderfully in I2C mode for all four breakouts of this IC I purchased. But none of them will not initialize in Software SPI mode - which is what I need it for. Combined with my being able to initialize other Software SPI devices (like the assembled data logger) on the Due, I'm wondering if there is a bug in the Adafruit_LSM9DS0 library code?
I'm combing through the code with no luck thus far, but I am sure it's not my wiring.
I am encountering a different problem though...
After removing the Hardware SPI references in the, the code compiles and works wonderfully in I2C mode for all four breakouts of this IC I purchased. But none of them will not initialize in Software SPI mode - which is what I need it for. Combined with my being able to initialize other Software SPI devices (like the assembled data logger) on the Due, I'm wondering if there is a bug in the Adafruit_LSM9DS0 library code?
I'm combing through the code with no luck thus far, but I am sure it's not my wiring.
- adafruit2
- Posts: 22200
- Joined: Fri Mar 11, 2005 7:36 pm
Re: LSM9DS0
We test the board in software SPI mode so its unlikely there's a bug...maybe something changed when you adapted the code? ideally you could test the software SPI on an Uno, while we work on porting it to the Due. At least then you'd know if it works :)
- mld1988
- Posts: 17
- Joined: Fri Mar 07, 2014 7:37 pm
Re: LSM9DS0
Hi there,
So I tested the code on an Arduino Due that I had. I re-downloaded the un-altered LSM9DS0 and Sensor libraries, and tried them on both the 1.0 (on PC) and 1.5 versions of the Arduino IDE (Mac). Attached are pictures of the connections I made. This also worked great for I2C, but failed for Hardware and Software SPI on all for Adafruit_LSM9DS0 devices I have.
Vin (red) - 3.3 V
Gnd (black) - Gnd
Clk (yellow) - pin 13
Miso (Green) - pin 12
Mosi (Blue) - pin 11
csXM (purple) - pin 9
csG (white) - pin 10
See anything amiss in my connections?
So I tested the code on an Arduino Due that I had. I re-downloaded the un-altered LSM9DS0 and Sensor libraries, and tried them on both the 1.0 (on PC) and 1.5 versions of the Arduino IDE (Mac). Attached are pictures of the connections I made. This also worked great for I2C, but failed for Hardware and Software SPI on all for Adafruit_LSM9DS0 devices I have.
Vin (red) - 3.3 V
Gnd (black) - Gnd
Clk (yellow) - pin 13
Miso (Green) - pin 12
Mosi (Blue) - pin 11
csXM (purple) - pin 9
csG (white) - pin 10
See anything amiss in my connections?
- Attachments
-
- Screen Shot 2014-10-01 at 10.23.42 AM.png (308.66 KiB) Viewed 1276 times
-
- Screen Shot 2014-10-01 at 10.23.51 AM.png (243.53 KiB) Viewed 1276 times
-
- Screen Shot 2014-10-01 at 10.24.03 AM.png (221.88 KiB) Viewed 1276 times
- adafruit_support_bill
- Posts: 88152
- Joined: Sat Feb 07, 2009 10:11 am
Re: LSM9DS0
I don't see any solder on those header pins. Please post a close-up photo showing your soldering to the board.
- mld1988
- Posts: 17
- Joined: Fri Mar 07, 2014 7:37 pm
Re: LSM9DS0
First 3
- Attachments
-
- Screen Shot 2014-10-01 at 11.54.13 AM.png (191.92 KiB) Viewed 1264 times
-
- Screen Shot 2014-10-01 at 11.54.07 AM.png (160 KiB) Viewed 1264 times
-
- Screen Shot 2014-10-01 at 11.53.57 AM.png (211.99 KiB) Viewed 1264 times
Please be positive and constructive with your questions and comments.