Software for embedding in a system Part 1
Embedded Systems in Tamil
Software for embedding into the system
- ROM image
- Programming Languages and
- Program models
Rom Image
- Final stage software also called ROM image (Just as an image is a unique sequence and arrangement of pixels, embedded software is also a unique placement and arrangement at each ROM address of bytes for instructions and data).
![ROM Memory](https://cdn.wikitechy.com/tutorials/embedded-systems/rom-memory.gif)
ROM Memory
Final machine software
- Bytes at each address defined for creating the ROM image.
- By changing this image, the same hardware platform works differently and can be used for entirely different applications.
- Distinct ROM image in a distinct Embedded System.
- Compressed Codes and Data ROM image may alternatively be compressed software (for example, the zip format) and data.
![Final Machine Software](https://cdn.wikitechy.com/tutorials/embedded-systems/final-machine-software.gif)
Final Machine Software
Programming Languages
- Machine Language Coding :
- Programmer defines the addresses and the corresponding bytes or bits at each address.
- Used in configuring some specific physical device or subsystem like transceiver.
- Assembly Language Coding :
- It is needed for Invoking Processor.
- Specific Instructions is requiring to understanding of the processor and instruction set.
Three steps when using assembly language
- Assembler
- Linker and
- Locator
![Assembly Language](https://cdn.wikitechy.com/tutorials/embedded-systems/assembly-language.png)
Assembly Language
Assembler
![Assembler](https://cdn.wikitechy.com/tutorials/embedded-systems/assembler.gif)
Assembler
Loader
![Loader](https://cdn.wikitechy.com/tutorials/embedded-systems/loader.gif)
Loader
Programming language C or C++ or Visual
![Different Program Layer](https://cdn.wikitechy.com/tutorials/embedded-systems/different-program-layer.png)
Different Program Layer
- Application Software - Different Program Layers
- Program layers:
- Processor commands
- Main function
- Task functions and
- Library functions
- Interrupt service routines and kernel (scheduler), Compiler
- Generates an object file. Using linker and locator, the file for ROM image is created for the targeted hardware. C++ and Java are other languages used for software coding.
![Converting C into ROM Image](https://cdn.wikitechy.com/tutorials/embedded-systems/converting-c-program-into-rom-image.png)
Converting C Program into ROM Image
Program Models
![Programming Models](https://cdn.wikitechy.com/tutorials/embedded-systems/programming-models.gif)
Programming Models
Sequential programming
#include<reg51.h>
void main(void)
{
P1 = 0x00;
while(1)
{
P1 = 0xFF;
for(int i=0;I < 250;i + +); // Dummy for loop to get delay
P1 = 0x00;
for(int i=0;I < 250;i + +); // Dummy for loop to get delay
}
}
![Sequential Programming](https://cdn.wikitechy.com/tutorials/embedded-systems/sequential-programming.png)
Sequential Programming
Object Oriented Programming Model
class Program
{
static void Main(string[] args)
{
KaaShivRectangle r = new KaaShivRectangle();
r.Values();
}
}
class KaaShivRectangle
{
double length;
double width;
public void Values()
{
length = 5;
width = 4;
}
Finite State Machine for data path
class Bomb : public Fsm
{
int myTimeout; // extended state variable
public:
void initial(Event const *e); // initial pseudostate
void setting(Event const *e); // state handler
void timing(Event const *e); // state handler
void blast(Event const *e); // state handler
};
![Finite State Machine](https://cdn.wikitechy.com/tutorials/embedded-systems/finite-state-machine.png)
Finite State Machine
Multithreaded programming
![Multithreading Programming](https://cdn.wikitechy.com/tutorials/embedded-systems/multithreading-programming.png)
Multithreading Programming