chipKIT® Development Platform

Inspired by Arduino™

SPI library not complete?

Created Fri, 19 Aug 2011 18:53:49 +0000 by rasmadrak


rasmadrak

Fri, 19 Aug 2011 18:53:49 +0000

Hi there!

The SPI.cpp and SPI.h file differs in the definition setClockDivider. void SPIClass::setClockDivider(BYTE rate) <- is declared as WORD in .h file.

Besides that - I noticed in the code that bitorder is not yet supported? When will it be and what is the default? I need MSBFIRST for my project. :)


GeneApperson

Fri, 19 Aug 2011 20:42:00 +0000

OOPS! One of the people at Digilent updated the setClockDivider function to take a word parameter to allow for the 9-bit divider in the PIC32. He forgot to send the .h file along with the .c file. It's being taken care of now.

The SPI controllers in the PIC32 don't support selectable shift direction. they only support shifting MSB first. They support lots of other things that the AVR devices don't, but unfortunately this isn't one of them. Fortunately, I think, is that the majority of SPI device expect MSB first.

Gene Apperson Digilent


rasmadrak

Fri, 19 Aug 2011 21:24:56 +0000

Luckily, I need MSB-first order. :)

Too bad that's not the problem I'm having thou... I have the exact same setup on the Mega2560 as the Max32, but the SPI display only shows valid information on the Mega2560.

Is there any other differences one should be aware of when migrating from Arduino's? I'm for example trying to use the center-board pins - do I need to enable them or something or are they enabled by SPI.begin()?


dc101

Mon, 22 Aug 2011 00:21:36 +0000

Has this been pushed to the github yet? I checked a couple of the directories, but SPI.h still shows 8 bits.

I ask because I tried to using SPI today, but my LCD is too slow even for the slowest SPI speed :( . I was going to attempt to recompile the SPI library when I can upon this post.

EDIT: NVM I realized I was looking in the wrong library folder, which brings up another question though. What is the purpose of the main /mpideXXX/libraries folder if when you compile it uses the library folder under /mpideXXX/hardware/pic32/libraries?

-Tim

OOPS! One of the people at Digilent updated the setClockDivider function to take a word parameter to allow for the 9-bit divider in the PIC32. He forgot to send the .h file along with the .c file. It's being taken care of now. Gene Apperson Digilent


GeneApperson

Mon, 22 Aug 2011 04:09:33 +0000

EDIT: NVM I realized I was looking in the wrong library folder, which brings up another question though. What is the purpose of the main /mpideXXX/libraries folder if when you compile it uses the library folder under /mpideXXX/hardware/pic32/libraries?

The /mpidexxx/libraries folder is for the Arduino libraries. The /hardware/pic32/libraries folder is for the chipKIT libraries.

Gene Apperson Digilent