Announcements

Equip yourself to optimize PSoc4 MCUs for Evs at the EV Webinar. Click here to register.

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

PSoC™ 4 Forum Discussions

GrCa_1363456
Level 5
Level 5
First comment on KBA First comment on blog 250 sign-ins

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
1 Solution
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

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
BragadeeshV
Moderator
Moderator
Moderator
First question asked 1000 replies posted 750 replies posted

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