MINI-32 for PIC32MZ PPS mapping issue (SPI)

mikroC, mikroBasic and mikroPascal PRO for Microchip’s 32-bit PIC MCUs
Post Reply
Author
Message
Upalij
Posts: 4
Joined: 28 Mar 2014 22:33

MINI-32 for PIC32MZ PPS mapping issue (SPI)

#1 Post by Upalij » 03 Aug 2021 01:14

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

User avatar
filip
mikroElektronika team
Posts: 11874
Joined: 25 Jan 2008 09:56

Re: MINI-32 for PIC32MZ PPS mapping issue (SPI)

#2 Post by filip » 09 Aug 2021 13:20

Hi,

I apologize for the late reply, have you been able to sort out this issue ?

Regards,
Filip.

Upalij
Posts: 4
Joined: 28 Mar 2014 22:33

Re: MINI-32 for PIC32MZ PPS mapping issue (SPI)

#3 Post by Upalij » 15 Aug 2021 14:42

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

Post Reply

Return to “PIC32 PRO Compilers”