mips3000
Hello everyone, many thank's for all developer  that making the application OpenPLC available for free, this makes it possible for many to approach the world of PLC using Arduino (for example).
I'm new about plc programming, more experienced in microcontroller programming.
I've a issue with mentioned board ESP32-C3.
After modified general ESP32 configuration file ,( I just  commented line "about DAC", not present on this device) ,
OPENPLC finally work compile and upload on device ,the  example to obtain a  "LED FLASH".
Even though I modified , before compilation step the output pin (my out is on pin 20), after compilation and subsequent uplod phase,  my ESP32-C3 not blink as espected, simply on selected pin (20) i have a fast flash with low current (too little to drive correctly a LED) , and on not used  pin (21) there is a echoing signal like the one on pin 20, with correct current (I mA) parameter to drive led.
In the configuration I've designed pin 21 for output.
Thank in advance anyone who can help me.
Reply 0 0
thiagoralves
I'm not very much familiar with the ESP32 platform, but you may want to check the work done by @rhysperry111 here: https://github.com/thiagoralves/OpenPLC_Editor/pull/106
Reply 0 0
rhysperry111
Still unsure how to proceed with that PR as even though I'm confident in my work, I haven't been able to do any testing because the linker ends up giving a bunch of errors after compiling for the esp32. It's to do with the fact that I had to enable the testing version of the esp32 Arduino core to get access to a newer function in the LEDC library.
 
Not sure if you'll be able to offer any insight @thiagoralves
Reply 0 0
thiagoralves
@rhysperry111 since the main problem you're facing is with the 100% or 0% duty cycle PWM, have you thought about just modifying the PWM function to simply call a digitalWrite on 0 or 100 duty? Maybe that's a better fix (even though temporary) that will make everything work again
Reply 0 0
rhysperry111
That's a fair shout. I'll look into doing that as a temporary workaround, however it's obviously better to have an actually functional implementation that can go smoothly between very low duty cycles and completely off. The implementation I proposed also makes pin mapping a lot simpler as you just pass the board pin to the PWM controller, but that same method could also be applied to the fastpwm implementation.
Reply 0 0
Reply