Fast all is in the tittle... As explained here: https://raspi.tv/2013/rpi-gpio-basics-6-using-inputs-and-outputs-together-with-rpi-gpio-pull-ups-and-pull-downs it is possible to enable pull-ups and pull-downs internal resistor of a Raspberry.
How can I achieve this with Codesys ?
Many thanks for your answers.
Hi, the setting has to be done outside of CoDeSys. Preferrably at boot time so all pins you want to use as outputs are initialized with the desired level at boot time.
Here are a few links.
I have successfully used the method with modifying dt_blob.bin but there seem to be other ways too.
Many thanks for your reply. Far too complicated for me! I will simply put external pull up / pull down resistors ! :-D
I believe you should be able to achieve this inside of CoDeSys.
1) Find this file /etc/CODESYSControl_User.cfg and add the following to it:
2) In your project, add the SysProcess library in Library Manager and execute the following command (example to set pin 18 to pull-up):
SysProcess.SysProcessExecuteCommand2(pszCommand := 'gpio -g mode 18 up');
Another example to set it as output:
SysProcess.SysProcessExecuteCommand2(pszCommand := 'gpio -1 mode 18 out');
Log in to post a comment.