chipKIT® Development Platform

Inspired by Arduino™

SoftSPI - NRF24L01 - Mirf Library

Created Wed, 21 Mar 2012 10:18:33 +0000 by d4rkm1nd


d4rkm1nd

Wed, 21 Mar 2012 10:18:33 +0000

Hi! I'm trying to use this library on mpide, but i have a lot of errors. In an Arduino board works perfect, so it is a compatibility problem. It uses SPI.h and Wprogram.h. I have try to change SPI-->SoftSPI and SPI-->DSPI, but the problem its the same. Anybody has the same problem or any suggestion?

Thanks for all!

When I try the example in the folder SoftSPI-->PmodJSTKSoftSpi the example doesnt works. It gives me a lot of errors


d4rkm1nd

Wed, 21 Mar 2012 20:09:58 +0000

[color=#FF0000]Solved[/color]

You have to erase the lines

    SPI.setDataMode(SPI_MODE0);
SPI.setClockDivider(SPI_2XCLOCK_MASK);

on MirfHardwareSpiDriver.cpp


javi.ar

Sun, 22 Sep 2013 12:51:15 +0000

How did you manage to get rid of Arduino.h error ??? I am trying to make it work in Chipkit max32 board, but no success. Thanks a lot


djgardn2

Sun, 20 Jul 2014 20:48:57 +0000

In case this is useful for anyone to know.

I have successfully been able to use the Mirf Library with the PIC32MX250F128B that is on the chipKIT Pi, so I am pretty sure that with slight changes you would be able to get the Max32 board to work as well or possibly other boards too.

Things you need to change to make the Mirf Library to work (MPIDE, etc):

On Line 30 inside the Mirf.h file: Delete the Arduino.h and change to WProgram.h

So it looks like this

#include <WProgram.h>

Then like stated above, you need to Delete the following two lines of code inside the MirfHardwareSpiDriver.cpp file. Delete lines 8 and 9, like shown in the previous post found above on this page.

Note: You will most likely need to change the csnPin, see given code example that comes with library on how. Using the PIC32MX250F128B I had to change the csnPin to 3, since the chipKIT Pi doesn't have a digital pin number seven.


majenko

Sun, 20 Jul 2014 21:07:48 +0000

That should be WProgram.h not Wprogram.h or it will break on any real operating system (i.e., anything with a case sensitive filesystem, so not Windows).


djgardn2

Sun, 20 Jul 2014 21:55:18 +0000

Thanks for that, I updated the post to include the correct WProgram.h now.