chipKIT® Development Platform

Inspired by Arduino™

SPI library doesn't appear to be working

Created Mon, 14 Apr 2014 14:41:40 +0000 by wandrson1967


wandrson1967

Mon, 14 Apr 2014 14:41:40 +0000

When attempting to compile the AS3935 example, which the author says was developed for the Chipkit UNO32 I am attempting to execute it on, I get the following errors

In file included from C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:16:0,
                 from LightningDetector.cpp:20:
C:\mpide-0023-windows-20130715\hardware\pic32\compiler\pic32-tools\bin\../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/avr/pgmspace.h:4:2: error: #error ******** This sketch or library uses AVR-specific code that may not work with the chipKIT platform. See this forum for more information on porting code to chipKIT [www.chipkit.org/forum/viewforum.php?f=7] ********
In file included from LightningDetector.cpp:20:0:
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h: In static member function 'static byte SPIClass::transfer(byte)':
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:56:3: error: 'SPDR' was not declared in this scope
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:57:12: error: 'SPSR' was not declared in this scope
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:57:19: error: 'SPIF' was not declared in this scope
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h: In static member function 'static void SPIClass::attachInterrupt()':
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:63:3: error: 'SPCR' was not declared in this scope
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:63:11: error: 'SPIE' was not declared in this scope
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h: In static member function 'static void SPIClass::detachInterrupt()':
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:67:3: error: 'SPCR' was not declared in this scope
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:67:12: error: 'SPIE' was not declared in this scope

I also tried compiling the built in SPI library example, BarometricPressureSensor, and got similar errors. This leads me to believe the problem is with the SPI library.

In file included from C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:16:0,
                 from BarometricPressureSensor.cpp:26:
C:\mpide-0023-windows-20130715\hardware\pic32\compiler\pic32-tools\bin\../lib/gcc/pic32mx/4.5.1/../../../../pic32mx/include/avr/pgmspace.h:4:2: error: #error ******** This sketch or library uses AVR-specific code that may not work with the chipKIT platform. See this forum for more information on porting code to chipKIT [www.chipkit.org/forum/viewforum.php?f=7] ********
In file included from BarometricPressureSensor.cpp:26:0:
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h: In static member function 'static byte SPIClass::transfer(byte)':
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:56:3: error: 'SPDR' was not declared in this scope
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:57:12: error: 'SPSR' was not declared in this scope
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:57:19: error: 'SPIF' was not declared in this scope
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h: In static member function 'static void SPIClass::attachInterrupt()':
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:63:3: error: 'SPCR' was not declared in this scope
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:63:11: error: 'SPIE' was not declared in this scope
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h: In static member function 'static void SPIClass::detachInterrupt()':
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:67:3: error: 'SPCR' was not declared in this scope
C:\Documents and Settings\Walter Anderson\My Documents\mpide\libraries\SPI/SPI.h:67:12: error: 'SPIE' was not declared in this scope

Jermcb

Tue, 15 Apr 2014 00:13:40 +0000

Have you made sure you have the correct board selected in MPIde?

Click the menu:

Tools>Board>chipKIT>chipKIT UNO32....


wandrson1967

Tue, 15 Apr 2014 22:09:00 +0000

Yes, I have the correct board selected, and I can successfuilly run a basic example like Serial Ascii table.