Arduino porofibus

Hello everyone!

I have been searching for a Profibus slave Arduino device for a while now. And there is absolutely nothing out there...

I did come across this thread (in German) that some guys over there made a woking example. But it runs on a MSP430F2252

https://www.mikrocontroller.net/topic/106174

Anyway I decided to adapt the program to run on a Arduino and it works on a Mega2560 it can easily be adapted to other MCUs but that is up to you

I decided to share this because there is nothing useful out there and I really hope this can help someone..

All of the description is in the .h file and the GSD file is also itn the zip.

I am not an expert on the Profibus protocol so I can't help you with that but you can find alot of info on the link I provided above (google translate is your friend :slight_smile: )
I ported the code for a friend who is an expert with Siemens devices so he was the one setting up the PLC.

The speeds are low ( again see the .h file) but it works for hobby and home projects :slight_smile:
We got it working to 45.45K baud and I think that is enough. If you want to go above that you would probably need a faster MCU (Teensy?)

Anyway hope I helped someone :wink:

Please leave a comment if you got it working

EDIT: It was tested on an S7-315 :slight_smile:

profibus_ArduinoMega2560.zip (10.7 KB)

Hi Tady, great work you have it here. I'm trying to implement your code, but there are few things that kept me stuck.

  1. How do you wire Arduino with MAX485?
  2. Could please gave me example how to use the code above, like a simple write to an address in PLC?

I'm greatly in need of your advice. Thank you