COLLEGE OF ENGINEERING AND TECHNOLOGY, KOTHANDARAMAN NAGAR, DINDIGUL-624622. DEPARTMENT OF ECE ACADEMIC YEAR 2016-2017 REGULATION 2013 EC6711 – EMBEDDED SYSTEMS LABORATORY 1 COLLEGE OF ENGINEERING AND TECHNOLOGY, KOTHANDARAMAN NAGAR, DINDIGUL-624622. Department of Electronics & Communication Engineering EC6711 – EMBEDDED SYSTEMS LABORATORY LAB MANUAL ACADEMIC YEAR 2016 – 2017 ODD SEMESTER IV YEAR – VII SEM – REG 2013 STAFF IN CHARGE HOD / ECE 2 INSTRUCTION TO THE STUDENTS 1. Come with uniform & Shoes to all Lab Classes. 2. Boys should tuck-in their shirts & Girls should wear overcoat. 3. Remove footwear‟s when getting into the Computer Labs. 4. Come for the Practical Classes in time. 5. Go through the Lab Manual and come prepared for doing the experiment. 6. Start doing experiments only after getting permission from the respective faculty. 7. Handle Instruments with care. 8. Report immediately to the Staff-in-charge if there is any damage to the equipments/ Machines/ Accessories. 9. Use sharp HB Pencils for Drawing Figures, Tabulation & Graphs. 10. Draw the Figures, Circuits, Diagrams and Tables on the left side of the Record Note Book. 11. Show the Model Calculations if any, on the left side of the Record Note Book. 12. Write Aim, Theory, Procedure, Results and Answers to Questions on the right side of the note book. 13. Get the Observation Note Book corrected within two days and submit the completed records when come to the Laboratory. 14. Keep the Observation, Record Note Books Neat & tidy 3 Interfacing ADC and DAC. Interrupt performance characteristics of ARM and FPGA. Interfacing LED and PWM.EC6711 EMBEDDED LABORATORY LTPC 0032 OBJECTIVES: The student should be made to: Learn the working of ARM processor Understand the Building Blocks of Embedded Systems Learn the concept of memory map and memory interface Know the characteristics of Real Time Systems Write programs to interface memory. Study of ARM evaluation system 2. 5. I/Os with processor Study the interrupt performance LIST OF EXPERIMENTS 1. 6. 11. Interfacing keyboard and LCD. Interfacing stepper motor and temperature sensor. Implementing zigbee protocol with ARM. Interfacing real time clock and serial port. 8. 9. Mailbox. 3.. TOTAL: 45 PERIODS 4 . 10. Interfacing EPROM and interrupt. 4. 7. Flashing of LEDS. Page Date Name of Experiments No Marks No FIRST CYCLE 1 Study of ARM evaluation system 2 Interfacing ADC and DAC 3 Interfacing LED and PWM 4 Interfacing real time clock and serial port 5 Interfacing keyboard and LCD 6 Interfacing EPROM and interrupt SECOND CYCLE 7 Mailbox 8 Flashing of LEDS 9 Interfacing of stepper motor 10 Interfacing temperature sensor. Kothandaraman Nagar.PSNA COLLEGE OF ENGINEERING AND TECHNOLOGY. Interrupt performance characteristics of 12 ARM and FPGA 5 Remarks . DINDIGUL-624622. 11 Implementing zigbee protocol with ARM. Tamil Nadu LIST OF EXPERIMENTS Sl. TI they all make ARM based SOCs. similarly all major semiconductor manufacturers like Atmel.1. The ARM architecture is licensed to companies that want to manufacture ARM-based CPUs or system-on-a-chip products.Exp.No: Date : STUDY OF ARM-2378 EVALUATION BOARD EXPT 1 ARM-2378 DEVELOPMENT BOARD Introduction ARM is a 32-bit RISC (Reduced Instruction Set Computer) processor architecture developed by ARM Corporation. Samsung. For example. Fig. It was previously known as Advanced RISC Machines and prior to that Acorn RISC Machines. the device we are using (LPC21XX) is ARM architecture based SOC product developed by NXP semiconductors. This enables the licensees to develop their own processors compliant with the ARM instruction set architecture. So learning about ARM is pretty cool as once you are familiar to ARM instruction set you can easily switch between various ARM based SOCs available in market. Block Diagram of ARM 7 Microcontroller 6 . 2. Fig. A 128-bit wide memory interface and a unique accelerator architecture enable 32-bit code execution at the maximum clock rate. It can work with 16-bit Thumb Mode. 7 . which offers high performance and very low power consumption. The LPC2377/78 microcontrollers are based on a 16-bit/32-bit ARM7TDMI-S CPU with real-time emulation that combines the microcontroller with 512 kB of embedded high-speed flash memory. two CAN channels. It has 8bit data/16-bit address parallel bus is available. Block Diagram of ARM Core – CORTEX M3 LPC2378 Micro-controller is based on a 32/16 Bit ARM7TDMI-s CPU with real time Emulation and Embedded Trace support that combines with the microcontroller with embedded high-speed 512KB flash memory. This microcontroller incorporate a 10/100 Ethernet MAC.0 Full Speed interface. this increases performance up to 30 % over Thumb mode. For critical code size applications. The ARM7TDMI-S is a general.purpose 32-bit microprocessor.LPC-2378 is an ARM-based microcontroller for applications requiring serial communications for a variety of purposes. four UARTs. two Synchronous Serial Ports (SSP). three I2C interfaces. For critical performance in interrupt service routines and DSP algorithms. and a Mini Bus. USB 2. the alternative 16-bit Thumb mode reduces code by more than 30 % with minimal performance penalty. an I2S interface. an SPI interface. The ARM architecture is based on Reduced Instruction Set Computer (RISC) principles. the I2S port. running at up to 72 MHz. Up to 512kB on-chip Flash Program Memory with In-System Programming (ISP) and In-Application Programming (IAP) capabilities. and up to 104 fast GPIO lines with up to 50 edge and up to four level sensitive external interrupt pins make these microcontrollers suitable for industrial control and medical systems. This blend of serial communications interfaces combined with an on-chip 4 MHz internal oscillator. a CAN control unit. A bus bridge allows the Ethernet DMA to access the other AHB subsystem. External memory controller that supports static devices such as Flash and SRAM. It incorporates a 10/100 Ethernet Media Access Controller (MAC). an improved 10-bit ADC. Various 32-bit timers. 16KB Static RAM for Ethernet interface. Processor Range: ARM offers a wide range of processor cores based on a common architecture. Advanced Vectored Interrupt Controller. 16 kB SRAM for Ethernet. and the SD/MMC card port. USB DMA. CAN also be used as general purpose SRAM. two CAN channels (LPC2378 only). Up to 32KB of SRAM on the ARM local bus for high performance CPU access.LPC2377/78 is ideal for multi-purpose serial communication applications. three I2C-bus interfaces. PWM unit. four UARTs. CAN also be used as general purpose SRAM. 8KB Static RAM for USB interface. as well as for memory-to-memory transfers. 8 kB SRAM for USB and general purpose use. SRAM of 32 kB. an I 2S-bus interface. that deliver high performance together with low power consumption and system cost . Flash program memory is on the ARM local bus for high performance CPU access. an SPI interface. 8 . and an External Memory Controller (EMC). supporting up to 32 vectored interrupts. together with 2 kB battery powered SRAM make this device suited for communication gateways and protocol converters. Dual AHB system that provides for simultaneous Ethernet DMA. 10-bit DAC. Single Flash sector or full chip erase in 400ms and 256 bytes programming in 1ms. USB full speed device with 4 kB of endpoint RAM (LPC2378 only). General Purpose AHB DMA controller (GPDMA) that can be used with the SSP serial interfaces. Features of ARM Processor: ARM7TDMI-S processor. and program execution from on-chip Flash with no contention between those functions. two Synchronous Serial Ports (SSP). NXP LPC2378 Micro controller (TQFP-64 Packaging). 128 x 64 Pixels Graphics LCD 20. Power supply section. 16. USB 2.Keyboard connector. 21. 19. 10. 2. RTC. 7.The ARM processor range provides solutions for: Open platforms running complex operating systems for wireless. 9 . 50Pin Expansion Header. ADC. consumer and imaging applications. DAC and PWM Expansion slot. Serial EEPROM 26. 18. Joystick. industrial and networking applications. automotive. J-Tag Connector. USB Audio Device. CAN Port. 17. Prog/Exec Switch.. 12. RTC. 10/100 Base T Ethernet Connectivity. 15. 9. 25. 22. Secure applications including smart cards and SIMs. 6. 4. ADC. 8 Way DIP switch. UART. Analog input Trimmer. and a broad set of additional on board Peripherals various applications are possible such as 10/100Mbps Ethernet. Accelerometer. USB etc. Seven Segment Display. SD Card Socket. 3. Relay. 23. PS2.. J-Trace.0 Device Controller. 13. MMC/SD. Applications of ARM 2378 With Useful Implemented peripherals. LED. 8. 5. Embedded real-time systems for mass storage. 24. 4 x 4 Matrix Keypad. 11. DAC. Stepper Motor. ViARM-2378 Development Board Parts Details 1. 14. RESULT: 10 . for(i=0.j. delay(). 1 Stop bit */ Fdiv = ( Fpclk / 16 ) / 19200 . /* RxD0 and TxD0 */ U0LCR = 0x83. while(1) { FIO3PIN = 0X000000ff.i++) for(j=0.j<0xff. } } 11 . */ FIO3DIR = 0X008000FF.Program #include <iolpc2378. U0LCR = 0x03. } int main (void) { unsigned int Fdiv.h" #include "config.j++). /*baud rate */ U0DLM = Fdiv / 256. no Parity. TargetResetInit(). /* DLAB = 0 */ U0FCR = 0x07. FIO3PIN = 0X00000000. U0DLL = Fdiv % 256. delay().h> #include "irq. /* Enable and reset TX and RX FIFO.h" void delay() { unsigned int i. /* 8 bits. PINSEL0 = 0x00000050.i<0x3fff. usually for displaying pins digital states.3.5 3. The 8 nos of LED are connected to pin Q0-Q7. IAR Embedded Workbench 6. Each Led can be individually enabled or disabled. Typical uses of LEDs include alarm devices. Flash Magic ISP Utility Theory LED (Light Emitting Diodes) Light Emitting Diodes (LED) is the most commonly used components.The 330 ohm resistor limit the current to about 4 mA. LPC 2378 ARM Development board 2. usually for displaying Pin‟s Digital state. Fig. This latch is selected via 74LS154 decoder. A low output pin drives current through the LEDs and they will light.No: EXPT:2 Date FLASHING OF LEDS Aim To perform the flashing of LED‟s with ARM 7 controller Components Required: 1. Light Emitting diodes are most commonly used components. LED Structure 12 . The digital data sent by the microcontroller is latched using 74LS273. timers and confirmation of user input such as a mouse click or keystroke.Exp. OUTPUT: 13 . If your „C„file has no error. This Hex file will be downloaded to the VIARM-2378 controller by Flash Magic Software 14 .5\arm\inc\NXP) 6. 9. 10. Run the Application IAR Embedded Workbench 6. Building completed and Hex file generated. Select General options category. Give your File name ( Eg: LED. 5.5\arm\inc\c. Select C/C++ Compiler >Select Preprocessor and include (C:\Program Files\IAR Systems\Embedded Workbench 6. Select Linker Category. If your project has no error. 13. Right Click the project name option for select a „C‟ file in workspace window. Enable target option file and select the device as NXP LPC2378 and click ok. C:\Program Files\IAR Systems\Embedded Workbench 6. for checking any error in your „C‟ file. Select LPC2378 >Options menu 4. Select LPC2378>Rebuild all menu. Enable Output Converter Menu and select output format as Intel extended and Enable Override default option 7. Select LPC2378>Rebuild all menu.C) Menu. for saving a file. Create a new project by selecting the tool chain as “ARM” and create empty project and click ok.PROCEDURE: 1. 8. 3. New>File Menu. for checking any error in your „C‟ file. Enable Override default option. Create new project in the current work space. Select Add >Add (LED. Give Project Name and click SAVE Button. File>Save As. 11. for creating a new „C „file.C) and click Save Button. 12.5 2. click SAVE Button. 15 . RESULT: 16 .HEX) file to kit.000000 Step 3: Go to step 2: Erase Select Erase blocks used by Hex file Step 4: Go to step 3: Hex file Select Browse corresponding Hex file Step 5: Directly go to step 5: Start click start for Embed (*.Steps To Be Followed In Flash Magic Software For Embed Into Kit: Step 1: Open Flash Magic software Step 2: Go to step 1: Communications Select Com port : COM1 Baud Rate : 19200 Device : LPC2378 Interface : None (ISP) Oscillator Freq (MHz) : 16. } 17 . if ( i == 1024 ) { i = 0. } //Main Function int main (void) { unsigned int i. */ while ( 1 ) { DACR = (i << 6) | DAC_BIAS.Program: Interfacing of DAC with ARM #include #include #include #include <iolpc2378. /* set p0. /* Initialize DAC DACInit().h" "config. TargetResetInit().h> "irq.h" void DACInit( void ) { /* setup the related pin to DAC output */ PINSEL1 = 0x00200000.h" "dac.26 to DAC output */ return. i++. } } return 0. 7 – 5. 12-Bit Digital-to-Analog Converters (DACs) with optional 2x buffered output and SPI interface. With an SPI connection there is always one master device (usually a microcontroller) which controls the peripheral devices. low-power. Typically there are three lines common to all the devices. low DNL. Simple switches.5V.No: Date : INTERFACING OF ADC & DAC Aim To interface ADC and DAC with ARM 7 Controller Components Required: 1. IAR Embedded Workbench 6. A DAC inputs a binary number and outputs an analog voltage or current signal. MCP492X is 2. Digital-to-Analog Converters are the interface between the abstract digital world and the analog real life. MCP429x: The Microchip Technology Inc.4 shows how to interface the SPI-DAC to microcontroller. 18 . Flash Magic ISP Utility Theory A digital-to-analog converter is a device for converting a digital (usually binary) code to an analog signal (current.the pin on each device that the master can use to enable and disable specific devices. current sources or capacitors may implement this conversion. The MCP492X are DACs that provide high accuracy and low noise performance for industrial applications where calibration or compensation of signals is required Interfacing SPI-DAC: Fig. Serial Clock (SCK) . Slave Select pin . voltage or charges).Exp.The clock pulses which synchronize data transmission generated by the master.The Master line for sending data to the peripherals. Master Out Slave In (MOSI) . LPC 2378 ARM Development board 2.The Slave line for sending data to the master. a network of resistors.5 3. Master In Slave Out (MISO) . OUTPUT: 19 . PROCEDURE: 1. 5. C:\Program Files\IAR Systems\Embedded Workbench 6.5 2. an ADC is an electronic device that converts an input analog voltage (or current) to a digital number proportional to the magnitude of the voltage or current. or "levels".5\arm\inc\c. Enable Output Converter Menu and select output format as Intel extended and Enable Override default option 7. 20 .2378 Development board has two potentiometers for working with A/D Converter. Select General options category. the number of discrete values available. Select LPC2378 >Options menu 4. ViARM . In consequence. The resolution of the converter indicates the number of discrete values it can produce over the range of analog values. Give your File name ( Eg: DAC. That range is 0V to 3.Interfacing of ADC: An analog-to-digital converter is a device that converts a continuous quantity to a discrete digital number.3V. so the resolution is usually expressed in bits. Create a new project by selecting the tool chain as “ARM” and create empty project and click ok. for saving a file. for creating a new „C „file. An ADC with a 10-bit output can represent up to 1024 (210) unique conditions of signal measurement. 3. Enable target option file and select the device as NXP LPC2378 and click ok.3V.C) and click Save Button. All Potentiometers outputs are in the range of 0V to 3. Run the Application IAR Embedded Workbench 6. is usually a power of two. Create new project in the current work space.5\arm\inc\NXP) 6. Basically. File>Save As. The values are usually stored electronically in binary form. inclusive). New>File Menu. there will be exactly 1024 unique binary numbers output by the converter (from 0000000000 to 1111111111. Typically. Enable Override default option. click SAVE Button. Over the range of measurement from 0% to 100%. ARM processor takes analog signal from its input pin and translates it into a digital value. you can measure any analog signal that fits in range acceptable by LPC2378. 8. Select Linker Category. Select C/C++ Compiler >Select Preprocessor and include (C:\Program Files\IAR Systems\Embedded Workbench 6. Give Project Name and click SAVE Button. t1. send_serial_data(0x0a). PINSEL0 = 0x00000050.30~31. send_serial_data(0x0d). no Parity. % 10.0 AS ANALALOG INPUT // RxD0 and TxD0 // PINSEL1 &= ~0x003FC000.23~26. 21 .h> #include "irq. / 100. function 11 */ U0LCR = 0x83. } void main() { unsigned long int val. / 1000. //AD0. send_serial_data(t10+0x30). /* P1. // DLAB = 0 U0FCR = 0x07. // Enable and reset TX and RX FIFO.t10. % 1000.t100. // PINSEL3 |= 0xF0000000. } void adc_serial_tx(unsigned int ch) { unsigned int t1000 = ch temp = ch t100 = temp temp = temp t10 = temp t1 = temp t1000. /* P0. TargetResetInit(). PINSEL1 = 0X00054000. send_serial_data(t1+0x30). send_serial_data(t100 +0x30). #define ADC_CLK 1000000 /* set to 1Mhz */ void send_serial_data(unsigned char serial) { while((U0LSR & 0x20)==0). 1 Stop bit Fdiv = ( Fpclk / 16 ) / 19200 .Program: Interfacing of ADC with ARM #include<NXP\iolpc2378. A0. function 01 */ // PINSEL1 |= 0x00154000.h" #include "config.4~5. U0DLL = Fdiv % 256.temp. unsigned int Fdiv. //baud rate U0DLM = Fdiv / 256. // 8 bits.h" unsigned int ADC_VALUE=0. PCONP |= (1 << 12).0~3. send_serial_data(t1000+0x30). % 100. / 10. U0LCR = 0x03. A0. U0THR = serial. for checking any error in your „C‟ file. Right Click the project name option for select a „C‟ file in workspace window.C) Menu. 10. Select LPC2378>Rebuild all menu. If your „C„file has no error. 11. Select Add >Add (DAC.9. 22 . 12.000000 Step 3: Go to step 2: Erase Select Erase blocks used by Hex file Step 4: Go to step 3: Hex file Select Browse corresponding Hex file Step 5: Directly go to step 5: Start click start for Embed (*. If your project has no error. This Hex file will be downloaded to the VIARM-2378 controller by Flash Magic Software Steps To Be Followed In Flash Magic Software For Embed Into Kit: Step 1: Open Flash Magic software Step 2: Go to step 1: Communications Select Com port : COM1 Baud Rate : 19200 Device : LPC2378 Interface : None (ISP) Oscillator Freq (MHz) : 16.HEX) file to kit. 13. for checking any error in your „C‟ file. Building completed and Hex file generated. Select LPC2378>Rebuild all menu. /* EDGE = 0 (CAP/MAT singal falling. // 10 bit adc data transmit serial port.// AD0CR = 0x01200601. // Start A/D Conversion AD0CR = ( 0x01 << 1 ) | /* SEL=1. no BURST. 11 clocks/10 bits */ ( 1 << 21 ) | /* PDN = 1. software controlled */ ( 0 << 17 ) | /* CLKS = 0.1 ) << 8 ) | /* CLKDIV = Fpclk / 1000000 .trigger A/D conversion) */ while(1) { while((AD0GDR & 0X80000000)!=0X80000000). normal operation */ ( 0 << 22 ) | /* TEST1:0 = 00 */ ( 1 << 24 ) | /* START = 0 A/D conversion stops */ ( 0 << 27 ).select channel 0~7 on ADC0 */ ( ( Fpclk / ADC_CLK . // convesion data holds AD0DR0[6] to AD0DR0[15] adc_serial_tx(val). } } 23 . val = (AD0GDR>>6)& 0x3ff .1 */ ( 1 << 16 ) | /* BURST = 0. RESULT: 24 . i++) for(j=0. /* 8 bits. Read_Key = (Read_Key & 0xf000) >> 12 .j. U0THR = serial. FIO3PIN = 0X00000001. /*baud rate */ U0DLM = Fdiv / 256. /* DLAB = 0 */ U0FCR = 0x07.j<0xff. /* RxD0 and TxD0 */ U0LCR = 0x83. no Parity. FIO3PIN = 0X00000000. Read_Key = FIO4PIN. unsigned int Read_Key.0x00000D00. if((Read_Key==0x07)) { send_serial_data('0'). } 25 . } if((Read_Key==0x0b)) { send_serial_data('1'). void delay() { unsigned int i.h> #include "irq.Program: Interfacing of Keyboard with ARM #include <iolpc2378. TargetResetInit().h" #include "config. */ FIO4DIR = 0X00000FFF. 1 Stop bit */ Fdiv = ( Fpclk / 16 ) / 19200 . unsigned char scan [] = { 0x00000E00. U0DLL = Fdiv % 256. FIO3DIR = 0X008000FF. PINSEL0 = 0x00000050. while(1) { //First Row FIO4SET = 0X00000e00. /* Enable and reset TX and RX FIFO.0x00000700}. } void send_serial_data(unsigned char serial) { while((U0LSR & 0x20)==0).0x00000B00.i<0xff. for(i=0. unsigned int i.j++). U0LCR = 0x03. } int main (void) { unsigned int Fdiv.h" unsigned int k. Interfacing keypad: Fig. the microcontroller grounds all rows by providing 0 to the output latch. Here we are using 4 X 4 matrix keypad. If it mostly contains numbers then it can also be called a numeric keypad. symbols and usually a complete set of alphabetical letters.5 3. no key has been pressed and the process continues until a key press is detected.No: Date : INTERFACING OF KEYBOARD WITH ARM Aim To interface the Keypad with ARM 7 Controller Components Required: 1. Flash Magic ISP Utility Theory A keypad is a set of buttons arranged in a block or "pad" which usually bear digits. To detect a pressed key. LPC 2378 ARM Development board 2.Exp. shows how to interface the 4 X 4 matrix keypad to two ports in microcontroller. IAR Embedded Workbench 6. The rows are connected to an output port and the columns are connected to an input port. 26 . and then it reads the columns. If the data read from the columns is D3-D0=1111. } if( (Read_Key==0x0d)) { send_serial_data('6'). FIO3PIN = 0X00000004. } FIO4CLR = 0X00000d00. //Second Row FIO4SET = 0X00000d00. if((Read_Key==0x07)) { send_serial_data('4'). Read_Key = (Read_Key & 0xf000) >> 12 . } if((Read_Key==0x0b)) { send_serial_data('5'). FIO3PIN = 0X00000008. FIO3PIN = 0X00000002. } if((Read_Key==0x0b)) { send_serial_data('9'). } 27 .if( (Read_Key==0x0d)) { send_serial_data('2'). Read_Key = FIO4PIN. delay(). Read_Key = (Read_Key & 0xf000) >> 12 . } if((Read_Key==0x0e)) { send_serial_data('3'). FIO3PIN = 0X00000009. delay(). //Third Row FIO4SET = 0X00000b00. FIO3PIN = 0X00000005. FIO3PIN = 0X00000003. if((Read_Key==0x07)) { send_serial_data('8'). } if( (Read_Key==0x0e)) { send_serial_data('7'). } FIO4CLR = 0X00000e00. Read_Key = FIO4PIN. FIO3PIN = 0X00000006. FIO3PIN = 0X00000007. However. If your „C„file has no error.5\arm\inc\c. Select Add >Add (KEYPAD.C) Menu. 13. and checks for any zero. for creating a new „C „file. Select C/C++ Compiler >Select Preprocessor and include (C:\Program Files\IAR Systems\Embedded Workbench 6. 12. for saving a file. This process continues until the row is identified. for checking any error in your „C‟ file. This Hex file will be downloaded to the VIARM-2378 controller by Flash Magic Software 28 . 8. Starting with the top row. After a key press is detected. PROCEDURE: 1. File>Save As. reads the columns. the next task is to find out which column the pressed key belongs to. Select LPC2378>Rebuild all menu. Run the Application IAR Embedded Workbench 6.5\arm\inc\NXP) 6. Right Click the project name option for select a „C‟ file in workspace window. 9. Enable target option file and select the device as NXP LPC2378 and click ok. If your project has no error. the microcontroller grounds it by providing a low to row D0 only. for checking any error in your „C‟ file. this means that a key in the D1 column has been pressed. no key in that row is activated and the process is moved to the next row. Give Project Name and click SAVE Button. Select Linker Category. click SAVE Button. For example. New>File Menu. if D3-D0=1101. 10. Select LPC2378>Rebuild all menu. 5. Building completed and Hex file generated. It grounds the next row. then it reads the columns. Create a new project by selecting the tool chain as “ARM” and create empty project and click ok. After identification of the row in which the key has been pressed. Enable Output Converter Menu and select output format as Intel extended and Enable Override default option 7. Create new project in the current work space. Give your File name ( Eg: KEYPAD. C:\Program Files\IAR Systems\Embedded Workbench 6. Select LPC2378 >Options menu 4. the microcontroller will go through the process of identifying the key. 11. if one of the column bits has a zero. Select General options category.5 2. this means that a key press has occurred. Enable Override default option. If the data read is all 1s. 3.C) and click Save Button. } FIO4CLR = 0X00000b00. // send_serial_data('c'). delay(). FIO3PIN = 0X0000000a. FIO3PIN = 0X0000000f. } return 0. FIO3PIN = 0X0000000e. } if( (Read_Key==0x0e)) { send_serial_data('f'). Read_Key = FIO4PIN. } if((Read_Key==0x0b)) { send_serial_data('d'). delay(). if((Read_Key==0x07)) { send_serial_data('c'). } if( (Read_Key==0x0e)) { send_serial_data('b').if( (Read_Key==0x0d)) { send_serial_data('a'). Read_Key = (Read_Key & 0xf000) >> 12 . FIO3PIN = 0X0000000b. } 29 . //Fourth Row FIO4SET = 0X00000700. } FIO4CLR = 0X00000700. FIO3PIN = 0X0000000d. } if((Read_Key==0x0d)) { send_serial_data('e'). FIO3PIN = 0X0000000c. 000000 Step 3: Go to step 2: Erase Select Erase blocks used by Hex file Step 4: Go to step 3: Hex file Select Browse corresponding Hex file Step 5: Directly go to step 5: Start click start for Embed (*.HEX) file to kit RESULT: 30 .Steps To Be Followed In Flash Magic Software For Embed Into Kit: Step 1: Open Flash Magic software Step 2: Go to step 1: Communications Select Com port : COM1 Baud Rate : 19200 Device : LPC2378 Interface : None (ISP) Oscillator Freq (MHz) : 16. 31 . LPC 2378 ARM Development board 2. Interfacing LCD Fig. Flash Magic ISP Utility Theory: Liquid Crystal Display also called as LCD is very helpful in providing user interface as well as for debugging purpose. and also facility to adjust contrast through trim pot. three control lines. In 4-bit interface 7 lines needed to create 4-bit interface. A liquid crystal display (LCD) is a flat panel display that uses the light modulating properties of liquid crystals (LCs). 4 data bits (D0 – D3). read/write bit (R/W) and control signal (E). address bit (RS).No: Date : INTERFACING OF LCD WITH ARM Aim To interface the LCD with ARM 7 Controller Components Required: 1. IAR Embedded Workbench 6. shows how to interface the LCD to microcontroller. 32 . The 2x16 character LCD interface card with supports both modes 4-bit and 8-bit interface.Exp.5 3. LCD Modules can present textual information to user. 33 . Select LPC2378>Rebuild all menu.5 2. Right Click the project name option for select a „C‟ file in workspace window. 9. Enable Output Converter Menu and select output format as Intel extended and Enable Override default option 7. for saving a file. Select General options category. Give Project Name and click SAVE Button. Select LPC2378 >Options menu 4. Run the Application IAR Embedded Workbench 6.5\arm\inc\NXP) 6. 10. File>Save As. New>File Menu. Select C/C++ Compiler >Select Preprocessor and include (C:\Program Files\IAR Systems\Embedded Workbench 6. Select LPC2378>Rebuild all menu. Building completed and Hex file generated.C) and click Save Button.PROCEDURE: 1. Enable Override default option. 12.5\arm\inc\c. for creating a new „C „file.C) Menu. Create a new project by selecting the tool chain as “ARM” and create empty project and click ok. 3. for checking any error in your „C‟ file. 8. 13. Enable target option file and select the device as NXP LPC2378 and click ok. C:\Program Files\IAR Systems\Embedded Workbench 6. Create new project in the current work space. 11. Give your File name ( Eg: KEYPAD. This Hex file will be downloaded to the VIARM-2378 controller by Flash Magic Software 34 . Select Linker Category. If your project has no error. 5. Select Add >Add (KEYPAD. for checking any error in your „C‟ file. click SAVE Button. If your „C„file has no error. 35 . 000000 Step 3: Go to step 2: Erase Select Erase blocks used by Hex file Step 4: Go to step 3: Hex file Select Browse corresponding Hex file Step 5: Directly go to step 5: Start click start for Embed (*.HEX) file to kit RESULT: 36 .Steps To Be Followed In Flash Magic Software For Embed Into Kit: Step 1: Open Flash Magic software Step 2: Go to step 1: Communications Select Com port : COM1 Baud Rate : 19200 Device : LPC2378 Interface : None (ISP) Oscillator Freq (MHz) : 16. 37 .