TOP Contributors

  1. MIKROE (2653 codes)
  2. Alcides Ramos (352 codes)
  3. Shawon Shahryiar (307 codes)
  4. jm_palomino (112 codes)
  5. Chisanga Mumba (90 codes)
  6. S P (73 codes)
  7. dany (71 codes)
  8. MikroBUS.NET Team (35 codes)
  9. NART SCHINACKOW (34 codes)
  10. Armstrong Subero (27 codes)

Most Downloaded

  1. Timer Calculator (136716 times)
  2. FAT32 Library (69925 times)
  3. Network Ethernet Library (55938 times)
  4. USB Device Library (46261 times)
  5. Network WiFi Library (41884 times)
  6. FT800 Library (41150 times)
  7. GSM click (28979 times)
  8. PID Library (26412 times)
  9. mikroSDK (26355 times)
  10. microSD click (25353 times)
Libstock prefers package manager

Package Manager

We strongly encourage users to use Package manager for sharing their code on Libstock website, because it boosts your efficiency and leaves the end user with no room for error. [more info]

< Back
Example

Injection System Behavior - State Machine (SM)

Rating:

0

Author: Vladimir Savić

Last Updated: 2013-07-14

Package Version: 1.0.0.1

Example: 1.0.0.0

Category: Other Codes

Downloaded: 879 times

Not followed.

License: MIT license  

This example present ability of the system modeled by SM to easily execute different tasks by injecting behavior. It is based on BYTE field transition matrix (TM) which stores information about system behavior. If we change and inject TM into the SM, system behavior is changed. This example present generic solution for state machine based systems.

No Abuse Reported

Do you want to subscribe in order to receive notifications regarding "Injection System Behavior - State Machine (SM)" changes.

Do you want to unsubscribe in order to stop receiving notifications regarding "Injection System Behavior - State Machine (SM)" changes.

Do you want to report abuse regarding "Injection System Behavior - State Machine (SM)".

  • Information
  • Comments (0)
DOWNLOAD LINK RELATED COMPILER CONTAINS
mikroC PRO for 8051
  • lib
  • src
  • exa
  • hlp
  • hex
  • sch
  • pcb
  • doc

Example Blog

Injection System Behavior

Injection System Behavior

Injection System Behavior

View full image
Transition Matrix 1

Transition Matrix 1

First system behavior injected into state machine

View full image
Transition Matrix 2

Transition Matrix 2

Second system behavior injected into state machine.

View full image
Unit test results

Unit test results

Injection System Behavior unit test results.

View full image

This simple example present ability of the system modeled by state machine to execute different tasks by injecting behavior. It is based on 8 bits field transition matrix which stores information about system behavior. If we change transition matrix, system behavior will be changed also. Current example provides only 4 states (A, B, C and D) and 4 external commands (interrupts, events or signals). This example present generic solution for all systems modeled by state machine.

Usage examples:

1) Embedded Robotics: external commands are signals from sensors: IR sensors, mechanical sensors, ultrasonic sensors and so on.
2) Human - Machine games.
3) Low level printer drivers (external commands could be sent over communication protocols: RS232, USB ...) etc.

Generally, this idea could be used for each system which includes component able to store information about states (like micro-controller unit).


This example is written in ANSI C programming language and supports all hardware platforms powered by MikroElektronika. Unit test are written in Microsoft Visual C++ x86 compiler.

For more details pleas look at transition matrix documentation and available download links.
--------------------------------------------------------------------------------------------------------------------------------------------------

Version: 1.0.0.1

Archive available for download contains two files: Behavior1.bin and Behavior2.bin
Both files are 29 bytes long and contains transition matrix - system behavior.
To inject transition matrix into system please use USART Terminal as integral part of 8051 IDE environment. Communication is done over UART lib - RS232.

Responsibility of priority encoder (CD4532) is to encode external signals regarding transition matrix encoding rules. Below scheme is related to mechanical sensor (micro switches). For analog sensors (like IR) analog to digital converter outputs should be connected to priority encoder inputs (D0...D7).

Priority Encoder

Priority Encoder

Priority Encoder with 4x keys with filtering

View full image
Priority Encoder 1

Priority Encoder 1

Priority Encoder - MCU Interfacing

View full image

ALSO FROM THIS AUTHOR

Embedded Robotics - Programmable Autonomous Vehicle

0

Embedded robotics project. Includes: High level architecture, standard DC and unipolar stepper motors, device drivers, H-Bridge electronics. Sensors electronics: micro switch, IR, Feedback motor control sensors. System software - finite state machine. Platform-Easy 8051 v6 SD Board AT89S8253

[Learn More]

Stepper Motor Controller

0

This example is related to stepper motor controller modeled by state machine. It is based on my previous example - Injection System Behavior. New version 1.0.0.2 - TM encoding modes, configurable TM priorities ...

[Learn More]

Adjustable VF Driver REV 1.0

0

VF driver stands for variable frequency driver, signal frequency can be changed in run-time. It is a signal modulation since frequency is adjustable during run-time.

[Learn More]