You are on page 1of 11

1-What is an embedded system?

An embedded system is not a microprocessor used in a traditional computing application desktop laptop workstation An embedded system is a microprocessor used as a component in another piece of technology cell phone digital camera

2- Classes of embedded systems


According to the application: Personal environment Home environment Robotics Intelligent Infrastructures According to the way of work: Reactive systems Interactive systems Transformation systems

3-Software for ES?


Super Loop Interrupt controlled Cooperative multitasking Preemptive multitasking Microkernels and exokernels Monolithic kernels

5-Programming in
The files are organized as source or header files. The latter consists of declarations and the former definitions and code. Header files: #include <stdio.h>

#include test.h Main start (input) point: void main(void) int main(int argc, char * argv[ ])

6- C preprocessor
#include includes the specified file #define Conditional compiling - #ifdef, #ifndef, #else, ... Macros #define MUL10(x) (10 * (x))

7-Endless loop and Delay


Loop with counter for(;;) { }; Loop with pre-condition while(1) { }; Loop with post-condition do { } while(0); Software Delay void delay1 (int howmuch) { long int cycles; const int cycleTime = 200; cycles = howmuch*cycleTime; while(cycles--); } void delay2 (int howmuch) { int i,j; for(i=0; i < howmuch; i++) j*j; }

8- Initialisation and Start-Up

9-Toolchain
In software, a toolchain is the set of programming tools that are used to create a product (typically another computer program or system of programs). A simple software development toolchain consists of a text editor for editing source code, a compiler, an assembler and a linker to transform the source code into an executable program, libraries to provide interfaces to the operating system, and a debugger. The GNU toolchain for example contains a compiler, linker, debugger and build tools.

Build Process: The build process is a critical element for all software development projects. Do not be tempted to get by without one particularly in a team development environment.

10- Compiling:A computer can understand instructions written in a specific


machine dependent format, which unfortunately are very cryptic to be written directly. So we use more human readable languages to instruct it. But before the computer can actually use it, it need to be converted to that cryptic codes that the machine understands. This process is called compilation and is done by compilers. Linking: Linking refers to the creation of a single executable file from multiple object files. In this step, it is common that the linker will complain about undefined functions (commonly, main itself). During compilation, if the compiler could not find the definition for a particular function, it would just assume that the function was defined in another file. If this isn't the case, there's no way the compiler would know - it doesn't look at the contents of more than one file at a time. The linker, on the other hand, may look at multiple files and try to find references for the functions that weren't mentioned. Builgind: ????????????

11-Starting executable files ?

12-Data Types: In computer science and computer programming, a data type


or simply type is a classification identifying one of various types of data, such as realvalued, integer or Boolean, that determines the possible values for that type; the operations that can be done on values of that type; the meaning of the data; and the way values of that type can be stored. Common data types may include:

integers, booleans, characters,

floating-point numbers, alphanumeric strings.

Data type modifiers Size modifiers short, long Sign modifiers unsigned, signed Special static, extern, const volatile, register const volatile 5. Storage class 6. Pointer modifier 7. Function modifier 8. Interrupt

13- Memory Map


/**************************************** ******* Memory Map * Base Address Size Description * -------------- ----- ----------------------------* 0000:0000h 128K SRAM * 2000:0000h Unused * 7000:0000h Registers * 7000:1000h Interrupt Acknowledge * 7000:2000h Unused * C000:0000h 128K Flash * E000:0000h 128K EPROM ****************************************/ #define SRAM_BASE (void *) 0x00000000 #define SCC_BASE (void *) 0x70000000

#define SCC_INTACK (void *) 0x70001000 #define FLASH_BASE (void *) 0xC0000000 #define EPROM_BASE (void *) 0xE0000000

14-Assensing I/O
Input / Output Addressing I/O with macros and pointers Making pin HIGH PADDR |= 0x0A Making bit LOW PADDR &= 0xF5 PADDR &= ~0x0A Testing bit STATE (PADDR & 0x03 == 0x03) ? state=1 : state=0; Bit-fields struct _bitfield { unsigned flagA : 1; unsigned flagB : 1; unsigned flagC : 2; unsigned nybbA : 4; unsigned byteA : 8; } x; x.flagA = 1; x.flagB = 0; x.flagC = 2; // b'10' x.nybbA = 100; // It actually writes 0x04 x.byteA = 0xfff; // It actually writes 0x3ff

15- Peripheral Drivers


Status and Control registers; Device Driver Interface to status and control registers; Variables for monitoring the devices state; Initialisation procedure take the device to known state; API for working with the device; Interrupt Service Routines.

16- Interrupts
Used for signalling the proccessor for a event; Allow prioritisation of events` service; Peripheral devices; Error handling and recovery; Timers. They are serviced by a special routines ISR; Types of Interrups: Hardware or Software; Maskable or Non-maskable.

17-Memory Testing
Testing the data bus we test writing and subsecuent read from a random address. Testing the address bus checking wether different addresses overlap or not. Testing the memory chip writing '0' then '1' in every memory cell (address).

18- Embedded Systems Design

This is the Code&Fix realization with early separation of the software and hardware design. At every step a prototype is produced and is tested to the specification. The problem is the synchronization between the teams integration engineers should work with every team at every step.

19- Code & Fix


This method defines demo implementation of the first user requirements and then modification step by step till the user is satisfied. Problems: There are no signed specifications and milestones; A little change in specification lead to complete re-writing of the code; Design errors and problems can be found after the end of the implementation;

Difficult to follow the changes in the design and implementation.

20- V-model
This is teh solution to the problems in the Code & Fix Defines 3 main parts design, implementation, testing. Design is made from System level to Module level. At every step the test vectors are defined and the expected results. First the system is designed, then the software components, then the hardware. It allows a new V-model to be defined for the subsystems for each software and hardware component. V-Model: Verification Requirements analysis System Design Architecture Design Module Design V-Model: Validation Unit Testing Integration Testing System Testing User Acceptance Testing Release Testing

21- Hardware-Software CoDesign?


The Co-Design allows a functional and behavioral designing of the hardware and software at the same time. In embedded systems the most of the software functions depend on the hardware behavior or external stimulus.

You might also like