chipKIT® Development Platform

Inspired by Arduino™

chipkit Max32 SPI pin

Created Wed, 06 Jul 2016 10:03:40 +0000 by Dharmesh


Dharmesh

Wed, 06 Jul 2016 10:03:40 +0000

I am using CHIp kit Max32. I write a SPI function which is work on uc32 and wf32. But same code is not working for max32. When i read the chipkit manual i observe that the SPI pin 13,12,11,10 is not compatible with us32 and wf32. Can i use Max32 with any ardunio shield?? . If yes then i need i2c and spi pinout same as uc32 and wf32.is it possible to do it??

Please anyone can help me?


majenko

Wed, 06 Jul 2016 10:11:13 +0000

You could either use the SoftSPI library to use any pins you like, or you can use the Arduino standard SPI header - the block of 6 pins by themselves - which are intended to be the same across all boards.

Arduino themselves faced this problem with boards like the Mega2560 and Due when they couldn't map the SPI pins to pins 10-13, so they decided on the ICSP header as the standard SPI connection for all future shields. It should be used in preference to pins 10-13 to maintain compatibility between boards.


Dharmesh

Thu, 07 Jul 2016 04:06:33 +0000

I am not familiar with ardunio or chipkit. can u please help me how to use soft spi.


majenko

Thu, 07 Jul 2016 11:14:11 +0000

The only things different with normal SPI are you need to define the object and pass the pins to .begin():

#include <SoftSPI.h>

SoftSPI SPI;

void setup() {
    // SS, MOSI, MISO, SCK
    SPI.begin(10, 11, 12, 13);
}

void loop() {
}

Everything else is the same.