Sie sind auf Seite 1von 23

Department of ECE EC1404 Embedded Systems Laboratory IV YEAR ECE

CONTENTS

Ex. No
1 2 3 4 5 6 7 8

Name of the Experiment


Multiplication in ARM Processor System design using FPGA Read toggle switches in ARM processor Displaying two different tasks on LCD using arm Implementation of FSM using FPGA Interrupt performance characteristics of arm and FPGA Hardware and software partitioning using arm and FPGA Implementation of wireless communication protocol using Zigbee wireless module

Ex.NO:1 AIM:

MULTIPLICATION IN ARM PROCESSOR

To multiply two 32-bit numbers and to display it on LCD using ARM processor APPARATUS REQUIRED: 1. ARM Evaluation board NXP LPC2148 2. 5V/2A Adapter 3. USB Cable SOFTWARE REQUIRED: 1. Embest IDE 2. Flash Magic ALGORITHM: Step1: Intialize LCD. Step2: Call the routine Message_Display1 to display message Multiplication on line 1 of the LCD. Step3: Place the 32 bit numbers to be multiplied in registers R1 and R2. Step4: a. Multiply the numbers and display the 32 bit result in the line 2of the LCD. b. Halt. PROCEDURE: 1. Open Embest IDE software and create a new work space. EmbestIDE ->File->new work space->browse->open the saved file from D:/ in ARM and give project name. 2. Copy the following files from the include files for 2148 and paste it in the new workspace folder. vector.s Flash.Id LCD.s

3. Create a new file and type the main program in assembly language. 4. Save the program as filename.s in the new workspace. 5. Add filename.s and vector.s files to the project source file.

6. Set the project settings. (Project->settings) (i)Processor CPU Module: ARM 7 Family: ARM 7 Member: ARM 7 Build tools: GNU tools for ARM Remote Device: SimARM7 Category->Target specific options o o (iv) Assembler Category ->Target specific options o (v)Linker Category->Image entry options o o o Select vector.o file Select little Indian objects Select the Linker script file Flash.Id from the new workspace. Category->Code generation options Category ->General Select little Indian mode Select little Indian mode Specify the name of target CPU: ARM7TDMI

(ii) Remote (iii)Compiler

Click OK to save the project settings. 7. Build the project. Select Build -> rebuild all 8. Check Commands Successfully Executed in output window which ensures that the program is executed with no errors. 9. Select tools -> Elf to Hex and .hex file is created. Downloading: Open Flash magic Software 1. Select the communications parameters Comport : COM 3

Baud rate : 38400 Device : LPC2148 Interface : None Oscillator Frequency(MHz) : 10.000000 2. Select .hex file from the project. 3. Switch on the kit. 4. Switch JP3 to the program mode so that LED glows and press reset once. 5. Click start to download the program into the kit. 6. Switch JP3 to the execute mode and press reset again. 7. The result is displayed on 2 line LCD module.

RESULT: Thus the result of multiplication of two 32-bit numbers is displayed on the LCD module. Multiplication 00000006

EX.NO:2 CONVERSION OF BINARY NUMBERS USING FPGA AIM: To convert a binary number to octal, decimal, hexadecimal using FPGA and to display it on a seven segment display. APPARTUS REQUIRED: 1. Xilinx tool and Spartan-3 FPGA kit. PROCEDURE: (i) ) Start the xilinx project navigator . Start -> programs -> xilinx ISE8.1i. (ii) Create a new project .file -> new project -> specify name -> next. (iii) Create a VHD file. Project -> new source -> verilog module Give name to the module and then click ok (iv) Write the verilog code in the VHDL editor. (v) To check syntax. Click on fpga device -> process window -> synthesize -> Check syntax and remove errors. (vi) Create constraint file a. Go to implementation constrain file and give a file name and click ok. b. User constrain-> assign package pins c. Save pin assignment and make XST default and click ok. (vii) Implement the design a. Perform implement design. Run translate .map, place and route. b. Generate programming file and them configure device using impact and click finish. c. Select file name .bit and we get identity succeeded. d. Download the program and verify it. RESULT: Thus binary number is converted to octal, decimal and hexadecimal using FPGA and displayed on a seven segment display.

Ex.NO:3 AIM:

READ TOGGLE SWITCHES IN ARM PROCESSOR

To read the toggle switch values and display them on point LEDs using ARM processor. APPARATUS REQUIRED: 4. ARM Evaluation board NXP LPC2148 5. 5V/2A Adapter 6. USB Cable SOFTWARE REQUIRED: 3. Embest IDE 4. Flash Magic ALGORITHM: Step1: Initialize IO port lines. Step2: Initialize P0.19 (A0), P0.22 (A2) as output port. These three lines are the control lines to the decoder, used to generate the chip enable signal for the Point LEDs and the toggle switches. These lines are called as address lines. Step3:a.Initialize data lines P1.16 (DB0) to P1.23 (DB7) 0000as input lines. b. Set the address lines as A1=0, A2=0 and toggle the address line A0 from 0 to 1, to enable the buffer connected to the switches. c. Read the data from the Data bus. Step4: a. Initialize data lines P1.16 (DB0) to P1.23 (DB7) as output lines. b. Write the data read from the switches to the data bus for LEDs. c. Set the address lines as A0=0, A1=0 and A2=0 to enable the latch connected to the LEDs. Step5: Repeat from step 3.

PROCEDURE: 1. Open Embest IDE software and create a new work space. EmbestIDE ->File->new work space->browse->open the saved file from D:/ in

ARM and give project name. 2. Copy the following files from the include files for 2148 and paste it in the new workspace folder. vector.s Flash.Id LCD.s LPC214x.h

3. Create a new file and type the main program in C language. 4. Save the program as filename.c in the new workspace. 5. Add filename.c and vector.s files to the project source file. 6. Set the project settings. (Project->settings) (i)Processor CPU Module: ARM 7 Family: ARM 7 Member: ARM 7 Build tools: GNU tools for ARM Remote Device: SimARM7 Category->Target specific options o o (iv) Assembler Category ->Target specific options o (v)Linker Category->Image entry options o o o Select vector.o file Select little Indian objects Select the Linker script file Flash.Id from the new workspace. Category->Code generation options Category ->General Select little Indian mode Select little Indian mode Specify the name of target CPU: ARM7TDMI

(ii) Remote (iii)Compiler

Click OK to save the project settings. 7. Build the project. Select Build -> rebuild all 8. Check Commands Successfully Executed in the output window which ensures that the program is executed with no errors. 9. Select tools -> Elf to Hex and .hex file is created. Downloading: Open Flash magic Software 1. Select the communications parameters Comport : COM 3 Baud rate : 38400 Device : LPC2148 Interface : None Oscillator Frequency(MHz) : 10.000000 2. Select .hex file from the project. 3. Switch on the kit. 4. Switch JP3 to the program mode so that LED glows and press reset once. 5. Click start to download the program into the kit. 6. Switch JP3 to the execute mode and press reset again. 7. The point LEDs glow according to the toggle switch positions. RESULT: Thus the toggle switch positions are read and displayed on the point LEDs sequentially. SWITCH POSITION HIGH LOW LED ON OFF

EX.NO:4 DISPLAYING TWO DIFFERENT TASKS ON LCD USING ARM AIM: To display two different tasks on LCD using ARM7 processor APPARATUS REQUIRED: 7. ARM Evaluation board NXP LPC2148 8. 5V/2A Adapter 9. USB Cable SOFTWARE REQUIRED: 5. Embest IDE 6. Flash Magic PROCEDURE: 1. Open Embest IDE software and create a new work space. EmbestIDE ->File->new work space->browse->open the saved file from D:/ in ARM and give project name. 2. Copy the following files from the include files for 2148 and paste it in the new workspace folder. vector.s flash.id def.h ucos_ii.h frmwrk.h includes.h lpc214x.h os_cfg.h RTOS_Lib_Lib os_cpu.h

3. Create a new file and type the main program in C language. 4. Save the program as filename.c in the new workspace. 5. Add filename.c and vector.s files to the project source file. 6. Set the project settings.

(Project->settings) (i)Processor CPU Module: ARM 7 Family: ARM 7 Member: ARM 7 Build tools: GNU tools for ARM Remote Device: SimARM7 Category->Target specific options o o (iv) Assembler Category ->Target specific options o (v)Linker Category->Image entry options o o o o o o Select vector.o file Select little Indian objects Select the Linker script file Flash.Id from the new workspace. Create a new module path and include RTOS library file from the workspace. Create two new entries and enter lc and lgcc. Create two new entries include following files 7. Build the project. Select Build -> rebuild all C:\Embest IDE\Build\Xgcc_arm elf\arm elf\lib C:\Embest IDE\Build\Xgcc_arm elf\lib\gcc\lib\arm elf\3.0.2 Category-> add library searching path Category->Code generation options Category ->General Category ->Include object and library modules Select little Indian mode Select little Indian mode Specify the name of target CPU: ARM7TDMI

(ii) Remote (iii)Compiler

Click OK to save the project settings.

8. Check Commands Successfully Executed in the output window which ensures that the program is executed with no errors. 9. Select tools -> Elf to Hex and .hex file is created. Downloading: Open Flash magic Software 1. Select the communications parameters Comport : COM 3 Baud rate : 38400 Device : LPC2148 Interface : None Oscillator Frequency(MHz) : 10.000000 2. Select .hex file from the project. 3. Switch on the kit. 4. Switch JP3 to the program mode so that LED glows and press reset once. 5. Click start to download the program into the kit. 6. Switch JP3 to the execute mode and press reset again. 7. A UP counter in Task 1 is displayed on Line 1 of LCD and a DOWN counter in Task 2 is displayed on Line 2 of LCD. RESULT: Thus the two different tasks of UP and DOWN counter are displayed on 2 line LCD using ARM7 processor. Mesg Task1: 0005 Mesg Task2: FFF4

EX.No:5 AIM:

IMPLEMENTATION OF FSM USING FPGA

To create a FSM with the following given specification and to implement it on FPGA. SPECIFICATION: a) A 3-bit ripple counter and a determined sequence counter of sequence 0,1,3,5,7,0 have to be combined in a design which switches among themselves according to the select input. b) During the selection of determined sequence counter if the present state is not available in the given determined sequence the count values has to move to the next nearest value independent of the pulse. SOFTWARE AND HARDWARE REQUIREMENTS: Synthesis tool : FPGA kit PROCEDURE: (i) Start the xilinx project navigator . Start -> programs -> xilinx ISE8.1i. (ii) Create a new project .file -> new project -> specify name -> next. (iii) Create a VHD file. Project -> new source -> verilog module Give name to the module and then click ok (iv) Write the verilog code in the VHDL editor. (v) To check syntax. Click on fpga device -> process window -> synthesize -> Check syntax and remove errors. (vi) Create constraint file a. Go to implementation constrain file and give a file name and click ok. b. User constrain-> assign package pins c. Save pin assignment and make XST default and click ok. (vii) Implement the design a. Perform implement design. Run translate .map, place and route. b. Generate programming file and them configure device using impact and click finish. : Xilinx 8.2i SPARTAN-3

c. Select file name .bit and we get identity succeeded. d. Download the program.

RESULT: Thus a FSM with given specification is created and implemented on FPGA.

EX.NO:6 INTERRUPT PERFORMANCE CHARACTERISTICS OF ARM AND FPGA AIM: To study the interrupt performance characteristics of ARM and FPGA and determine their efficiency APPARATUS REQUIRED: 10. ARM (LPC2148)+ FPGA(Spartan-3E [XC3S250E] ) Evaluation board 11. 5V/2A Adapter 12. USB Cable SOFTWARE REQUIRED: 7. Embest IDE 8. Flash Magic 9. Xilinx 8.2i 10. Top view programmer Xilinx Application software PROCEDURE: ARM: 1. Open Embest IDE software and create a new work space. EmbestIDE ->File->new work space->browse->open the saved file from D:/ in ARM and give project name. 2. Copy the following files from the include files for 2148 and paste it in the new workspace folder. vector.s Flash.Id LCD.s LPC214x.h

3. Create a new file and type the main program in C language. 4. Save the program as filename.c in the new workspace. 5. Add filename.c and vector.s files to the project source file. 6. Set the project settings. (Project->settings) (i)Processor CPU Module: ARM 7 Family: ARM 7 Member: ARM 7

Build tools: GNU tools for ARM Remote Device: SimARM7 Category->Target specific options o o Select little Indian mode Specify the name of target CPU: ARM7TDMI

(ii) Remote (iii)Compiler

(iv) Assembler Category ->Target specific options o (v)Linker Category->Image entry options o o o Select vector.o file Select little Indian objects Select the Linker script file Flash.Id from the new workspace. Category->Code generation options Category ->General Select little Indian mode

Click OK to save the project settings. 7. Build the project. Select Build -> rebuild all 8. Check Commands Successfully Executed in the output window which ensures that the program is executed with no errors. 9. Select tools -> Elf to Hex and .hex file is created. Downloading: Open Flash magic Software 1. Select the communications parameters Comport : COM 3 Baud rate : 38400 Device : LPC2148 Interface : None Oscillator Frequency(MHz) : 10.000000 2. Select .hex file from the project. 3. Switch on the kit.

4. Switch JP3 to the program mode so that LED glows and press reset once. 5. Click start to download the program into the kit. 6. Switch JP3 to the execute mode and press reset again. 7. The point LEDs glow according to the toggle switch positions.

OBSERVATION : PARAMETER Interrupt clock frequency upto 400KHz Interrupt clock frequency more than 400KHz RESULT: Thus the interrupt performance characteristics of ARM and FPGA are studied. On comparison, ARM counts at slow speed because it consumes more instruction cycles and FPGA is more efficient for servicing and processing external interrupt pulses. Count all interrupt pulses Misses some interrupt pulses FPGA Count all interrupt pulses ARM Count all interrupt pulses

EX.No:7 HARDWARE AND SOFTWARE PARTITIONING USING ARM AND FPGA AIM: To partition the hardware and software using ARM7LPC2148 and Spartan 3 FPGA. APPARATUS REQUIRED: 1.ARM7 LPC2148 2.Sparten 3FPGA PROCEDURE: ARM: 1. Open Embest IDE software and create a new work space. EmbestIDE ->File->new work space->browse->open the saved file from D: / in ARM and give project name. 2. Open ARM_FPGA files. Select arm -> Partition example(2). 3. Copy the files flash.id ,LPC2148,Get ADC input, vector, arm board and paste in our project in D:\ARM 4. Add ADC input and vector files in our project and save the workspace. 5. Select project -> settings and perform the following. 6. Change the settings Project->settings (i)Processor CPU Module: ARM 7 Family: ARM 7 Member: ARM 7 Build tools: GNU tools for ARM (ii) Remote Remote Device: SimARM7 (iii)Compiler Category->Target specific options Select little Indian mode Specify the name of target CPU: ARM7TDMI (iv) Assembler

Category ->target specific options Select little Indian mode (v)Linker Category->Image entry options Select vector.s file Category->Code generation options Select little Indian objects Category ->General Link script files open Flash Id from the project. Give OK for the settings. (vi) Select Build -> rebuild all We get Commands Successfully Executed which ensures that program is executed and there is no error. (vii)Select tools -> Elf to Hex and hex file is created. Downloading: (i)Open Flash magic Software Check the port baud rate etc., Comport: COM 3 Baud rate: 38400 Device: LPC2148 Interface: None (ii)Select hex file from the project (iii)Switch on the kit and switch it on to the program mode so that LED glows. (iv)Press reset in kit (v)Click start for downloading in system so that the program is downloaded to kit. FPGA: 1. Open the xilinx8.1i and create a new project with appropriate specification. 2. Open ARM_FPGA files and select FPGA_92i ->partition example1 and copy .UCF and .VHD files. 3. Copy .UCF file and .VHD files and paste in our xilinx file. 4. In xilinx add source, add UCF and VHD files. 5. Perform check syntax, synthesize XST, implement design and generate programming file.

6. Right click to add xilinx device and add .bit file. 7. Click read arm. Bit file and change file type as XSVF file. Create a XSVF file. Give file name and source it. 8. Right click -> program ->click ok. We will get program succeeded. 9. Select readarm.bit and select XSVF output file and click stop writing file. 10. Open FE top view programmer from the desktop and add XSVF file to our file. Click reset on FPGA When the stops blinking stops click configure. 11. Move the arm to execution mode and click reset to view the corresponding output.

RESULT: Thus the partitioning the hardware and software using ARM7LPC2148 and sparten3 FPGA is performance

EX.NO:8 IMPLEMENTATION OF WIRELESS COMMUNICATION PROTOCOL USING ZIGBEE WIRELESS MODULE AIM: To implement wireless communication protocol using zigbee wireless module Hardware required: ARM wireless sensor network trainer Software required: EmbestIDE,flah magic PROCEDURE: 1. Create a new file in the local disk D:/ of computer. 2. Open Embest IDE software and create a new work space. EmbestIDE ->File->new work space->browse->open the saved file from D:/ in ARM and give project name. 3.From the ARM files for copy the nessary files in the project created and paste in D:/. 4. Add file transmit msg,vector.s and flash.id files to the project source file. 5. Change the settings Project->settings (i)Processor CPU Module: ARM 7 Family: ARM 7 Member: ARM 7 Build tools: GNU tools for ARM (ii) Remote Remote Device: SimARM7 (iii)Compiler Category->Target specific options Select little Indian mode Specify the name of target CPU: ARM7TDMI

(iv) Assembler Category ->target specific options Select little Indian mode (v)Linker Category->Image entry options Select vector.s file Category->Code generation options Select little Indian objects Category ->General Link script files open Flash Id from the project. Give OK for the settings. Category ->Include object and library modules Create a new file. D:\arm\project name\RTOS\RTOS_lib.lib Create a new file by typing lc Create a new file by typing lgcc Category-> add library searching path. C:\Embest IDE\Build\Xgcc_arm elf\arm elf\lib C:\Embest IDE\Build\Xgcc_arm elf\lib\gcc\lib\arm elf\3.0.2 (vi) click ok and save source the workspace. (vii)Select Build -> rebuild all We get Commands Successfully Executed which ensures that program is executed and there is no error. (viii)Select tools -> Elf to Hex and hex file is created. Downloading: (i)Open Flash magic Software Check the port baud rate etc., Comport: COM 3 Baud rate: 38400 Device: LPC2148 Interface: None (ii)Select hex file of browse Zigbee transmit message file. (iii) reset the kit and set it in programming mode and click start. (iv)Note the kit which acts as transmitter after setting to execution mode.

(v)Select COM 7 and browse zigbee receive message file. (vi) Reset the kit after setting in programming mode and click start. (vii) After finish select execution mode in kit and press reset. (viii) Note which acys as receiver and keep the kit back in programming mode. (ix) Select COM 3 and select zigbee experiment2.hex file. (x) Set the kits in programming mode and reset the kit.clck start. (xi) After finish set the receiver in executon mode and then set the transmitter in execution mode and press reset. (xii) check if the message has been transmitted to the receiver.

RESULT: Thus the wireless communication protocol using zigbee wireless module is implemented.

Das könnte Ihnen auch gefallen