Arm Final
Arm Final
Marks Obtained
Signature
3 Part A: Problem 1 4
4 Part A: Problem 2 6
5 Part B Problem 8
C0-ARM [21EC52] 2023-2024
ARM Cortex-M3 Core: The LPC1768 is built around the ARM Cortex-M3 core, which
provides high performance and low power consumption, making it suitable for a wide range of
applications.
Flash Memory: The LPC1768 typically comes with 512 KB of on-chip flash memory for
storing program code.
SRAM: It has 64 KB of on-chip static RAM (SRAM) for data storage.
EEPROM: Some variants may include built-in EEPROM for non-volatile data storage.
Peripherals:
GPIO (General Purpose Input/Output): Multiple GPIO pins for interfacing with external
devices.
UART (Universal Asynchronous Receiver/Transmitter): Serial communication interface.
SPI (Serial Peripheral Interface): Synchronous serial communication interface for connecting
peripherals.
I2C (Inter-Integrated Circuit): Another serial communication protocol for connecting low-speed
peripherals.
USB (Universal Serial Bus): Built-in USB interface for connecting to external devices.
Timers and Counters: Multiple timers and counters for various timing and control applications.
Interrupts and DMA: The LPC1768 supports interrupts and DMA (Direct Memory Access) for
efficient handling of asynchronous events and data transfer.
Debugging and Development: It supports various debugging and development tools, including
on-chip debugging via JTAG/SWD (Joint Test Action Group/Serial Wire Debug) interfaces and
development environments such as Keil µVision and Eclipse.
Operating Voltage: Typically operates at 3.3V, although some variants may support wider
voltage ranges.
PART A:
3. PROBLEM 1
labeled "RESULT").
SWI &11 ; Invokes software interrupt 17
(0x11), which might be a system
call for outputting the result.
DIGIT DCD &0C ; Defines a memory location labeled
"DIGIT" and initializes it with the
hexadecimal value 0x0C (decimal
12).
RESULT DCD 0 ; Defines a memory location labeled
"RESULT" and initializes it with
the value 0.
END Marks the end of the assembly
code.
Output:
4. PROBLEM 2
Program:
LABEL MNEMONICS OPERANDS COMMENTS
palindrome)
NOTPAL MOV R0, #0X2 Set r0 to 2 (indicating not a
palindrome)
STRING DCB "ABCBA",0 Define the string "abcba"
terminated with null
END End of program
Output:
PART B PROBLEM:
5. Implement UART serial communications protocol
Program:
#include<lpc17xx.h>
unsigned int c; //if signed it takes 31 bits we need full 32 bits hence unsigned
unsigned char recdata;
int main()
{
char a[]="UART protocol\r";
int i;
//uart transmitter
LPC_SC->PCONP |=0x00000008; //optional
LPC_PINCON->PINSEL0=0x00000050; //TXD0 and rxd0 of uart0 is selected with function
LPC_UART0->LCR = 0x83; //8 bit character, 1 stop bit and div latch enable
LPC_UART0->DLL = 0xA2; //calculation 9600
LPC_UART0->DLM = 0x00; //higher bits are 0
LPC_UART0->LCR = 0x03; //8 bits of information
LPC_UART0->FCR = 0x07; //clear tx and rx of FIFO
while(1) //endless loop
{
while((LPC_UART0->LSR & 0x20)==0x20)
{
for(i=0;i<=a[i];i++) //string of data
LPC_UART0->THR =a[i]; //data
}
}
}
Output: