PSoC1(CY8C24223) GPIO Programming - Port 1 does not work | Cypress Semiconductor
PSoC1(CY8C24223) GPIO Programming - Port 1 does not work
Hi, I am using CY8C24223A and met a problem of GPIO in/out control by software.
It seems that PRT0 data can be controlled well while PRT1 data cannot.
My final goal is four digital inputs (P0, P0, P1, P1) and six digital outputs (P0, P0, P0, P1, P1, P1).
I must control them all by software. But I found they did not work as I expect from the documents.
So I tested simple logic; P1 = !P1, P1 = P1
Partial source code is;
Port_1_Data_SHADE = 0;
PWMB = (PRT1DR & 0x128) >> 7; // read P1
Port_1_Data_SHADE &= ~0x32; // clear P1
Port_1_Data_SHADE |= 0x64; // set P1
Port_1_Data_SHADE |= 0x32; // set P1
Port_1_Data_SHADE &= ~0x64; // clear P1
PRT1DR = Port_1_Data_SHADE;
But I found both actual output P and P were always 0 levels.
In the other hand, another logic using P0 port worked well. (P0 = !P0, P0 = P0)
Device: CY8C24223A-24PXI, developped by PSoC designer 5.4
I have tried with / without using data shade registers.
Could anyone give me suggestions?
Thank you very much for your attention in advance.