Question: Assume that you have an ARM Cortex M processor, with the instruction set as done in the class. Use the bit - banding feature of
Assume that you have an ARM Cortex M processor, with the instruction set as done in the class. Use the bitbanding feature of ARM Cortex M processor and create a two functional routines for doing the SPI read and SPI write. Assume that each bitbanding bit is an IO input or output of the chip like a general purpose IO gpio
Name the two functional routines as :
cmspiwriteuint address, uint data ; master write to an address which is bits wide uint a data value which is bits wide uint
uint cmspireaduint address ; read a uintbit data from the slave using an bit address
A Write the functions in C routine as you would normally do to maintain a processor independent code
B Convert your C routine to Assembly using Compiler techniques. You can also use your intuition, to ensure that the C code and assembly should be equivalent in functionality
C Assume each instruction takes processor clock cycle, how many clock cycles does it take to do a write function b read function
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
