Using mikroC PRO for PIC32 to program MINI-32 for PIC32MZ and have an issue in mapping SPI-MOSI to RD2 and SPI-MISO to RD3 as indicated in pinout documentation for mini-32. As RG6 is labeled as corresponding SPI-SCK and it is hardwired to SCK2 I was using;
error=PPS_Mapping(_RPD2, _INPUT, _SDI2);
error=PPS_Mapping(_RPD3, _OUTPUT,_SDO2);
Although SDO2 gets mapped to RD3, SDI2 never gets mapped to RD2. According to my interpretation of PIC32MZ documentation SDI2 cannot be mapped to RD2. But this combination (reverse) works.
error=PPS_Mapping(_RPD3, _INPUT, _SDI2);
error=PPS_Mapping(_RPD2, _OUTPUT,_SDO2);
Operation verified with software and hardware level with scope logic analyzer etc. Want to know what the issue could be.
Thanks,
Upali
MINI-32 for PIC32MZ PPS mapping issue (SPI)
Re: MINI-32 for PIC32MZ PPS mapping issue (SPI)
Hi,
I apologize for the late reply, have you been able to sort out this issue ?
Regards,
Filip.
I apologize for the late reply, have you been able to sort out this issue ?
Regards,
Filip.
Re: MINI-32 for PIC32MZ PPS mapping issue (SPI)
Hi Filip,
Not really as it looks like (to me) that MINI-32 for PIC32MZ documentation has some issues. For instance, pin RG6 is labeled as SPI1-SCK but according to page 4 of latest (2015-2021) MZ documentation RG6 (pin #4 of 64 pin package) is hard-wired to SCK2 (apparently all SPI SCK lines are hard wired). According to page 263 of MZ documentation corresponding SPI input pin SDI2 cannot be mapped to RD2 as indicated in MINI-32 documentation but it could be mapped to RD3. According to page 266 of MZ documentation corresponding SPI out pin SDO2 could be mapped to RD2 or RD3 and as RD3 is used as input I am using RD2 as SDO2. So, to me it looks like that in MINI-32 documentation, RG6 should be labeled as SPI2-SCK, RD2 as SPI2-MISO and RD3 as SPI2-MOSI.
The combination I pointed out works but is contrary to MINI-32 documentation.
Thanks,
Upali
Not really as it looks like (to me) that MINI-32 for PIC32MZ documentation has some issues. For instance, pin RG6 is labeled as SPI1-SCK but according to page 4 of latest (2015-2021) MZ documentation RG6 (pin #4 of 64 pin package) is hard-wired to SCK2 (apparently all SPI SCK lines are hard wired). According to page 263 of MZ documentation corresponding SPI input pin SDI2 cannot be mapped to RD2 as indicated in MINI-32 documentation but it could be mapped to RD3. According to page 266 of MZ documentation corresponding SPI out pin SDO2 could be mapped to RD2 or RD3 and as RD3 is used as input I am using RD2 as SDO2. So, to me it looks like that in MINI-32 documentation, RG6 should be labeled as SPI2-SCK, RD2 as SPI2-MISO and RD3 as SPI2-MOSI.
The combination I pointed out works but is contrary to MINI-32 documentation.
Thanks,
Upali