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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
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
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.
Thank you for your answer.
I'm thinking to use a microcontroller to module the pwm for AC loads.
Thanks
Luca
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 ?
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