Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
MB
Employee
Employee
10 sign-ins 5 sign-ins First reply posted

I am trying to set up two Q-SPI Interfaces on my PSoC6 (Dev. Board: CY8CPROTO-062-4343W PSoC6).

One SPI should be initialized in Quad-Mode and the second SPI in Single-Mode. The "Quad-Mode-SPI" works fine but initializing the "Single-Mode-Spi" returns a "pin-related-Error".

This is how i initialized the "Quad-Mode"-QSPI. Everything works fine.

 

#define dataSpi_Io0		(P11_6)
#define dataSpi_Io1		(P11_5)
#define dataSpi_Io2		(P11_4)
#define dataSpi_Io3		(P11_3)
#define dataSpi_Clk		(P11_7)
#define dataSpi_SS		(P12_4)

[...]
cyhal_qspi_t qspi;

result = cyhal_qspi_init(&qspi, dataSpi_Io0, dataSpi_Io1, dataSpi_Io2, dataSpi_Io3, NC, NC, NC, NC, dataSpi_Clk, dataSpi_SS, 1000000, 0);

 

 

This is how i initialized the "Single-Mode"-QSPI. The code results in a "Pin-Realted Error" (CYHAL_QSPI_RSLT_ERR_PIN)

 

#define ctrlSpi_Mosi	(P6_0)
#define ctrlSpi_Miso    (P6_1)
#define ctrlSpi_Clk     (P6_2)
#define ctrlSpi_SS      (P6_3)

[...]

cyhal_qspi_t spi;

result = cyhal_qspi_init(&spi, ctrlSpi_Mosi, ctrlSpi_Miso, NC, NC, NC, NC, NC, NC, ctrlSpi_Clk, ctrlSpi_SS, 1000000, 0);

 


Any ideas on how to fix that?

Marius

0 Likes
1 Solution
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello @MB ,

The reason it fails is because the pins P6_0, P6_1, P6_2, P6_3 are not valid SMIF pins. You can see in the below figure that they do not connect to the SMIF block, there's no mention. 

DheerajK_81_0-1615990562039.png

 

Please change the code to this:

#define ctrlSpi_Mosi	(P12_0)
#define ctrlSpi_Miso    (P12_1)
#define ctrlSpi_Clk     (P11_7)
#define ctrlSpi_SS      (P11_2)

You have other options too. Please see the below figure to understand which pins are available and what functionalities they represent. 

DheerajK_81_1-1615990930064.png

You can find this information in the datasheet here on page#34. With these changes you should be able to get it to work. Let me know your observations.

Regards,
Dheeraj

 

View solution in original post

2 Replies
DheerajK_81
Moderator
Moderator
Moderator
First comment on KBA First comment on blog 5 questions asked

Hello @MB ,

The reason it fails is because the pins P6_0, P6_1, P6_2, P6_3 are not valid SMIF pins. You can see in the below figure that they do not connect to the SMIF block, there's no mention. 

DheerajK_81_0-1615990562039.png

 

Please change the code to this:

#define ctrlSpi_Mosi	(P12_0)
#define ctrlSpi_Miso    (P12_1)
#define ctrlSpi_Clk     (P11_7)
#define ctrlSpi_SS      (P11_2)

You have other options too. Please see the below figure to understand which pins are available and what functionalities they represent. 

DheerajK_81_1-1615990930064.png

You can find this information in the datasheet here on page#34. With these changes you should be able to get it to work. Let me know your observations.

Regards,
Dheeraj

 

MB
Employee
Employee
10 sign-ins 5 sign-ins First reply posted

Hey @DheerajK_81 ,

i changed the Pin-Assignment in my code as you suggested and everything is working fine now. Thanks a lot!

Regards,
Marius

0 Likes