Welcome to our new forum
All users of the legacy CODESYS Forums, please create a new account at account.codesys.com. But make sure to use the same E-Mail address as in the old Forum. Then your posts will be matched. Close

Very short pulse out

lucaver89
2019-10-16
2019-10-18
  • lucaver89 - 2019-10-16

    Hello to All,

    from gpio number 23 of my raspberry pi 3 I have to generate a impulsive clock by 50 uSend. I have a couples of ideas to do it, but unfortunatly I don't know which is the best way. The first idea is using a simple TP timer with preset time at 50uS. The second one is set a new task with cycle time at 50 uS.
    Could anyone help me please?

    Thank you
    luca

     
  • dFx

    dFx - 2019-10-17

    50Β΅s is extremely short for a PLC system (expected cycle times are generally tens of ms). Be sure your hardware can handle it.

    My bet would be a separate task with top priority with only refreshing your I/O value (ex: out := NOT out;).
    Don't forget to set the correct refresh to your I/O also.

     
  • lucaver89 - 2019-10-18

    Thank you for your answer.

    I'm thinking to use a microcontroller to module the pwm for AC loads.

    Thanks
    Luca

     
  • dFx

    dFx - 2019-10-18

    To module PWM AC loads we usually make use of triac. Some can be controlled by bus, other by analog output and some by digital input.

    Does your spec about GPIOs refresh rate and output commutation rate are within 50Β΅s ?

     
  • lucaver89 - 2019-10-18

    Hi,

    The GPIO is made by a MCP23017 with i2c bus. If I remember well that's frequency rate is 100KHz for the pic microchip. I realy don't know if the i2c of the raspberry py works with the same frequency.

    Thanks
    Luca

     

Log in to post a comment.