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

cross mob
ly
Level 4
Level 4
25 replies posted 50 sign-ins 10 replies posted

Hello,

I registered the falling edge interrupt of a gpio port on cyusb3014. The io port is the input port and the input value changes from 1 to 0 for a few seconds before changing back to 1. After receiving the interrupt, I read the level value of the io port. Theoretically, the level value of io is 0 when the interrupt is triggered, but I read the value of the io as 1 after the interrupt is triggered. May I ask if this is because my data value 0 is also ignored after the gpio interface triggers an interrupt?

Thank you.

Here is my code to simulate a serial port using the gpio port,

void uart_rcv_call_back(uint8_t id){  //gpio intr, a gpio virtual_uart_rcv
    if(!start_bit_rcv){
        start_bit_rcv = CyTrue;
 
        while(index != 8){
            CyU3PGpioSimpleGetValue(58,&uart_rcv_bit[index]);
            CyU3PBusyWait(us_delay);
            index++;
        }
 
        index = 0;
        start_bit_rcv = CyFalse;
    }
}
0 Likes
1 Solution
narolkarvarun
Moderator
Moderator
Moderator
100 solutions authored 250 replies posted 50 solutions authored

Hi Ly ,

Please share your source code, have you selected GPIO functionality properly?

can you please let us know what is your end application?

please follow table 7 of Fx3 datasheet , is that port is configure as any protocol while using GPIO ?

if yes please check GPIO Override functionality on above mentioned example .

Thank you

Varun Narolkar

 

 

 

 

View solution in original post

0 Likes
6 Replies
narolkarvarun
Moderator
Moderator
Moderator
100 solutions authored 250 replies posted 50 solutions authored

Hi Ly , 

please share GPIO configuration structure.

as per GPIO get input from the edge triggered from the External Pin will serve the interrupt, once interrupt will clear will go to ideal state. 

It is depends on external Pin who is driving, please remove delay from the interrupt handler.

you can check with incising time of your trigger. share the logic analyzer traces.

 

Thank you

Varun Narolkar

0 Likes

Hello,

Here is my GPIO configuration structure.

void gpio_init(){
    CyU3PGpioClock_t gpioClock;
    CyU3PReturnStatus_t apiRetStatus = 0;
 
    gpioClock.fastClkDiv = 2;
    gpioClock.slowClkDiv = 0;
    gpioClock.simpleDiv = CY_U3P_GPIO_SIMPLE_DIV_BY_2;
    gpioClock.clksrc=CY_U3P_SYS_CLK;
    gpioClock.halfDiv = 0;
 
    apiRetStatus = CyU3PGpioInit(&gpioClock, uart_rcv_call_back);
}

gpioConfig_in.outValue = CyTrue;
gpioConfig_in.driveLowEn = CyFalse;
gpioConfig_in.driveHighEn = CyFalse;
gpioConfig_in.inputEn = CyTrue;
gpioConfig_in.intrMode = CY_U3P_GPIO_INTR_NEG_EDGE;

I only registered the falling edge interrupt of an io port. After triggering the falling edge interrupt, I continued to set the io to 0 externally for some time, but the level value of the io I read was always 1, I suspect that the system ignored my value 1 as the falling edge, how to deal with this?
 
The work is urgent, hope someone can give me a hand.
Thanks.
0 Likes
narolkarvarun
Moderator
Moderator
Moderator
100 solutions authored 250 replies posted 50 solutions authored

Hi Ly ,

please check the GPIOAPP example code given at below path where GPIO45 is set as both edge trigger and read the event.

C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\serialif_examples

please handle with CyU3PEventGet() ,CyU3PEvenset() given in example.

please share your full source code with us.

Thank you

Varun Narolkar

 

0 Likes
ly
Level 4
Level 4
25 replies posted 50 sign-ins 10 replies posted

Hello,

I registered an event to set and receive the falling edge event of a certain port of gpio. In my program, it is mainly used to receive the falling edge event of the sending end of uart. After triggering this event, I read the virtual gpio receiving port corresponding to the sending port of uart. That is: an 8-bit data 0bxxxx_xxxx, only 0bxxxx_xxx1 can successfully receive, and other numbers 0bxxxx_xxx0 without exception appear to receive data anomalies.

Thanks.

0 Likes
narolkarvarun
Moderator
Moderator
Moderator
100 solutions authored 250 replies posted 50 solutions authored

Hi Ly ,

Please share your source code, have you selected GPIO functionality properly?

can you please let us know what is your end application?

please follow table 7 of Fx3 datasheet , is that port is configure as any protocol while using GPIO ?

if yes please check GPIO Override functionality on above mentioned example .

Thank you

Varun Narolkar

 

 

 

 

0 Likes
ly
Level 4
Level 4
25 replies posted 50 sign-ins 10 replies posted

Hello,

I will send it to you privately later.

Thanks.

0 Likes