cancel
Showing results for 
Search instead for 
Did you mean: 

PSoC 4 MCU

New Contributor II

Hi CY Friend,

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

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

请问有没有办法呢?

谢谢

sohie

0 Likes
Reply
1 Solution
Esteemed Contributor II

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
Reply
1 Reply
Esteemed Contributor II

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
Reply