gpio turn on or turn off time graph.

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

cross mob
Erka_3237036
Level 3
Level 3
5 likes given First like received First like given

Hello all,

i have facing one problem.

a problem is my one gpio pin is turning off and same time my second gpio is turning on but both have some time difference i.e.

Gpio1 is taking the 1.4 Micro Second to turn off

and Gpio2 is Taking the 800 Nano Second. to turn on

i don't know why it is Happening ?

anybody can suggest why it is happening and how can i solve this problem.

i am using LP-035  controller.

Best Regards,

Seggi

0 Likes
1 Solution
odissey1
Level 9
Level 9
First comment on KBA 1000 replies posted 750 replies posted

Seggi,

If code is the same, the time should be same. There is some difference in the code. Please post your project here: (1) Build->Clean, (2) File->Create Workspace Bundle->Minimal. (3) In created Archive you may delete a folder Generated_source to reduce the size.

Generally, Pin_Write(1) API is rather slow and takes almost a microsecond, but there are faster ways to accomplish that. Please check this video:

C++ vs Assembly vs Verilog. on Vimeo

On PSoC5 the following code should set Pin_1 to 1/0 in a single BUS_CLOCK (Compiler optimization = speed, release mode)

for(;;)

    {

        Pin_1_DR = 1 << Pin_1_SHIFT; // shif=1u

        Pin_1_DR = 0 << Pin_1_SHIFT;

    }

/odissey1

View solution in original post

0 Likes
16 Replies