Posts

MICROCONTROLLER AND EMBEDDED SYSTEMS LABORATORY Part B

Image
 Program 9 Display “Hello World” message using Internal UART. #include<lpc21xx.h> void Uart0Init(void) //initialize serial interface { PINSEL0=0X00000005; // enable RXD0 (P0.1) & TXD0 (P0.0) U0LCR = 0X83; // 8 bits, no parity, 1 stop bit U0DLL = 97; // 9600 Baud rate @ 15MHz PCLK U0LCR = 0X03; // DLAB = 0 } void Uart0PutCh(unsigned char ch) //write char to serial port { U0THR = ch; // Transmission hold register while(!(U0LSR & 0x20)); //checking whether the Char is completely transmitted, // TX= 0 or 1 // if tx bit =1 , complete transmission of a char to PC has been done } void uart_print(char *a) { int i; for(i=0;a[i]!='\0';i++) Uart0PutCh(a[i]); //one char at a time is transmitted using this function } int main() { Uart0Init(); // function call to initialize LPC2148 uart_print("Hello World"); // function call to transmit the data to PC } Program explanation and Demo:  UART  Program 10  Interface and Control a DC Motor.  //#define MOTOR 0x00000060...

MICROCONTROLLER AND EMBEDDED SYSTEMS LABORATORY Part A

Image
1. Write a program to multiply two 16 bit binary numbers. Program:  area multiply, code, readonly entry ldr r5,=value1 ldrh r0,[r5]  ldr r6,=value2 ldrh r1,[r6] mul r3,r1,r0 stop b stop value1 DCD 0x08 value2 DCD 0x03 end Program explanation and Demo:  MCES Lab 1 2. Write a program to find the sum of first 10 integer numbers. Program: AREA ADDITION, CODE, READONLY ENTRY ;MARK FIRST INSTRUCTION TO EXECUTE MOV r0, #10 ; STORE INTEGER NUMBER IN R0 MOV r1,r0  ADDIT SUBS r1, r1, #1 ; SUBTRACTION CMP r1, #0 ; COMPARISON BEQ DONE ADD r3,r0,r1 ; ADDITION MOV r0,r3 ; RESULT     BNE ADDIT ; BRANCH TO THE LOOP IF NOT EQUAL DONE LDR R4,=RES STR R0,[R4]   LDR R5,[R4] STOP B STOP AREA DATA1,DATA,READWRITE RES DCD 0X000 END ;MARK END OF FILE Program explanation and Demo:  MCES Lab 2      3. Write a program to find factorial of a number. Program :  AREA FACT,READONLY,CODE ;Write ...

IoT Lab 8-11: Controlling Intensity of Led using Potentiometer, Traffic Control System, Interfacing of Ultrasonic sensor, IR sensor, Temperature, LDR

Image
Experiment 8  Aim: To demonstrate Control of Led Intensity using Potentiometer  Components required:  LEDs Breadboard Arduino Uno Potentiometer Register Jumper wires Connection Diagram: Code: int value=0;  void setup() { pinMode(A0, INPUT);  pinMode(13, OUTPUT); } void loop() { value = analogRead(A0);  digitalWrite(13,HIGH);   delay(value); digitalWrite(13, LOW);    delay(value); } Result: Successfully demonstrated Control of Led Intensity using Potentiometer  Experiment 8a Aim: To demonstrate  Adjust the brightness of LED without using potentiometer Components required: LED  Register Aurduino Breadboard jumper wire Connection diagram: Code:  int value=0;  void setup() { pinMode(13, OUTPUT); } void loop() {   for(int fad=0;fad<256;fad+=5)   {      analogWrite(13,fad);      delay(100);   }      } Result: Lab 9: Arduino pro...

MAD Lab Programs 11 - 15 : WEB VIEW, LIST VIEW, SPINNER VIEW, OPTION MENU, CURD operations using - SQLite

Image
Lab 11: WEB VIEW Aim:    Write an Android application program that demonstrates Web view in mobile applications development. Code: AndroidManifest.xml <? xml version= "1.0"  encoding= "utf-8" ?> < manifest  xmlns: android = "http://schemas.android.com/apk/res/android"      package= "com.example.admin.webview" >      < uses-permission  android :name= "android.permission.INTERNET" />      < application          android :allowBackup= "true"          android :icon= "@mipmap/ic_launcher"          android :label= "@string/app_name"          android :roundIcon= "@mipmap/ic_launcher_round"          android :supportsRtl= "true"          android :theme= "@s...