2 Replies Latest reply on Jan 28, 2020 4:23 PM by MoTa_728816

    using programming port as I/O

    hesc_1314511

      Hello,

      can I use the programming port, for example of CY8C4146AXI-S453, as I/O?

       

      Thanks

       

      Henry

        • 1. Re: using programming port as I/O
          JoMe_264151

          Yes, you may. Just take care that the connected hardware does not go wild during the programming.

          Setup: In Creator system view change the "Debug select" to GPIO.

          Programming can be done using Kitprog or Miniprog.

           

          Bob

          2 of 2 people found this helpful
          • 2. Re: using programming port as I/O
            MoTa_728816

            Hi,

             

            To visualize what Bob-san taught us a little, I made a sample project

             

            schematic

            000-schematic.JPG

            When I see Pins in DWR (Design Wide Resources)

            P3[2] and P3[3] are used for SWD

            004-pin-before.JPG

            So I access System in the Design Wide Resources in the Workspace Explorer

            000-DWR-1.JPG

            When I double clicked "System"

            001-System-1.JPG

            Then click "v" in the right of Debug Select. (Default is SWD (serial wire debug)) to change the mode to GPIO

            002-System-2.JPG

            Now Debug Select is GPIO

            003-System-3.JPG

            When I accessed the Pins again, the reservation if P3[2] and P3[3] are cleared

            005-pin-after.JPG

            So we can assign GPIO to these pins

            006-swd-pins-assigned.JPG

            main.c

            =================

            #include "project.h"

             

            #define LED_ON  0u

            #define LED_OFF 1u

            #define SW_ON   0u

            #define SW_OFF  1u

             

            int main(void)

            {

                CyGlobalIntEnable; /* Enable global interrupts. */

             

                for(;;)

                {

                    if (SW_Read() == SW_ON) {

                        LED_Write(LED_ON) ;

                    } else {

                        LED_Write(LED_OFF) ;

                    }

                }

            }

            =================

             

            Note: Needless to say, with this configuration we can program the device

            but we can not use debugger.

             

            moto

            1 of 1 people found this helpful