mcp3564 SPI error

Any bugs you encounter with Flowcode should be discussed here.
Post Reply
SpeedPIC32
Posts: 300
http://meble-kuchenne.info.pl
Joined: Thu Dec 10, 2020 2:35 pm
Location: Germany
Has thanked: 41 times
Been thanked: 18 times

Flowcode v11 mcp3564 SPI error

Post by SpeedPIC32 »

Hello,
I have one more small issue.
For the ADC3564 connections channel 4, I have MOSI on port D.0, MISO on port C.4, CLK on port D.10, and CS/SS on port D.7 in terms of hardware.
I cannot set the CLK remap pin to PortD.10. This makes it look as if two pins are being used. The following can be seen in the image clk. on the logic probe: image log, log2
log2.PNG
log2.PNG (69.22 KiB) Viewed 49 times
log.PNG
log.PNG (59.59 KiB) Viewed 49 times
clk.PNG
clk.PNG (37.81 KiB) Viewed 49 times


Incorrect data is being read.
If I set the oversampling higher than 256, the programme stops.
Regards

SpeedPIC32
Posts: 300
Joined: Thu Dec 10, 2020 2:35 pm
Location: Germany
Has thanked: 41 times
Been thanked: 18 times

Re: mcp3564 SPI error

Post by SpeedPIC32 »

PIC32MZ2048EFH144_SPI.fcfx
(27.42 KiB) Downloaded 6 times

medelec35
Matrix Staff
Posts: 2167
Joined: Wed Dec 02, 2020 11:07 pm
Has thanked: 662 times
Been thanked: 731 times

Re: mcp3564 SPI error

Post by medelec35 »

Hello.
SCK is not remappable so the pin is fixed no matter what the remappable pin shows.
With Channel 4 selected, the fixed pin is D10 ,so your image for connections is correct.
You can confirm this via the datasheet or target device image within Flowcode.
With SPI the remappable functions are for SDI, SDO and SS
Martin

SpeedPIC32
Posts: 300
Joined: Thu Dec 10, 2020 2:35 pm
Location: Germany
Has thanked: 41 times
Been thanked: 18 times

Flowcode v11 Re: mcp3564 SPI error

Post by SpeedPIC32 »

Thanks for that.
Unfortunately, the second issue with the OSR is still there. If the value becomes smaller or larger, the software crashes/stops running.
Is there a way to set only the clock frequency for SPI? Or does it run directly via the Fosc/32 prescale setting?

Regards, SpeedPIC32

Post Reply