chipKIT® Development Platform

Inspired by Arduino™

Problem with DSPI Library on certain Boards

Created Tue, 25 Jun 2013 09:45:07 +0000 by caroper


caroper

Tue, 25 Jun 2013 09:45:07 +0000

In testing my Boards Definition files I get the following error when compiling the Sketch: PmodJstkDspi

DSPI.cpp: In constructor 'DSPI0::DSPI0()': DSPI.cpp:839:21: error: '_SPI2_BASE_ADDRESS0' was not declared in this scope DSPI.cpp:839:21: error: expected ';' before 'anss'

I get the same error if I select ChipKIT DP32 as the Board.

On the Fubarino Mini I get:(after fixing the PIN_LED1 error)

DSPI.cpp:917:1: error: 'DSPI1' does not name a type DSPI.cpp:946:1: error: 'DSPI1' has not been declared DSPI.cpp: In function 'void enableInterruptTransfer()': DSPI.cpp:948:11: error: invalid use of 'this' in non-member function DSPI.cpp:949:32: error: cannot call member function 'void DSPI::enableInterruptTransfer()' without object DSPI.cpp: At global scope: DSPI.cpp:969:1: error: 'DSPI1' has not been declared DSPI.cpp: In function 'void disableInterruptTransfer()': DSPI.cpp:972:33: error: cannot call member function 'void DSPI::disableInterruptTransfer()' without object

The Example compiles Cleanly on an Uno32

Would it be related to PPS mapping? I will try that and see if it resolves it. ON

adding the following results in the same errors as above:

mapPps(11, PPS_OUT_SDO2);
  mapPps( 7, PPS_IN_SDI2);
  mapPps( 8, PPS_IN_SS2);
  
  pinMode(11, OUTPUT);
  pinMode(7,  INPUT );
  pinMode(8,  INPUT );
  
  
  spi.begin();
  spi.setSpeed(250000);

Cheers Chris


JordanR

Tue, 25 Jun 2013 16:17:40 +0000

Hello Chris,

There are a couple things. One, there is a typo in the Board_Defs.h file for the DP32. The 'anss' should be deleted. What was the first board you were using? Regarding the Fubarino Mini, looks like the Board_Defs.h file defines NUM_DSPI_PORTS as 1, but it has definitions for DSPI1 and DSPI0.

Best Regards,

Jordan


caroper

Tue, 25 Jun 2013 18:51:26 +0000

Thanks Jordan,

Removing "0 anss" from all files worked. Both the DP32 and My own Files now compile clean.

The first Board is not really a Board at all, it is a PIC32MX250F128B on a Breadboard.

I am busy developing a couple of Bootloaders for the MX150 and MX250 device that will allow for rapid prototyping and field upgradability. I am developing a Boards Entry to go with them such that the parts become interchangeable. If you don't need USB but need more I/O, pop out the MX250 and drop in an MX150, your Sketch should run unaltered.

I have been using the DP32 and Fubarino Mini Board Definitions as prototypes as they use the MX250.

Cheers, Chris