cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

Contributor II

For a PSoC 4 design...

While using SPI Master component (SPIM) to communicate with an external SPI Slave, I want the option to disable the SPI Master. I plan to switched the SPI Master function off using the SPIM_STOP().

After: SPIM_STOP(), what state will extenally connected pins be set to including: CS_N, SCLK, MOSI and MISO

These 4 lines are shared with other devices. If they don't automatically tri-state when the SPI Master component is stopped, can I force the pin into a tri-state mode directly or is there a better way to tri-state external pins driven by an SCB based component.

Greg

0 Likes
Reply
1 Solution
Moderator
Moderator

Hi GrCa_1363456​,

The component takes care of SPI master output pins (CLK and SS) to the following  settings:

1. CLK is set to the inactive state settings based on CPOL in the configurator. CPOL: 0 - Set 0 ; CPOL :1 - Set 1

2. SS pin is set to the active high SS or active low SS setting in the configurator Active high- Set 0; Active low - Set 1

You can find the above information in SPI_SpiStop() in <SCB_name>_SPI.c

3. MOSI is set to strong drive

4. MISO is set to input pin (digital Hiz) - input buffer ON.

If you need to force them to analog HiZ, you can use the pin component APIs that is in the generated source.

pastedImage_0.png

You can set the drive mode using the API as shown above. Use 0 as the parameter to set it to analog Hiz.

Regards,

Bragadeesh

Regards,
Bragadeesh

View solution in original post

1 Reply
Moderator
Moderator

Hi GrCa_1363456​,

The component takes care of SPI master output pins (CLK and SS) to the following  settings:

1. CLK is set to the inactive state settings based on CPOL in the configurator. CPOL: 0 - Set 0 ; CPOL :1 - Set 1

2. SS pin is set to the active high SS or active low SS setting in the configurator Active high- Set 0; Active low - Set 1

You can find the above information in SPI_SpiStop() in <SCB_name>_SPI.c

3. MOSI is set to strong drive

4. MISO is set to input pin (digital Hiz) - input buffer ON.

If you need to force them to analog HiZ, you can use the pin component APIs that is in the generated source.

pastedImage_0.png

You can set the drive mode using the API as shown above. Use 0 as the parameter to set it to analog Hiz.

Regards,

Bragadeesh

Regards,
Bragadeesh

View solution in original post