PSOC4 FAST GPIO

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

cross mob
Sophie_Wang
Level 4
Level 4
Distributor - Zenitron(GC)
25 replies posted 10 replies posted 5 replies posted

Hi CY Friend,

我客戶想做個1wire的通訊,要求低電平0.4us,高電平0.8us。基本就是要求頻率2M以上。

我用了AN里提到的set和clr來快速toggle GPIO,也把GPIO輸出设置成强驱动了。但是目前还是不太够。希望频率能更高。

请问有没有办法呢?

谢谢

sohie

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

Bit-banging a GPIO is not a good solution because timing will vary with optimization and does not allow for interrupts.

I would suggest a solution with two Timers running at same period with different compare values, a mux to select the long or short pulse and a  shift register to select the bit to transmit. Some glue logic might be required.

The hardware solution frees a lot of CPU time that can be used to handle different tasks.

Happy coding

Bob

View solution in original post

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

Bit-banging a GPIO is not a good solution because timing will vary with optimization and does not allow for interrupts.

I would suggest a solution with two Timers running at same period with different compare values, a mux to select the long or short pulse and a  shift register to select the bit to transmit. Some glue logic might be required.

The hardware solution frees a lot of CPU time that can be used to handle different tasks.

Happy coding

Bob

0 Likes