cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC Creator & Designer Software

Anonymous
Not applicable

Hi,

   

 

   

I am fairly new to PSoC Creator but I was able to make pin assignments and bitbang an LED Strip. Basically, I have numerous GPIO pins as output and PSoC acts as an I2C Slave to another MCU. We have an I2C Protocol which goes GAXYS such that:

   

G - value is G which stands for GPIO

   

A - Action. Values can be W for write or R for Read,

   

X - Port Number

   

Y - Pin Number

   

S - State. Values can be H for High or L for Low (Only applicable for GPIO Write)

   

For Example,

   

GW00H means Write Port 0,0 to Logic Level High 

   

GW41L means Write Port 4,1 to Logic Level Low   

   

GR27 means Read Port 2,7 report H or L for the Logic Level

   

I will then do a conversion for the Port Number(X) and Pin Number(Y) ,whose value from I2C will range from 0x30 to 0x39, such that they will correspond to PSoC's port and pin number (0-9).

   

I will then need to Write to this specific Port Number-Pin Number the State (High or Low) or Read the state from this Port Number-Pin Number.

   

All my pins so far are declared in the .cysch and .cydwr. Is there a way to set/clear/read pins given the port number and the pin number? 

   

I had tried to run CY_SYS_PINS_SET_PIN(2,2) in my main and attached an LED to the Port 2, Pin 2 but it did not turned on. 

0 Likes
Reply
1 Solution
JoMe_264151
Expert II

 CY_SYS_PINS_SET_PIN(2,2) should work. Did you set the pin's drive mode to output strong and did you remover the hardware connection? What PSoC do you use, what board do you use??

   

 

   

Bob

View solution in original post

0 Likes
Reply
2 Replies
JoMe_264151
Expert II

 CY_SYS_PINS_SET_PIN(2,2) should work. Did you set the pin's drive mode to output strong and did you remover the hardware connection? What PSoC do you use, what board do you use??

   

 

   

Bob

View solution in original post

0 Likes
Reply
Anonymous
Not applicable
        Hi Bob, I am using the CY8CKIT-044 kit. It has CY8C4247AZI-M485 PSoC. I was able to make my code work with CY_SYS_PINS_SET_PIN(CYREG_PRT2_DR,2). Thanks, Kat   
0 Likes
Reply