Toggling a pin in less time than 1Us

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

cross mob
AnRa_1522781
Level 2
Level 2

Hi

   

I am toggling a pin continuously with Delay between toggling around 1us using the function CyDelayUs.

   

Is there a way to toggle the ping faster than 1us? or in other words how do I create a delay less than 1us?

   

regards

0 Likes
1 Reply
Bob_Marlowe
Level 10
Level 10
First like given 50 questions asked 10 questions asked

Toggling a pin by CPU is a bit (or byte) old-fashioned. You are burning MIPS and there is no time for controlling or other things.

   

Better use a PWM, feed it with 12 MHz and you can get an output with 1MHz frequency that is controllable in duty cycle and frequency with just a little effort.

   

That's PSoC

   

 

   

Bob

0 Likes