chipKIT® Development Platform

Inspired by Arduino™

SoftSPI and DigitalIO.h Issue

Created Mon, 07 Mar 2016 08:15:56 +0000 by phillysteak527


phillysteak527

Mon, 07 Mar 2016 08:15:56 +0000

Hello all,

I wasn't able to find an answer on any of the previous SoftSPI topics. I am getting an error when trying to use the SoftSPI library "util/atomic.h: No such file or directory." Once I navigated to the DigitalPin.h file I discovered that it only contains pin maps for AVR chipsets (Was written in 2011), does this mean I have an ancient file for DigitalPin.h?

I wanted to ask if I needed to simply update the file before I dig into updating the pin mapping to get this to work for the u32. I'm in need of a software SPI solution that allows for a custom clock pin, any other suggestions are greatly appreciated.


majenko

Mon, 07 Mar 2016 10:50:37 +0000

It sounds like you are looking at the wrong SoftSPI library. You should have the Digilent SoftSPI library included with MPIDE, chipKIT Core, or UECIDE.

The Digilent one has this at the top of the header file:

/************************************************************************/
/*                                                                      */
/*  SoftSPI.h -- Declarations for chipKIT Software SPI Library          */
/*                                                                      */
/************************************************************************/
/*  Author:     Gene Apperson                                           */
/*  Copyright (c) 2011, Digilent Inc, All rights reserved               */
/************************************************************************/
/*  File Description:                                                   */
/*                                                                      */
/* This header file contains interface declarations for use of the      */
/* chipKIT Software SPI library. This library provides support for any  */
/* number of bit-banged software SPI ports.                             */
/*                                                                      */
/************************************************************************/
/*  Revision History:                                                   */
/*                                                                      */
/*  11/21/2011(Gene Apperson): Created                                  */
/*                                                                      */
/************************************************************************/

phillysteak527

Tue, 08 Mar 2016 09:41:16 +0000

majenko thank you very much for your response, I'm confused as to how I had an incorrect SoftSPI to begin with but I was able to get it working with a clean install of mpide. Thanks again!

If anyone is looking to use this method for SPI control of Xbee modules it works extremely well.


guymc

Tue, 08 Mar 2016 16:47:18 +0000

Glad to hear that a fresh install solved the problem.

Incidentally, you should be aware that active development of MPIDE has ceased. Our engineers are now focused on chipKIT-core, which is a Board Manager package for the official Arduino IDE. More info here:

[url]http://chipkit.net/wiki/index.php?title=ChipKIT_core[/url]

chipKIT-core is where you will find the latest bug fixes and new features such as FAT file system support.

Cheers