davenardella
Hi all,
I made the port for Arduino GIGA R1 WIFI.
 
"port" is a big term 😃, given that, thanks to the modular structure of OpenPLC, it was sufficient to insert an item in hals.json and write two lines of cpp.

I hooked the builtin LED to an output, this way it is possible to test everything without connecting additional hardware.
However, you can find everything here, instructions, pinouts and download tips (which sometimes drives you crazy with GIGA).
 
Good fun 😉
Reply 2 0
thiagoralves
That's awesome @davenardella !! Could you make a PR with your changes please? Then your code will be part of the official release and everyone will automatically benefit from it.
Reply 1 0
davenardella
Certain,
I don't know how to work with Git 😌 (my fault), now I try to learn and do a PR 😉
Reply 0 0
davenardella
Done (I hope 😃), let me know...
Reply 2 0
ThiagoC
Hello guys, mind if I ask a question here?😌
I followed the instructions on github and managed to use the arduino giga with the openplc. It works well but crashes (red light blinking) when the Enable Modbus RTU (Serial) is selected. My question is, wouldn't it be possible to use Modbus RTU with Arduino Giga? 
Reply 0 0
thiagoralves
Most likely something is not right on the Serial code. The code uses Arduino API and should be generic to just work on all boards, but that doesn’t seem to be the case on the Giga. Since I don’t have a board, I don’t know how to fix it
Reply 0 0
ThiagoC
Thank you @ThiagoAlves. I believe Arduino Giga is a significant feature for OpenPLC due to its 12-bit analog output resolution. Maybe @davenardella has some clues on how to make Modbus RTU or TCP work?
Reply 0 0
thiagoralves
Modbus TCP should work just fine. Isn't it working? 
Reply 0 0
davenardella
Found,
I have to investigate the exact reason, the offending function was mapEmptyBuffers(); in Baremetal.ino which doesnt't like the Analog outputs associated to RGB led.
 
To overcome the problem, simply modify the I/O config, deleting the last 3 Analog Outputs:
 
From:
 
[203128%2F8774857%2Fmceclip0]
 
To:
 
[203128%2F8774866%2Fmceclip0]
 
After that you can enable Modbus, both RTU and/or TCP.
 
[203128%2F8774869%2Fmceclip0]
Reply 1 0
thiagoralves
Good catch @davenardella !
Perhaps while this isn't working, maybe it would be better to just remove the RGB leds from the list of IO on the driver's JSON, right?
Reply 1 0
ThiagoC
Thank you @ThiagoAlves and @davenardella! It seems to be working fine now. I also suggest removing the last Digital Output (pin 87 in the list). For some reason, it causes the green led to turn on when modbus is enabled. 
Reply 0 0
Reply