Professional Documents
Culture Documents
The mbed Microcontrollers provide experienced embedded developers a powerful and productive
platform for building proof-of-concepts. For developers new to 32-bit microcontrollers, mbed provides an
accessible prototyping solution to get projects built with the backing of libraries, resources and support
shared in the mbed community.
Features
Prototyping form-factor
o 40-pin 0.1" pitch DIP package, 54x26mm
o 5V USB, 4.5-9V supply or 2.4-3.3V battery
o Built-in USB drag 'n' drop FLASH programmer
RESULT :
Thus the study of ARM Evaluation is completed.
APPARATUS REQUIED
1. NXP LPC11U24
2. Computer with keil uvision4 software.
3. potentiometer
4. general purpose board.
5. jumper wires.
THEORY
A potentiometer is a variable resistor used to divide the applied signal across it into discrete
voltage levels using an attached rotating shaft. The shaft makes electrical contact with a carbon-based ring
upon variable resistance that occurs during rotation. The change in resistance affects the applied signal
(voltage).
PROCEDURE
1. NXP LPC11U24 ARM Cortex-M0 board is placed in the general purpose board .
2. Supply and Ground are connected to the potentiometer and variable end of a potentiometer is
connected to the analog pin of a M0 board.
3.Using keil uvision analog to digital c program was compiled and bin file is generated .
4. Bin file is transferred to ARM M0 board.
5. Observe the respective digital voltage values in LCD by varying the potentiometer .
PROGRAM
//Connect p20 through p27 lpc11u24 with DB0 through DB7 of lcd display
//Enable pin of lcd to pin 30
//RS pin of lcd to pin 29
//R/W pin of lcd to GROUND
//Potentiometer to pin 19
#include "mbed.h"
AnalogIn pot(p19);
DigitalOut en(p30);
DigitalOut rs(p29);
BusOut data(p20,p21,p22,p23,p24,p25,p26,p27);
void lcdCommand(int cmd){
rs = 0;
data = cmd;
en = 1;
en = 0;
wait(.01);
}
void lcdData(int character){
rs = 1;
data = character;
en = 1;
en = 0;
wait(.01);
}
void lcdWriteText(char *line1,char *line2=""){
lcdCommand(0x80);
while(*line1)
lcdData(*line1++);
lcdCommand(0xc0);
while(*line2)
lcdData(*line2++);
INPUT
ANALOG VALUE
(Mutimeter)
GND
OUTPUT
DIGITAL VALUE
(LCD value)
0
RESULT
Thus the Conversion of Analog to Digital is performed and verified with ARM processor
successfully
PROCEDURE
1. NXP LPC11U24 ARM Cortex-M0 board is placed in the general purpose board .
2. LED is connected to the digital pin of ARM M0 Board.
3.Using keil uvision LED c program was compiled and .bin file is generated .
4. Bin file is transferred to ARM M0 board.
5. Observe the LED ON and OFF like blinking led.
PROGRAM
#include "mbed.h"
// Header file
int main()
// Program start
{
while(1)
{
led1 = !led1; // NOT Function, 1 ON , 0 - OFF
wait(0.2); // 200ms delay
led1 = !led1;
wait(0.2);
}}
RESULT
Thus the interfacing of LED with ARM processor is done successfully.
PROCEDURE
1. NXP LPC11U24 ARM Cortex-M0 board is placed in the general purpose board .
2. LED is connected to the digital pin of ARM M0 Board.
3.Using keil uvision LED c program was compiled and .bin file is generated .
4. Bin file is transferred to ARM M0 board.
5. PWM pulse width modulation is the technique behind signal generation PWM will be used in the
application of waveform generation by changing the width of the waveform the intensity of the LED
is controlled. observe the LED ON and OFF with varying intensity level.
PROGRAM
#include "mbed.h"
PwmOut led(LED2);
int main() {
// specify period first, then everything else
led.period(4.0f); // 4 second period
led.pulsewidth(2); // 2 second pulse (on)
while(1);
// led flashing
}
RESULT
Thus the interfacing of LED with PWM ARM processor is done successfully.
PROCEDURE
1. NXP LPC11U24 ARM Cortex-M0 board is placed in the general purpose board .
2. LED is connected to the digital pin of ARM M0 Board.
3.Using keil uvision LED c program was compiled and .bin file is generated .
4. Bin file is transferred to ARM M0 board.
5. PWM pulse width modulation is the technique behind signal generation PWM will be used in the
application of waveform generation by changing the width of the waveform the intensity of the LED
is controlled. observe the LED ON and OFF with varying intensity level.
PROGRAM
#include "mbed.h"
#include "Rtc_Ds1307.h"
// start
pc.printf("Performing start operation\n");
rtc.startClock();
}
else if (strncmp(buffer, "stop", 4) == 0) {
// stop
pc.printf("Performing stop operation\n");
rtc.stopClock();
}
else if (strncmp(buffer, "ena", 3) == 0) {
int rs;
pc.printf("Please specify the frequency : [0 = 1Hz, 1 =
4.096kHz, 2 = 8.192kHz, 3 = 32.768kHz] ");
scanf("%d", &rs);
pc.printf("Enabling the output with %d option\n", rs);
rtc.setSquareWaveOutput(true,
(Rtc_Ds1307::SqwRateSelect_t)rs);
}
else if (strncmp(buffer, "dis", 3) == 0) {
pc.printf("Disableing square wave output\n");
rtc.setSquareWaveOutput(false, Rtc_Ds1307::RS1Hz);
}
else {
pc.printf("syntax error\n");
}
readptr = 0;
pc.printf("\n\n\n");
}
}
RESULT
Thus the interfacing of Real Time Clock with ARM processor is done and the output was
verified at Hyperterminal successfully.
AIM
To interface real time clock with ARM processor .
APPARATUS REQUIED
1. NXP LPC11U24
2. Computer with keil uvision4 software.
3. UART serial cable
4. general purpose board.
5. jumper wires.
PROCEDURE
1. NXP LPC11U24 ARM Cortex-M0 board is placed in the general purpose board .
2. LED is connected to the digital pin of ARM M0 Board.
3.Using keil uvision LED c program was compiled and .bin file is generated .
//connect p9 and p10 to tx and rx respectively of jp40 and 5V to any pin of jp32.
//connect the serial cable and you can see the output in advance serial port terminal.
//what ever you sent will be echoed back.
#include "mbed.h"
Serial async_port(p9,p10);
unsigned char Received_Byte = 0;
int main()
{
async_port.baud(9600);
async_port.printf("SERIAL COMMUNICATION TEST\n\r"); // String Print
async_port.putc('E'); // Single Character Print
async_port.putc('C');
async_port.putc('E');
while(1)
{
Received_Byte = async_port.getc();
async_port.putc(Received_Byte);
}
}
RESULT
Thus the interfacing of UART with PWM ARM processor is done successfully.
PROCEDURE
1. NXP LPC11U24 ARM Cortex-M0 board is placed in the general purpose board .
2. LED is connected to the digital pin of ARM M0 Board.
3.Using keil uvision LED c program was compiled and .bin file is generated .
#include <LPC214x.h>
#include <stdio.h>
// #define CR
0x0D
#define D0
16
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Declarations
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
void Delay(void);
unsigned char Row_Data, Col_Data;
unsigned char M,N;
unsigned char Msg[4][4] =
{ '0','1','2','3',
'4','5','6','7',
'8','9','A','B',
'C','D','E','F'
};
/*<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Code Begins Here
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>*/
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Delay SubRoutine
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
void Delay(void)
{
unsigned int i,j;
for(i=0;i<350;i++)
for(j=0;j<1234;j++);
}
void KeyScan ()
{
Delay();
/*^^^^^^^^^^^^^^^^^^^^^ Scanning of Rows ^^^^^^^^^^^^^^^^^^^^^^^^^*/
IODIR0 = (0x0F << D0);
// Configuring Rows as Input && Colum as OutPut
IOPIN0 = (0xF0 << D0);
// Push Column Values to LOW so as to get ROW value
while (((IOPIN0>>D0)&0x00F0) == 0xF0);
M = IOPIN0 >> D0;
if (M == 0xE0)
{
Row_Data = 0;
}
else if (M == 0xD0)
(P0.16 - P0.23)
{
Row_Data = 1;
}
else if (M == 0xB0)
{
Row_Data = 2;
}
else if (M == 0x70)
{
Row_Data = 3;
}
else
Row_Data = 4;
Delay();
Delay();
/*^^^^^^^^^^^^^^^^^^^ Scanning of Column ^^^^^^^^^^^^^^^^^^^^^^^^^*/
IOPIN0
=
0x0F << D0;
IODIR0
=
(0xF0 << D0);
// Configure Column as Input and Rows as OutPut
(P1.16 - P1.23)
IOPIN0 =
(0x0F << D0);
// Push LOW to Rows to get the Column value of Key Press
while (((IOPIN0>>D0)&0x000F) == 0x0F);
N = (IOPIN0 >> D0);
if (N == 0x0E)
{
Col_Data = 0;
}
else if (N == 0x0D)
{
Col_Data = 1;
}
else if (N == 0x0B)
{
Col_Data = 2;
}
else if (N == 0x07)
{
Col_Data = 3;
}
else
Col_Data = 4;
Delay();
IOPIN0 =
Delay();
}
//<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Main Function
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
void main(void)
{
U0LCR =
U0DLL =
U0LCR =
PINSEL0
|=
0x05;
//Pin Select for configuring P0.0 and P0.1 as UART0
U0THR=
0x0C;
//Clear the Hyperterminal
while (1)
{
Delay();
KeyScan();
/* Call KeyScan to Scan Row & Column */
if (Row_Data < 4 && Col_Data < 4)
{
U0THR
=
Msg[Row_Data][Col_Data];
Delay();
U0THR=
'\n'; // new line
Delay();
U0THR
=
'\r'; //Cursor to start of line
}
}
}
PROCEDURE
1. NXP LPC11U24 ARM Cortex-M0 board is placed in the general purpose board .
2. LED is connected to the digital pin of ARM M0 Board.
3.Using keil uvision LED c program was compiled and .bin file is generated .
4. Bin file is transferred to ARM M0 board.
5. PWM pulse width modulation is the technique behind signal generation PWM will be used in the
application of waveform generation by changing the width of the waveform the intensity of the LED
is controlled. observe the LED ON and OFF with varying intensity level.
PROGRAM
//connection::p30-en , p29-rs to lcd's p20 to p27 db0 to db7 connect rw to ground.
#include "mbed.h"
DigitalOut en(p30);
DigitalOut rs(p29);
BusOut data(p20,p21,p22,p23,p24,p25,p26,p27);
void lcdCommand(int cmd){
rs = 0;
data = cmd;
en = 1;
en = 0;
wait(.01);
}
void lcdData(int character){
rs = 1;
data = character;
en = 1;
en = 0;
wait(.01);
}
void lcdWriteText(char *line1,char *line2=""){
lcdCommand(0x80);
while(*line1)
lcdData(*line1++);
lcdCommand(0xc0);
while(*line2)
lcdData(*line2++);
}
void lcdInit(){
lcdCommand(0x38);
lcdCommand(0x0e);
lcdCommand(0x01);
lcdCommand(0x80);
}
int main()
{
lcdInit();
lcdWriteText(ECE, DEPT);
}
RESULT
Thus the interfacing of LCD with ARM processor is done successfully.
PROCEDURE
1. NXP LPC11U24 ARM Cortex-M0 board is placed in the general purpose board .
2. LED is connected to the digital pin of ARM M0 Board.
3.Using keil uvision LED c program was compiled and .bin file is generated .
4. Bin file is transferred to ARM M0 board.
5. PWM pulse width modulation is the technique behind signal generation PWM will be used in the
application of waveform generation by changing the width of the waveform the intensity of the LED
is controlled. observe the LED ON and OFF with varying intensity level.
PROCEDURE
1. NXP LPC11U24 ARM Cortex-M0 board is placed in the general purpose board .
2. LED is connected to the digital pin of ARM M0 Board.
3.Using keil uvision LED c program was compiled and .bin file is generated .
4. Bin file is transferred to ARM M0 board.
5. PWM pulse width modulation is the technique behind signal generation PWM will be used in the
application of waveform generation by changing the width of the waveform the intensity of the LED
is controlled. observe the LED ON and OFF with varying intensity level.
PROGRAM
#include <lpc21xx.h>
#include <stdio.h>
void delay(int n)
{
int i,j;
for(i=0;i<n;i++)
{
for(j=0;j<0x3FF0;j++)
{;}
}
}
int main(void)
{
unsigned int i=0;
IODIR1 = 0x0000F0000;
while(1)
// Loop forever..............
{
if(i<1000)
{
IOPIN1=0x99;
delay(1);
IOPIN1=0xcc;
delay(1);
IOPIN1=0x66;
delay(1);
IOPIN1=0x33;
delay(1);
i++;
}
else if(i>=1000 && i<2000)
{
IOPIN1=0x33;
delay(1);
IOPIN1=0x66;
delay(1);
IOPIN1=0xcc;
delay(1);
IOPIN1=0x99;
delay(1);
i++;
}
else if(i==2000) i=0;
}
}
RESULT
Thus the interfacing of stepper motor with ARM processor is done successfully.
3. RTC-DS1307 IC
4. general purpose board.
5. jumper wires.
PROCEDURE
1. NXP LPC11U24 ARM Cortex-M0 board is placed in the general purpose board .
2. LED is connected to the digital pin of ARM M0 Board.
3.Using keil uvision LED c program was compiled and .bin file is generated .
4. Bin file is transferred to ARM M0 board.
5. PWM pulse width modulation is the technique behind signal generation PWM will be used in the
application of waveform generation by changing the width of the waveform the intensity of the LED
is controlled. observe the LED ON and OFF with varying intensity level.
PROGRAM
//Connect p20 through p27 lpc11u24 with DB0 through DB7 of lcd display
//Enable pin of lcd to pin 30
//RS pin of lcd to pin 29
//R/W pin of lcd to GROUND
//Potentiometer to pin 19
#include "mbed.h"
AnalogIn pot(p19);
DigitalOut en(p30);
DigitalOut rs(p29);
BusOut data(p20,p21,p22,p23,p24,p25,p26,p27);
void lcdCommand(int cmd){
rs = 0;
data = cmd;
en = 1;
en = 0;
wait(.01);
}
void lcdData(int character){
rs = 1;
data = character;
en = 1;
en = 0;
wait(.01);
}
void lcdWriteText(char *line1,char *line2=""){
lcdCommand(0x80);
while(*line1)
lcdData(*line1++);
lcdCommand(0xc0);
while(*line2)
lcdData(*line2++);
}
void lcdWrite4Digit(int digit){
lcdData(digit/1000+48);
lcdData(digit/100%10+48);
lcdData(digit/10%10+48);
lcdData(digit%10+48);
}
void lcdInit(){
lcdCommand(0x38);
lcdCommand(0x0e);
lcdCommand(0x01);
lcdCommand(0x80);
}
int main(){
lcdInit();
lcdWriteText("Temperature sensor:");
while(1){
lcdWrite4Digit(1024*pot.read());
lcdCommand(0xc0);
wait(.1)
}
}