How to read value at GPIO (CY8CKit-040 PSOC 4000 Pioneer Kit)

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

Hi I''m trying to read the value of a GPIO pin on the Cy8CKit-040 PSoc4 4000 Pioneer Kit). I want to read this value in Debug mode, and see how the value changes accordingly. For some reason, I cannot create a Watch expression for the variable that I am trying to observe.

Attached is my main.c file.

Analog_In_Read is the name of the Analog Pin I want to read. I have set this pin to be P0_0 on the MCU.

Thank you for your time

0 Likes
1 Solution
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

There is a Code Example project "ADC_VoltageInp"  You can download and install to your PSoC Creator.

Select a menu item "File->Code Example..." on the PSoC Creator.

Type "ADC_VoltageInp" to the "Filter by:" text box on the "Find Code Example" dialogue as follows.

GS003313.png

Click the "Create Project" button to create a copy of the code example to your workspace.

Please refer the operation manual installed with the code example project.

Regards,

Noriaki

View solution in original post

0 Likes
3 Replies
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

Please let me know what do you want to read from the pin?

A digital signal or an analog voltage value?

The API macro reads a digital value on the pin.  If you want to get a digital value on the P0_0 youcan use a notation like CyPins_ReadPin(CYREG_PRT0_PC0)

If you want to get an analogue value, you must put an AD converter on the CYSCH page and connect an analog pin to the ADC's input.

Regards,

Noriaki

0 Likes
Anonymous
Not applicable

We are interested in reading an analog value from GPIO Pin P_0_0

0 Likes
NoriTan
Employee
Employee
25 sign-ins 5 questions asked 10 sign-ins

There is a Code Example project "ADC_VoltageInp"  You can download and install to your PSoC Creator.

Select a menu item "File->Code Example..." on the PSoC Creator.

Type "ADC_VoltageInp" to the "Filter by:" text box on the "Find Code Example" dialogue as follows.

GS003313.png

Click the "Create Project" button to create a copy of the code example to your workspace.

Please refer the operation manual installed with the code example project.

Regards,

Noriaki

0 Likes