using programming port as I/O

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

cross mob
hesc_1314511
Level 3
Level 3
10 sign-ins First solution authored 10 replies posted

Hello,

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

Thanks

Henry

0 Likes
1 Solution
lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

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

View solution in original post

2 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

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

lock attach
Attachments are accessible only for community members.
MotooTanaka
Level 9
Level 9
Distributor - Marubun (Japan)
First comment on blog Beta tester First comment on KBA

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