Unit 4
Marking System
Unit IV (10 questions )
8 questions one mark (Theory)
2 questions two marks (Code snippets)
Total Marks : 12
Introduction to Android
Android Applications
Android Framework
Libraries
Dalvik Runtime
Linux Kernal
Core Libraries
13
Embedded ‘C’
What is Embedded System
Characteristics of an Embedded System
Basic Structure of an Embedded System
Processors in a System
A processor has two essential units −
Types of Processors
Processors can be of the following categories −
Processors in a System
Features of 8051 Microcontroller
Black diagram 8051 Microcontroller
8051 Microcontroller
What is Embedded ‘C’
Whenever the conventional ‘C’ language and its extensions are used for programming embedded system, it is referred to as “Embedded C” programming .
��Why ‘C’ for Embedded system��
��Sample Embedded C program��
#include “16F877A.h”
void main()
{
int x;
x=input _A();
output_B(x);
}
Input from Port A
Out data x to Port B
��Sample Embedded C program��
#include “16F877A.h”
void main()
{
int x;
for(x=1;x<=10;x++)
{
output_B(x);
delay_ms(100);
}
}
Delay for 100 milliseconds
��Sample Embedded C program��
��Sample Embedded C program��
Functions provide in MPLAB toolkit
Sr. No. | Library Function | Operation |
1. | delay_us(x) | Generate a delay of ‘x’ microseconds |
2. | delay_ms(x) | Generate a delay of ‘x’ milliseconds |
3. | output_p(x) | Outputs the parameter ‘x’ to port specified by ‘p’ |
4. | output_high(PIN_P0) | Sets Pin ‘P0’ to logical ‘1’ (High) |
5. | output_low(PIN_P0) | Resets or clear Pin ‘P0’ to logical ‘0’ (Low) |
6. | input_x() | Returns the value on input port ‘x’ |
7. | input(PIN_px) | Returns value of ‘x’ pin of the ‘p’ port. |
Interfacing Stepper Motor with 8051
H-bridge for motor driving
Full Step Sequence
Full Step Sequence
Full Drive Stepping Sequence | ||||
Step | A | B | C | D |
1 | 1 | 1 | 0 | 0 |
2 | 0 | 1 | 1 | 0 |
3 | 0 | 0 | 1 | 1 |
4 | 1 | 0 | 0 | 1 |
�
Keil C Code for Full Drive
#include<reg52.h>
#include<stdio.h>
void delay(int);
void main()
{
do
{
P2 = 0x03; //0011
delay(1000);
P2 = 0x06; //0110
delay(1000);
P2 = 0x0C; //1100
delay(1000);
P2 = 0x09; //1001
delay(1000);
}
while(1);
}
void delay(int k)
{
int i,j;
for(i=0;i<k;i++)
{
for(j=0;j<100;j++)
{}
}
}