Monday 27 June 2016

Embedded system Architecture

Embedded system used in different application generally handles multiple tasks, interfacing with different sensors, actuators and different on board peripherals. In some application it also required to communicate with multiple processors in real time domain. Embedded system based project also used in the application where communication with external environment required. Communication may be wired or wireless, GPRS communication, Wi-Fi communication or Bluetooth communication.
Embedded software architecture should in manner that it should properly execute tasks such as communication with the interfaced devices, data sharing task with different modules, proper execution of interrupt service routine with latency required, and communication with network system.
Embedded software architecture designed in such a way that same architecture should be reused in future for decrease development time. In this case the initial development time will large and it require extra efforts to develop such architecture. Software developer may first develop the software according to client’s requirement and then convert it to modules which can be reused for future. Or they can give extra effort initially to developed software architecture in a manner that it can be used for future.
Main function of embedded software is to take data from the external word through Input pins and Input modules, performs operation on the data and gives output to user through output pins and Modules. It also takes care of data sharing between modules such that calculation result does not change due to hardware or software interrupt.
For example we take the example of simple calculator. User gives the input through key board and tells which operation to be performed on the data. Microcontroller displays the input data on the LCD and performed required operation on data and displays the result on the LCD.
Software Architecture Example
Software architecture can be in the form of polling method. In this method software always execute in the main routine. There will be no interrupt execution. In main routine software will poll from every module. If any module requires service then processor will give services to that module and then go in that manner. If the latency of event is high module can be inserted more than one time in the routine.
Another scenario can be in the form of interrupt control base execution. The image below gives the description of interrupt base software architecture:

As shown in figure above all execution will be done in the main routine. There will be a Timer ISR routine that will monitor the operation counter. Every time when timer ISR occurs Operation_Counter incremented by one.  In main routine there is switch statement that will execute the task according to Operation_counter Value.

If any task redundancy is large than this talk can be executed more than one time in a cycle. Here perform_operation1 is executed regularly.

In the last case “case n” Operation_Counter value becomes zero and next cycle will be start again from case 1.

In future if programmer wants to add some new module then module can be added easily according to execution redundancy of module. One thing to be monitored here that operation execution time in every case should not exceed the timer over flow time. If in any case operation execution time exceeds then try to break this execution in two steps.




No comments:

Post a Comment