How to simulate input and output pins of microcontroller

192 views
Skip to first unread message

zaman ahmad

unread,
Jun 5, 2015, 9:06:03 AM6/5/15
to omn...@googlegroups.com
I want to simulate microcontroller in omnet++. It should have digital input and output pins. Can I use input output gate as single bit value?

Michael Kirsche

unread,
Jun 8, 2015, 6:37:07 AM6/8/15
to omn...@googlegroups.com
What's your aim in using OMNeT for uC simulation?
There are various simulators available for microcontrollers, ranging from microinstruction-capable simulators to circuit design layout simulators.
What do you want to achieve by using OMNeT specifically?

zaman ahmad

unread,
Jun 8, 2015, 7:57:22 AM6/8/15
to omn...@googlegroups.com
I am trying to simulate SCADA Systems. PLC is essential component of SCADA systems. It contain ethernet ports, serial ports and input-output pins. These IO pins are similar to microController pins.


Michael Kirsche

unread,
Jun 8, 2015, 8:33:37 AM6/8/15
to omn...@googlegroups.com
I guess you want to create a compound module for your PLC then, consisting of various submodules (Ethernet ports, serial ports and input/output pins). The input/output pins will then be simple modules with whatever function they have, connected over gates to other modules inside the PLC compound module. The messages that are transmitted between these modules represent the data, in your case those single bit values that shall be passed along the input/output pins.

Have you checked for available SCADA models for OMNET?
This survey indicates that there exist some: http://conf-scoop.org/ACE-2013/6_Kostas_ACE.pdf

zaman ahmad

unread,
Jun 8, 2015, 9:07:06 AM6/8/15
to omn...@googlegroups.com
Yes you are right. But problem is that message has its own data structure even if I define my own data structure I don't think it will be single bit. Do you think that simple module will serve the purpose for input/output submodule.
I have seen other models as well. They only implemented netowrk part. I also wanted to implement behavior based on input/output pins.

Michael Kirsche

unread,
Jun 8, 2015, 9:35:14 AM6/8/15
to omn...@googlegroups.com
The data structure of the message is (of course) different than the actual content, as OMNeT needs additional fields and operators to work with the message.
If you are planing on creating a solely OMNeT-based SCADA simulation, then use OMNeT's messages and fill them with the data that you want to exchange (unsigned char as bit fields for example).

Simple modules serve every purpose, as they are the only ones that contain actual source code.
So your complex PLC module will consist of various simple modules. The actual source code of the singles simple modules can then cover things like behavior based on input pins etc.

zaman ahmad

unread,
Jun 8, 2015, 10:31:33 AM6/8/15
to omn...@googlegroups.com
Thanks for helping

Alfonso Ariza Quintana

unread,
Jun 8, 2015, 11:18:10 AM6/8/15
to omn...@googlegroups.com

In reality you don’t need simulate a GPIO, you only need a module with control variables (bool) that simulate the state of the GPIO. You can use a standard protocol to communicate from the Scada system with the I/O module.

We have worked with Stellaris cortex M-4 http://www.ti.com/tool/ek-tm4c1294xl?DCMP=PPC_Google_TI&k_clickid=56e9ab05-5f42-5368-c260-000006e31b1f. The server communicates and sends orders to the microcontroller unit using standard TCP/IP messages, we have defined a very simple protocol that allows to send orders to the microcontroller and read the status. The microcontroller can be seen like a “black-box” from the point of view of the simulation, you don’t need to model it.

--
You received this message because you are subscribed to the Google Groups "OMNeT++ Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to omnetpp+u...@googlegroups.com.
Visit this group at http://groups.google.com/group/omnetpp.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages