Skip to main content

delay time for GPIO P0 output to become high level

5 days ago

delay time for GPIO P0 output to become high level

Posted byGreenTea105 points 2 replies
0 upvotes

Hello,

I am making an application that sends BLE Advertising every second.

Every second, I would like to do the following.

・Set the P0_2 to high with GPIO_SetActive() function

・Wait until P0_2 output level is fully high.

・Set the P0_3 as ADC input with adc_set_se_input() function

・Start the ADC

・Set the P0_2 to low with GPIO_SetInactive() function

I want to wait until the P0_2 output becomes high level (same as the BVAT3V), before starting the ADC.

What would be the delay time to wait until P0_2 output level is fully high?

I tried to wait with the below code, but it returns the value of P0 port, which returns true.(So the condition for while loop will be false)

// Set timeout. timeout = 100; // Wait until the pin gets high or timeout is reached. while(!GPIO_GetPinStatus(GPIO_OUTPUT_PORT, GPIO_OUTPUT_PIN) && (timeout-- != 0));

3 days ago

PM_Dialog

Hi GreenTea,

You can check this by using a logic analyzer and measure the analog level of the pin.

I ran a quick test in my side and the transaction from logic 0 to logic 1 take around 100ns (see attached) which is very fast. Please verify this in your side too.

Thanks, PM_Dialog

Attachment 大小
logic_analyzer.PNG 16.27 KB

1 day ago

GreenTea 105 points

Hello

Thank you for the reply.

And thank you very much for taking your time running a quick test in your side.

It helped me a lot. I understand that the transaction is very fast.

I don't own a logic analyzer so I would verify it in my side if I get one.

Thank you