//The following macros do not function as expected in the C32 v2.02 compiler from Microchip
void INTSetVectorPriority(INT_VECTOR vector, INT_PRIORITY priority);
// The function fails for the following inputs:
// INT_SPI_3_VECTOR or INT_VECTOR_SPI(SPI_CHANNEL3)
// I haven't tested channel 4 yet
#define INT_VECTOR_SPI(chn) ((INT_SPI_1_VECTOR - 1) + (chn))
// The following inputs do not work
// SPI_CHANNEL2 and SPI_CHANNEL3 (SPI_CHANNEL4 is untested)
To correct the code I've converted everything to hard coded configurations. I have a ticket in to Microchip here, if they release a new version of the library I will revert to my macro based code.
Friday, July 27, 2012
PIC32MX575F512L SPI Macro Bugs
I'm using two of Microchip's PIC32MX575F512L processors in a project I'm working on at work. On one microprocessor I am interfacing to three Fiber Optic Gyros (FOGs) as an SPI slave. In setting up the PIC for communication I was acting the part of a good programmer using macros to make my code more dynamic and easier to read, macros provided by Microchip. However, I discovered that two of those macros were at least partway broken.
Subscribe to:
Posts (Atom)