How to set the pin function using software method?

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

cross mob
lock attach
Attachments are accessible only for community members.
Anonymous
Not applicable

Hello everybody:

   

I want to use pins status to monitor my process' running status,not in debugging.

   

By using software program to set pin's logic status(high or low), I want to watch my program's running status!

   

The attached file describes the details!

0 Likes
3 Replies
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

I suppose it is "CyPins_SetPin(Pin_1);" to set your monitor-output.

   

 

   

Bob

0 Likes
Anonymous
Not applicable

 Hi,

   

Open the file Pin_1_aliases.h. You will see the macro for pin configuration register. It will be as below.

   

 #define Pin_1_0 Pin_1__0__PC

   

Therfore use API as below to set this pin high. 

   

CyPins_SetPin(Pin_1_0).

   

 

   

OR

   

 

   

You can use your method without using any macros and use original register names as mentioned in cydevice_trm.h. 

   

CyPins_SetPin(CYREG_PRT1_PC5).

   

Note that you used "PC0" which means port 1 and pin 0 but your pin is placed at P1[5], therfore you should use PC5.

   

 

   

Thank you,

   

Pavan

0 Likes
Anonymous
Not applicable

Thanks for your friendly reply! and i can solve my problem as soon as possible!

0 Likes