This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

GPIO input and output response time problem



Hi,

I'm using Am335x with PSP04.06.00.07, I'm using GPIO1_24 as input, and GPIO1_20 as output. i have write a GPIO kernel driver, using the ioremap() function to map the GPIO1 module.

initially, the GPIO1_20 (output) will output logic 1, when GPIO1_24 (input) detecting level logic 1, i need GPIO1_20 (output) to output logic 0. From scope, the result as following:

                                       200ns (pulse)
                                            __                                                                             logic 1
                                            |   |
                                            |   |
GPIO1_24(input)___________|   |____________________________________    logic 0
 
                                                 400ns
                                             |----------|
GPIO1_20(output)__________________                                                                    logic 1
                                                          |
                                                          |
                                                          |_________________________________logic 0
 
From the scope, i see my my kernel driver can detect the GPIO1_24 input signal pulse with 200ns, but my GPIO1_20 will only pull low after 400ns.
 
my code for doing this task is as following:
 
            while(!(*gpio1_24 & (1 << 24)));       //waiting GPIO1_24 input logic 1
            *gpio1_20 |= (1 << 20);                    //output GPIO1_20 logic 0

Why and What cause this delay problem to GPIO? 

Is it because the CPU take time to serving each module across the interconnection L3 and L4 cross bar? causing a wait state to service GPIO module ?

I want my GPIO1_20 pull to low after detect logic 1 from GPIO1_24 in 100ns.

i have already try using the rising edge interrupt on GPIO1_24 (input), result is even more worst than polling method, It is because interrupt process in kernel not same as the low level programming interrupt process?

Thanks and Regards,
Keldy