1 Reply Latest reply on Jan 10, 2020 5:32 AM by JoMe_264151

    PSOC4 FAST GPIO

    user_264721

      Hi CY Friend,

       

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

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

      请问有没有办法呢?

       

      谢谢

      sohie

        • 1. Re: PSOC4 FAST GPIO
          JoMe_264151

          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