Problem of Pins Input

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   
On my own breadboard[Cy8C3246AXA], GPIO Read has a problem.   
It is a 4bit program Sw, connect to P5[4]-P5[7]   
Pins driive mode is Resistive pull up, initial:HIgh, Max voltage:5V   
If program digit is ONE, port register might be 0xE0.   
   
Actually, measured voltage is 0V,0,0,5V   
But always 0x00 was red, whichever program digit is.   
   
I had attached the project.   
Any suggestions?   
0 Likes
1 Solution
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked
        When reading the port with the appropiate APIs you'll have to select yourself the right bits by masking and shifting. When reading the pins the API does the shift for you and returns false (0x00 or true (0x01).   
   
Bob   

View solution in original post

0 Likes
4 Replies
Anonymous
Not applicable
        Typo:   
Actual voltage: 5v,5v,5v,0v   
0 Likes
Anonymous
Not applicable
        Oh, I was misreading the Pins API function.   
Bit shift was done in the API.   
I had no need to shift the port value, that's useless.   
sorry for that.   
0 Likes
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked
        When reading the port with the appropiate APIs you'll have to select yourself the right bits by masking and shifting. When reading the pins the API does the shift for you and returns false (0x00 or true (0x01).   
   
Bob   
0 Likes
Anonymous
Not applicable
        Thank you.   
0 Likes