- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi CY Friend,
我客戶想做個1wire的通訊,要求低電平0.4us,高電平0.8us。基本就是要求頻率2M以上。
我用了AN里提到的set和clr來快速toggle GPIO,也把GPIO輸出设置成强驱动了。但是目前还是不太够。希望频率能更高。
请问有没有办法呢?
谢谢
sohie
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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