ELEC211: Introduction to the ARM Microprocessor - Engineering Assignment Help

Download Solution Order New Solution
Assignment Task:

Introduction to the ARM microprocessor 
1. Object  To explore the basic features of the ARM Cortex M0 microprocessor. 
2. Equipment 
• Personal computer with Microsoft Windows (tested on Microsoft Windows 10 Professional) or macOS/Mac OS X with CodeWeavers CrossOver (tested on macOS Catalina 10.15.1 and CrossOver 19.0.1) 
• Stop watch 
3. Introduction The ARM Cortex M0 microprocessor is a modern 32-bit processor designed by a British company, ARM Holdings PLC, based in Cambridge. The major advantage of an ARM processor is its low power consumption. This makes it the ideal choice for battery powered devices which require digital computation. For example, the great majority of all modern digital mobile phones use an ARM processor. The ARM microprocessor is manufactured by most semiconductor companies under licence; the one used in this experiment is made by Freescale (formerly called Motorola). The purpose of this experiment is to become familiar with the ARM Cortex M0 microprocessor and this will be achieved by examining the operation of simple computer programs that have already been written. This experiment will help you on being more familiar with the assembly language and see practically how the ARM microprocessor works. This will also help you to recall how simple instructions work, arithmetic and logic operations including negative numbers, branches, flags and conditional executions. This experiment is based upon the simulation of the Freescale integrated circuit, KL46Z256, containing the ARM Cortex M0 processor which is mounted on a printed circuit board known as the Freescale Freedom FRDM-KL46Z. This development board can be connected to a host computer so that programs can be prepared on the PC and downloaded and executed (or run) on the ARM processor. The Freedom board can also be connected to other boards, commonly called ‘shields’, through a header that is Arduino compatible. One of these boards is the Mbed shield. In this experiment you will use the Keil uVision environment for writing code and debugging. The Keil uVision software is a professional package that is used in industry and can be used to link C and C++ programs with assembly language programs. The Keil uVision debugger is a powerful tool for finding bugs in programs and is useful for investigating the characteristics of the ARM Cortex M0 microprocessor.
 
4. Getting started First you need to configure your personal computer with the Keil uVision software. This will depend on your operating system (OS). If you have a Microsoft Windows OS please refer to Subsection 
4.1, otherwise, if you have a macOS/Mac OS X please refer to Subsection 4.2. 4.1. Configuration of Keil uVision under a Microsoft Windows OS First you need to download Keil uVision trial version from: 

For downloading the software, you are required to complete the form with your personal details and click on “Submit”. Save the Keil uVision installer to your computer by right-clicking on MDK529.EXE as shown in Figure 1.

armkeil

After it has been downloaded, locate and double-click on it. The “User Account Control” window will open, click on “Yes”

(1) to allow the Keil uVision installer to start. The Keil uVision installation window will open. Click “Next”

(2) to continue, accept the License Agreement

(3) and click “Next” (4). On “Destination Folder -> Pack” select the folder path as: C:\users\<username>\AppData\Local\Arm\Packs where “<username>” is the username of your Windows user account

(5), then click on “Next”

(6). Fill in the text boxes with your personal information

(7) and click “Next”

(8). The Keil uVision installer will start copying all the files and configuring your system. During the installation, ULINK drivers will be required to be installed and a “Windows Security” window will open asking you to confirm their installation. Click on “Install”

(9) to proceed. Finally, uncheck the “Show Release Note” checkbox

(10) and click on “Finish”

(11) to finalise the installation. All the steps required to install Keil uVision are shown in Figure 2. 

ELEC211

fig2

The Pack Installer utility will be automatically executed after the Keil uVision installation is terminated (Figure 3). This utility is used to install, update, and remove software packs. Its screen layout has on the left side the “Devices/Boards” window which is used to lists devices grouped by vendor and device. While on the right side there is the “Packs/Examples” window which is used to list software packs and example projects that can be used with the device or board you have selected. 
 

fig3

During the first execution, a dialog window welcoming you to the Pack Installer will open, uncheck the “Show this dialog at startup” and click “OK”. This will start to update the pack descriptions. After this action is done, select “All Devices” on the “Devices/Boards” window. Then on the “Packs/Examples” window under “Device Specific” search the “Keil::Kinetis_KLxx_DFP” pack and click “Install”. The Packet Installer will download and install this pack. After this action is done, a message will be displayed on the “message output area” window at the bottom of the Pack Installer. Then click on “Boards” in the “Devices/Boards” window, and in the search area write “KL46Z”. Select “FRDM-KL46Z” and on the “Packs/Examples” window under “Device Specific” install “NXP::FRDMKL46Z_BSP” and “NXP::MKL46Z4_DFP” packs. Then under “Generic” install the “NXP::Middleware” and “NXP::Multicore” packs and update the “ARM:CMSIS-Driver” pack. A dialog window asking to agree to a license for each pack may open as shown in Figure 4, agree to the license and click on “Next” to continue with the installation of the related pack. After these actions have been completed, close the Pack Installer utility. 

fig4

Find the ‘Exp 26 (ARM microprocessor) - Demo code.zip’ file on VITAL for your module (ELEC222, ELEC224 or ELEC273). Save the zip file to a location of your choice, then open it, extract it and place the program directory at a suitable location. Open the directory and double click on the “uvproj” file to start Keil uVision. This will launch the ‘Exp 26 (ARM microprocessor) - Demo code’ project. 4.2. Configuration of Keil uVision under a macOS/Mac OS X Keil uVision is a software that runs under Microsoft Windows OS. For this reason, you are required to download and install a Microsoft Windows OS emulator called CrossOver. This emulator is provided by the CodeWeavers company, a trial version lasting 14 days is available and it can be downloaded from. For downloading the software, you are required to insert your name and email address. This will enable the “Download Trial Now” button. After completing the form and clicking on the button, the browser should automatically ask you to download the “crossover-19.0.1.zip” file. Save the zip file to a location of your choice, then extract it and copy the “CrossOver” program into the “Applications” folder. Launch CrossOver, an alert message should open as shown in Figure 4. Make sure that CrossOver was downloaded from “www.codeweavers.com”. Click “Open” to continue and another message should open to give you the option to launch CrossOver in different versions (Figure 5), click “Try now” to run the trial version. This will launch CrossOver in trial mode and another dialog window should open asking you if the CodeWeavers company can log statistics about the usage of the application, click on the corresponding button depending on your personal preferences. You have now CrossOver 
correctly installed and ready to be used. Click on the icon at the top left corner, the “COLLECTIONS/BOTTLES” window should open as shown in Figure 6. 
 

MacOs

Crossover

Q1. Which part of the machine code identifies the register used? 
 
Q2. Which part of the machine code gives the number to be moved into that register? 
 
Write the answers to all questions in your notebook. You will need these answers at the end of the lab to complete the test sheet. 6. Arithmetic Operations Single step the instruction at address 0x0000025E and note the contents of R4.   
 
Q3. What is this equal to? 

Continue single stepping until you reach address IA+0x12 (in this example address 0x0000026A).  Note the contents of the registers after each instruction and work out what each instruction does. 
 
Q4. Is the order of the registers in the mnemonics important? Why? 
 
Note that negative numbers are given in 2's complement format. For example, to find the 2's complement format for -1,045,387,88310 first convert +1,045,387,88310 to hexadecimal which gives 0x3E4F5A6B. Then convert each digit to its 1's complement equivalent using the following inversion table. 
 
 
table

So the 1's complement of -1,045,387,88310 is 0xC1B0A594. Next, add 1 to find the 2's complement so the 2's complement format for -1,045,387,88310 is 0xC1B0A595.  You can easily check this using the calculator in “Programmer” view. Next, we want to run the program again, but with different values in registers R2 and R3. In the ‘Registers’ window, double left click on the contents of R2 - this will allow you to modify the contents of the register - change it to 0x00000064. Similarly, change R3 to 0x0000000A and change the contents of the program counter to IA+0x6 (in this example to 0x0000025E).  Now single step the program from address IA+0x6 (in this example address 0x0000025E) to address IA+0x12 (in this example address 0x0000026A). Make a note of the contents of the registers. 
 
Q5. Are these the values you expected? 
 
Single step the program from address IA+0x6 (in this example address 0x0000025E) starting with numbers of your choice in R2 and R3 and note the contents of the registers after execution.   
 
Q6. Again are these the values you expect? 
                                                                                          
7. Logical Operations Continue single step through the program to address IA+0x1C (in this example address 0x00000274). Looking in the registers window, the last four digits in R2 and R3 should be 0011 and 0101 respectively (when in hexadecimal format). Draw a truth table for input variables A and B (where A is given by a value of a digit in R2 and B is given by the value of a digit in R3) and output variable C given by the value of the digits held in R4. 
 
Q7. What logic function has been performed? 
 
Single step the next 8 instructions and note the contents of R5, R6, R0 and R1. Identify each logic function executed. Clearly the order of the registers in the mnemonic for bit clear (BIC) is important.   
 
Q8. Is the order important for the other functions? 
 
8. Using branches Single step through to address IA+0x30 (in this example address 0x00000288). 
 
Q9. What happens to the program counter when the branch instruction (B) is executed? 
 
Q10. If the instruction at address IA+0x30 (in this example address 0x00000288) is executed 5 times, what would the contents of R2 be? 
 
The next section requires a stopwatch, you can use a mobile phone app. Clear the stopwatch so that it reads 0:00:00. Reset R2 to zero. Set the stopwatch running at the same time as you start the program running using F5. After approximately 20 seconds, stop the watch and the program simultaneously - the program can be stopped by either clicking on the    icon in the toolbar or selecting ‘Stop’ from the ‘Debug’ drop down menu. Record the content of R2 and the exact time on the stopwatch. Set the program and the stopwatch going for a further 20 seconds and again stop them simultaneously. Again record the time and value in R2. The value held by R2 should now be approximately twice the value after the initial 20 seconds. 
 
Q.11 Why? 
 
Calculate the number of times R2 has been incremented in 1 second and the time taken for R2 to be incremented once. The answers calculated after approx. 20 and 40 seconds should be roughly the same. Reset the program counter to IA+0x32 (in this example 0x0000028A). The program starting from address IA+0x32 (in this example 0x0000028A) is identical to the program starting at IA+0x2C (in this example address 0x00000284) except that it has one additional instruction in the loop (which does nothing). Repeat the experiment again and find the time taken for this program loop to be executed once. Next set the program counter to IA+0x3A (in this example 0x00000292) and repeat the experiment again. Draw a graph of the time taken for the program loop to execute on the vertical axis against the number of instructions in the loop including the branch instruction on the horizontal axis (use MS Excel or MATLAB…etc). There should be three points on your graph, which are roughly in a straight line. The add instruction takes one clock cycle to execute whereas the branch instruction takes more than this.   
 
Q12. What is the time taken by one clock cycle? 
 
Q13. How many clock cycles are required for the branch instruction?   9. Flags The ARM Cortex M0 processor has four 'flags' which can give information about the action of the previous instruction e.g. if the sum of two numbers is zero then the zero flag, Z, is set. The other flags are negative, N, carry, C, and overflow, V. Reset the program counter to IA+0x44 (in this example 0x0000029C) and single step through the program to IA+0x50 (in this example 0x000002A8) making a note of the values held in the registers and also the state of the flags in registers window after each instruction. Note that only instructions with a mnemonic ending with an ‘S’ actually affect the flags - e.g. the first instruction, MOVS r2, #0x00, sets the zero flag to 1 and the second instruction, MOVS r3, #0x01, clears the zero flag to 0. However, the next instruction, MOV r4, r2, leaves the flags unchanged but the following one MOVS r4, r2 sets the zero flag. Write down the most significant binary digit of R4, R5 and R6 and compare it with the negative flags. Change the value held in R2 to 0xFFFFFFFF, reset the program counter to and single step from address IA+0x46 (in this example address 0x0000029E). Note values held in the registers and the state of the flags after each instruction. Single step the program from address IA+0x46 (in this example address 0x0000029E) with 0x7FFFFFFF in R2. 10. Conditional execution Flags can be used to determine if a branch instruction is executed or not e.g. for a mobile phone this could be 'if credit is less than 10p then disable out going calls'. This is known as conditional execution. Look at the machine code for the 8 branch instructions at addresses IA+0x62 (in this example address 0x000002BA) to IA+0x7E (in this example address 0x000002D6) inclusive.  The second hexadecimal digit of the machine code determines the condition of the instruction e.g. CS, CC, EQ, NE, etc. Single step the program from address IA+0x50 (in this example address 0x000002A8) to IA+0x82 (in this example address 0x000002DA).  Note that the addition ADDS at memory address IA+0x60 (in this example address 0x00002B8) either sets or clears the flags and that the carry and zero flags have been set in this case. The following ADD instructions at IA+0x64, IA+0x68, IA+0x6C etc. (in this example at 0x000002BC, 0x000002C0, 0x000002C4 etc.) do not change the flags. 
 
Q14. Which of the conditional branch instructions have been executed and why? 
 
Now change the contents of register R1 to 0x01000000 and single step the program again from address IA+0x54 (in this example address 0x000002AC) to address IA+0x82 (in this example address 0x000002DA). The negative and overflow flags should now be set. 
 
Q15. Have the conditional branch instructions executed as expected? Why? 

This ELEC211: Engineering Assignment has been solved by our Engineering Experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.

Be it a used or new solution, the quality of the work submitted by our assignment experts remains unhampered. You may continue to expect the same or even better quality with the used and new assignment solution files respectively. There’s one thing to be noticed that you could choose one between the two and acquire an HD either way. You could choose a new assignment solution file to get yourself an exclusive, plagiarism (with free Turnitin file), expert quality assignment or order an old solution file that was considered worthy of the highest distinction.

Get It Done! Today

Country
Applicable Time Zone is AEST [Sydney, NSW] (GMT+11)
+

Every Assignment. Every Solution. Instantly. Deadline Ahead? Grab Your Sample Now.