Strictly necessary cookies are on by default and cannot be turned off. Functional, Performance and Tracking/targeting/sharing cookies can be turned on below based on your preferences (this banner will remain available for you to accept cookies). You may change your cookie settings by deleting cookies from your browser. Then this banner will appear again. You can learn more details about cookies HERE.
Strictly necessary (always on)
Functional, Performance and Tracking/targeting/sharing (default off)
Change the "Select" type for pins in PSoC Designer firmware
Question: How can I switch between "StdCPU" to "Global In" or "Global Out" bus within firmware?
The Global Select Register be changed for the above purpose. The PRTxGS register decides if a GPIO pin is under the control of the CPU or is connected to the Global In or Global Out bus.
1. When the bit in PRTxGS register is cleared, the pin is under the CPU control (i.e. "StdCPU") and hence the pin state is modified by writing to the PRTxDR register.
2. When the bit in PRTxGS register is set, the pin is connected to the Global bus and connects to the internal hardware blocks."Global output or Global input" is decided by the drive mode of this pin. If GPIO drive mode is set to digital High Z state (DM[2:0] = 010b), then it is selected for Global Input and in non-High Z modes, the block is selected for global output
For example, following are the steps for changing the "Select" option for Pin0_4 from "StdCPU" to "GlobalOutEven_4":
1. Set the port global select bit high
PRT0GS |= 0x10
2. Set the drive state to any of the non-High Z states as per your requirements. Modify the PRT0DMx registers for the same.