PIC32MZ2048ECG100 SPI Pin are not all avaible

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 8.

Moderator: Benj

stefan.erni
Posts: 329
Joined: Fri Aug 19, 2016 2:09 pm
Has thanked: 117 times
Been thanked: 88 times
Contact:

PIC32MZ2048ECG100 SPI Pin are not all avaible

Postby stefan.erni » Tue Jul 17, 2018 11:43 am

Hi Ben
Can you help me a little...
On a board with PIC32MZ2048ECG100 I have to config
SPI2 and SPI3
I think the good thing is on this CPU you can choose for
SPI2 C4 and B3 as MOSI or MISO
SPI3 B10 and B9 as MOSI or MISO
But in FC8 are not all Pins for the SPI avaible.


SPI2.PNG
SPI2.PNG (16.73 KiB) Viewed 303 times


SPI3.PNG
SPI3.PNG (15.21 KiB) Viewed 303 times

User avatar
Benj
Matrix Staff
Posts: 13070
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 3782 times
Been thanked: 3626 times
Contact:

Re: PIC32MZ2048ECG100 SPI Pin are not all avaible

Postby Benj » Tue Jul 17, 2018 3:34 pm

Hi Stefan,

I believe this should be fixed now.

Please can you run the Help -> Check for updates tool and get the latest CAL_SPI component and hopefully this should solve the problem for you.

Let us know how you get on.

stefan.erni
Posts: 329
Joined: Fri Aug 19, 2016 2:09 pm
Has thanked: 117 times
Been thanked: 88 times
Contact:

Re: PIC32MZ2048ECG100 SPI Pin are not all avaible

Postby stefan.erni » Tue Jul 17, 2018 4:13 pm

Hi Ben

It's working perfect. It's nice to have FC8 with the update.

regards

Stefan
These users thanked the author stefan.erni for the post:
Benj (Tue Jul 17, 2018 4:51 pm)
Rating: 5.88%
 

stefan.erni
Posts: 329
Joined: Fri Aug 19, 2016 2:09 pm
Has thanked: 117 times
Been thanked: 88 times
Contact:

Re: PIC32MZ2048ECG100 SPI Pin are not all avaible

Postby stefan.erni » Mon Aug 13, 2018 7:58 am

Hi Ben

There is still a little problem.
I can now choose the SPI2 with C4 and B3 as MOSI or MISO.
If I config C4 as MISO and B3 as MOSI then the signal goes out from the PIC but the PIC can not read a signal.
I controlled the Signal with the scope and every thing looks fine on the Pin from the PIC.
When I change the SPI to hardware then it's ok.
There is a problem with C4 as MISO.

Soon I test SPI3......

stefan.erni
Posts: 329
Joined: Fri Aug 19, 2016 2:09 pm
Has thanked: 117 times
Been thanked: 88 times
Contact:

Re: PIC32MZ2048ECG100 SPI Pin are not all avaible

Postby stefan.erni » Tue Aug 14, 2018 2:41 pm

Hi Ben

I tested SPI3 with an SD Card and it's ok.
So just the SPI2 Miso on C4 has a problem.

stefan.erni
Posts: 329
Joined: Fri Aug 19, 2016 2:09 pm
Has thanked: 117 times
Been thanked: 88 times
Contact:

Re: PIC32MZ2048ECG100 SPI Pin are not all avaible

Postby stefan.erni » Tue Aug 21, 2018 2:09 pm

Hi Ben


There is still a problem with SPI2. The MISO on Pin C4 is not working if I choose hardware SPI. Data is on the pin but the SPI read always 0.
Strangely I can choose C4 ...as MISO...

If I change to software SPI it's reading from C4.

For the part on this SPI bus I need a hardware SPI. It's read 8Channel 24 bit ADC.
Can you give me a hint what I can do to make SPI2 work correctly?

User avatar
Benj
Matrix Staff
Posts: 13070
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 3782 times
Been thanked: 3626 times
Contact:

Re: PIC32MZ2048ECG100 SPI Pin are not all avaible

Postby Benj » Wed Aug 22, 2018 9:59 am

Hello,

We've just seen this very problem on a 16F18877 and it looks to be a silicone bug. If you change the sample point to the end of the period then it starts working as expected.

You should be able to edit the SPI properties by clicking on View -> Component Debugger to see if it's a similar problem to the one we are seeing.

Tick the Expose full component tree checkbox

Using the drop down at the top of the properties window look for the cal_spi component.

Change the sample point property to End.

Untick the expose full component tree checkbox and close the Component Debugger window.

Let us know how you get on.

stefan.erni
Posts: 329
Joined: Fri Aug 19, 2016 2:09 pm
Has thanked: 117 times
Been thanked: 88 times
Contact:

Re: PIC32MZ2048ECG100 SPI Pin are not all avaible

Postby stefan.erni » Wed Aug 22, 2018 10:54 am

Hi Ben

I dit it but no effect.
But I'm not sure if I undestand it right.This option is always in the properties windows.

SPI_on_END.PNG
SPI_on_END.PNG (100.22 KiB) Viewed 161 times

stefan.erni
Posts: 329
Joined: Fri Aug 19, 2016 2:09 pm
Has thanked: 117 times
Been thanked: 88 times
Contact:

Re: PIC32MZ2048ECG100 SPI Pin are not all avaible

Postby stefan.erni » Wed Sep 05, 2018 8:41 am

Hi Ben

SPI hardware Channel 3 is working fine
SPI hardware Channel 5 is working fine

I can not yet use SPI 2 hardware. So I tried to solder a wire to an another pin, but the same problem.

Mosi= B3; Miso= C4 ;clk= G6 //software ok, hardware no input
Mosi= B3; Miso= D3 ;clk= G6 //software ok, hardware no input

Software SPi is working but the maximal speed is 3.3Mhz

I just copy the info from Texas Instruments about the minimum speed for the TI Chip...
If you take a look at table 7.6 of the datasheet you will see the minimum SCLK period, either 50nS or 66.6nS depending on your DVDD voltage. This corresponds to 20MHz or 15MHz respectively. Your SCLK of 3.3MHz is much too slow.

User avatar
Benj
Matrix Staff
Posts: 13070
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 3782 times
Been thanked: 3626 times
Contact:

Re: PIC32MZ2048ECG100 SPI Pin are not all avaible

Postby Benj » Thu Sep 06, 2018 4:00 pm

I've had a look through the device definition file and the CAL code for SPI 2 vs SPI 3 and the code as far as I can see is correct.

Is there an errata document for this device on the microchip website? I tried to have a look but the documents for the device don't seem to be available atm. Also the device is marked as not for new designs, maybe the EFG version would be better?
These users thanked the author Benj for the post:
stefan.erni (Thu Sep 06, 2018 4:18 pm)
Rating: 5.88%
 

stefan.erni
Posts: 329
Joined: Fri Aug 19, 2016 2:09 pm
Has thanked: 117 times
Been thanked: 88 times
Contact:

Re: PIC32MZ2048ECG100 SPI Pin are not all avaible

Postby stefan.erni » Wed Sep 19, 2018 3:02 pm

Hi Ben

For the SPI2 MISO with C4 is not working.
I put a wire to all the Pin in the list ... ..
And one is working!

I put a wire from C4 to D3 and changed MISO to D3. Then it's working with the hardware SPI2.
Please can you check if it's in way possible to fix the C4.

The another thing is that leading and trailing edge are reversed in hardware SPI. Not a problem for me......
The picture is choosed leading but it's trailing (it's a value 0x02).

hardware_leading.png
hardware_leading.png (34.49 KiB) Viewed 26 times