PROFIBUS

Go To Last Post
28 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Has anyone successfully used Profibus with an AVR (in asm or C or anything else)
At full Profibus speed 12Mb
Using a VPC3 or a SPC3 interface chip, a TI transeiver and an ATMEGArunning at 12Mhz (SPC and VPC run at 48MHz, so devide by 4 and get 12Mhz)

I am interested in the success rate of this, and if anyone is willing to share code.

especialy the new VPC3 S spi serial interfaced chip.

12Mb comunications, and Profisafe would be good.[/b]

_________________________________

www.proficnc.com
_________________________________
Go Aussie Go!!!

Last Edited: Sat. Apr 17, 2010 - 10:27 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 1

Why asm? Why not c?

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

removed as Post 1 is fixed to reflect changes

_________________________________

www.proficnc.com
_________________________________
Go Aussie Go!!!

Last Edited: Sat. Apr 17, 2010 - 10:28 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

for many tasks speed is more critical, especialy when trying to deal with critical tasks in real time.

That's the kind of comment that starts wars around these parts! If something in a C program is ultra speed critical there may be an argument for Asm optimising that very small part of it.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Removed as post 1 reflects the changes

_________________________________

www.proficnc.com
_________________________________
Go Aussie Go!!!

Last Edited: Sat. Apr 17, 2010 - 10:30 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

You can find 187.5kbps software implementation of AVR Profibus slave at this link:
http://8515.avrfreaks.net/index....

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thankyou, that is a good start, Profibus in Automation is typicly used at 6-12Mb, I have had some devices made using the VPC3+ from profichip, but under commecial agreement the code is not public. This uses an ATmega851S running on a 48mhz crystal (through a clock devider for the AVR)
Full 12Mb Profibus...... So it can be done.
Must use a VPC, or SPC profibus chip as interface for the speed.

_________________________________

www.proficnc.com
_________________________________
Go Aussie Go!!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

< spam deleted by Plons >

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

if only my ip-zapper worked in these parts...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

what is pantangliubao ranting about?
Please keep to the topic..... I Have been asked the Profibus and AVR question by many, and thought a good discussion here would be a great place to send people....

SO....... ASM, C, or anything that works is welcome.

Please keep to topic, NO advertising courses etc.

But in the interest of full disclosure, I sell Profibus Chips and devices in Australia....All the devices on the market are designed for bulk industry, however I get many requests from small companies, and individuals that have the intelligence to design these devices, but the code for a specific communication protocol is beyond them.... So I would like to refer them here so they can make it themselves, but with the help of you guy's.... in return, I hope the benefits of Profibus can bring this forum some additional tools, and open new doors for you all.

This question comes up on the Profibus forum on a regular basis, but there are no AVR experts there (that are able to share  )

_________________________________

www.proficnc.com
_________________________________
Go Aussie Go!!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Now that you also mentions C , this might be interesting (You can prob xlate w google) , seems to be for a TI MSPxxx , but it's C , and as i read it there is no need for a "special" profibus chip. All is done in sw.
http://www.mikrocontroller.net/t...

Remember newest version is prob at the bottom , as they seem only to accept appends
http://www.mikrocontroller.net/t...

Some hw examples
http://www.see-solutions.de/proj...

/Bingo

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

http://translate.google.com.au/t...
is the google translate link.

Again 187.5K is as fast as you will get without a chip in the middle.
so please, solutions at MAX profibus bus speed are much more useful. there are not many practical uses for profibus at such a low speed.
I have source for 8051 for full speed profibus, and will provide a link to that here, but the question remains.... Full speed profibus on an avr using either the Siemens SPC3 or the ProfiChip VPC3 ASIC and an ATMega.

_________________________________

www.proficnc.com
_________________________________
Go Aussie Go!!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

proficnc wrote:
there are not many practical uses for profibus at such a low speed
I am sorry but I can not agree with this one. If you have PLC and all IO cards in one room then 12 Mbps can work, but as soon as you enter the industrial factory floor with hundreds and hudreds meters of cables for remote IO, you have to lower Profibus communication speed for all devices on the bus, and usually 187.5 kbps is the right choice. Professional equipment for Profibus troubleshooting can clearly show why (remember that Profibus is built on RS485). Also, intrinsically safe devices have speed set even lower then that, and again everything on their bus must be set to the same speed...
It is always much better to have all communication via certified Profibus chip, but software implementation also has some positive sides. Just look at how Igor Cesko created the whole new wave by beeing the first who implemented USB in AVR ASM, and now there are hundreds of projects based on V-USB from ObDev who have made it available to wider audience by reimplementing the same in C (with some ASM core hidden from the average user), and making it more general with some nice USB start up examples.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
as soon as you enter the industrial factory floor with hundreds and hundreds meters of cables for remote IO, you have to lower Profibus communication speed for all devices on the bus, and usually 187.5 kbps is the right choice

As someone who deploys Full Speed Profisafe networks in Noisy environments (Laser and Plasma Systems, and Production lines) I know what is required to get a full speed system to work, day in, day out. Any engineer who has told you that 187.5 is a "good choice" is just taking the lazy way out.

I have seen a 1.5Mb system work using a farm fence over 200 meters as the cable as a demonstration of this.

187.5 is used for MPI bus which is a variation on Profibus by Siemens, It is also available at 1.5Mb. Newer Siemens Control systems do not recommend this speed.

If 12Mb is unnecessary due to the complete nature of a system, then it is unnecessary, however, a well designed device should work in any environment, so if it can run at the 12Mb, there is no risk in the slower systems.

_________________________________

www.proficnc.com
_________________________________
Go Aussie Go!!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Any engineer who has told you that 187.5 is a "good choice" is just taking the lazy way out.
How did you get this? You have wrong interpetation of my words. Read them again. If you connected all devices on the bus at high speed and talk to them, it doesn't mean that you will always be able to talk to them at that speed reliably in industrial noisy environment. If you have professional tools that show you how many errors are in Profibus communication, they can usually make various reports and diagrams with some recommendations how to improve it if needed. You then decide if that is acceptable or you have to lower your communication speed (to whatever value does the job well). You can also catch if cable people did their job well. They were supposed to do the checking on their side and print reports as a proof that bus specification comply to the project, but nothing stops you from doing it if you have the tools :-)
Quote:
I have seen a 1.5Mb system work using a farm fence over 200 meters as the cable as a demonstration of this.
You have seen, but I have implemented and maintained Profibus PLC and SCADA systems in more then 20 factories, with biggest having 7 redundant S7400H PLCs and kilometers of standard and optical Profibus networks. I was also called many times to correct design errors of other people, and putting repeater or lowering bus speed was a reliability fix more then once.
Quote:
187.5 is used for MPI bus which is a variation on Profibus by Siemens, It is also available at 1.5Mb.
I am more then aware of similarities and differences between MPI and Profibus, and I had to be aware since I had to write software that reads/writes to Simatic PLC on both, and which runs on Windows and Linux. Here is a proof that 187.5 is also used in Profibus (and has been used at least for last 7 years that I am dealing with it). It is a copy of available transmission rates from network configuration of one of PROFIBUS communication channels from NetPro in Step7: 9.6 Kbps, 19.2 Kpbs, 45.45 (31.2) Kbps, 93.75 Kbps, 187.5 Kpbs, 500 Kbps, 1.5 Mbps, 3 Mbps, 6 Mbps, 12 Mbps. If MPI fits your needs, and first two low speeds are enough (which is rare), and you know low level protocol, then you don't need any special card to connect your laptop (or embedded linux board) to device and read/write data. So, appliances for even lower speeds then 187.5 do exist.

I really don't know how this discussion turned into who's right and who's wrong. I am very sorry for this and I deeply apologize if I was a trigger. I was just saying that 187.5Kbps Profibus implemented in software has potential, and that it's nice to have it as an option besides "the real thing". Here are my words:

Quote:
It is always much better to have all communication via certified Profibus chip, but software implementation also has some positive sides.

I do apologize once again, and I promise to try to beat my ego and not answer any further discussion in the wrong direction.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Clearly from your comments, you are a Siemens service engineer? I am not questioning you ability as such.

and I think we are agreeing on 1 thing,

Quote:
You can also catch if cable people did their job well. They were supposed to do the checking on their side and print reports as a proof that bus specification comply to the project, but nothing stops you from doing it if you have the tools

to correct bus installation, reducing speed is 1 option, My intention for this post was not to have an argument with anyone on the details of an installation method, so also apologise to you also.

My point was purely, that the device should handle all required speeds regardless of if it will be used that way in the field, and we will both hope that all installation engineers CORRECTLY run the cables, or use fibre on the long runs.

If you notice, I am not saying reducing bus speed is bad, but if a DESIGN Engineer does this from the beginning, then he has left himself nowhere to go.

I have been deploying Profibus, and servicing it for a long time now, And the only times have had to permanently reduce bus speed where when the incorrect cables have been run, and changing them is not a viable option.

Quote:
putting repeater or lowering bus speed was a reliability fix more than once.

if the Bus is installed by the Guidelines, then repeaters in long runs are the correct option. However, I understand that when servicing a system, modifying a network by adding components is not always a possibility.

Please keep in mind, that if Safety is involved, fix the bad system, as adjusting bus speed will have a potential negative effect on the certification of a Profisafe system.

_________________________________

www.proficnc.com
_________________________________
Go Aussie Go!!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

https://www.avrfreaks.net/index.php?module=Freaks%20Academy&func=viewItem&item_type=project&item_id=2587

here is the link to the project That I have set up. It contains the 8051 files, and a project for the AVR. for anyone wishing to use the AVR and Profibus feel free to use these as a starting point. These files are provided by ProfiChip with permission. if you wish to use these files for commercial purposes, please contact me first. thanks.

_________________________________

www.proficnc.com
_________________________________
Go Aussie Go!!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I bet if you sent out a kit with two of the 24mhz 12mbps ti chips and issue the challenge to any Sierra Hotel c programmer that 'No One can write a program that will send this XX byte packet in a loop YY times in ZZ seconds to the other node' and stand back. You would have a commercial product and a contract programmer.

Imagecraft compiler user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Several years ago I read the first article about bitbanging USB on an avr (@1.5MBit/s) and thought it was really amazing. The guy who wrote that code was also experimenting with bitbanging Ethernet (@10Mbp/s) on an AVR. I believe his name was Boris .... Just recently I had a peek at Atmel's application note about bitbanging USB and I think it is derived from his code.

You already seem to have the protocol working. Only need to pump up the bit rates.

Maybe you'll find something usefull in exploring in that direction.

Gr, P.

Doing magic with a USD 7 Logic Analyser: https://www.avrfreaks.net/comment/2421756#comment-2421756

Bunch of old projects with AVR's: http://www.hoevendesign.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:

I believe his name was Boris

Try "Igor" - ("Igor Cesko")

(and yes the app note is from his code - these days there is of course V-USB which is something very similar)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I see that the Profibus project I posted has been downloaded 132 times, Has anyone actually used it? If so, please comment here and let us know how you went with your project
Thank
Philip

_________________________________

www.proficnc.com
_________________________________
Go Aussie Go!!!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The original link for AVR ASM with up to 187.5Kbps profibus slave in software no longer works, so here is the new one:
http://web.archive.org/web/20070...

and here is the same thing in C:
http://www.mikrocontroller.net/a...
http://www.mikrocontroller.net/t...

My guess is that speed could go up to 1.5Mbps if someone adapts the source for XMEGA.

Enjoy! :wink:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I know this is a very old thread but is there anyone that made it work on an Arduino Mega2560 or 328?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I have been trying but not very well. Profibus has been taking a backseat to Profinet which is simply ethernet. Which can be done on a mega 328 with a wizner shield

Jim

Edit: the interface chip for profibus is also a pain in the a$$ to get and is not cheap.

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

Last Edited: Tue. Aug 13, 2019 - 01:32 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yeah I know about profinet and a bunch of "hacks" using arduino the thing is I would need a router to interface with a bunch of slave modules troughout the house so profibus is the choice. I'm going to try it with a mega8 (it seems that avfSoftBus.rar is a ported version for the mega8)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I made managed to get it working on an Mega2560.. Try it..
https://forum.arduino.cc/index.php?PHPSESSID=2qo4p5mofhn24s9g04no22mh62&topic=632405.0

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks!!!  I will certainly take this for a spin!

 

Jim

I would rather attempt something great and fail, than attempt nothing and succeed - Fortune Cookie

 

"The critical shortage here is not stuff, but time." - Johan Ekdahl

 

"Step N is required before you can do step N+1!" - ka7ehk

 

"If you want a career with a known path - become an undertaker. Dead people don't sue!" - Kartman

"Why is there a "Highway to Hell" and only a "Stairway to Heaven"? A prediction of the expected traffic load?"  - Lee "theusch"

 

Speak sweetly. It makes your words easier to digest when at a later date you have to eat them ;-)  - Source Unknown

Please Read: Code-of-Conduct

Atmel Studio6.2/AS7, DipTrace, Quartus, MPLAB, RSLogix user

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Max speed is 45.45k I think that is enough.. See header file for detsuls.. It could easly be adapted to a mega328 but you loose the only uart that it has...

Hope it helps :)