1. (10 marks) Assuming that the chip has just been reset, explain how to program the...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
1. (10 marks) Assuming that the chip has just been reset, explain how to program the registers of SPI1, so that it is set to slave mode and an interrupt is generated after each byte of data is received. Assume all clock settings to be similar to Section A. The names, addresses and values for all relevant registers should be included and you should justify the values chosen for each field. Do not include any code in your answer. 2. (10 marks) In the C programming language, write an interrupt handler spi_irq () that is called when an SPI receive event occurs. If data has arrived in the receive data register and its value is less than 96, then set Digital Pin 4 to 1, otherwise to 0. If an OVERRUN error has occurred, then set Digital Pin 5 to 1, otherwise to 0. Your answer should not use any library calls or include files (except for digitalWrite(pin, value)), must be clearly commented and use CMSIS naming scheme for all registers and flags. You can assume that SPI and other parts of the system, such as NVIC and PIO, have been already programmed. 3. (5 marks) In the context of SPI to UART data transfer (as described in part 2), explain the purpose of using direct memory access. Give an example of vate situation in which it is not advantageous over the implementation of part 2. 1. (10 marks) Assuming that the chip has just been reset, explain how to program the registers of SPI1, so that it is set to slave mode and an interrupt is generated after each byte of data is received. Assume all clock settings to be similar to Section A. The names, addresses and values for all relevant registers should be included and you should justify the values chosen for each field. Do not include any code in your answer. 2. (10 marks) In the C programming language, write an interrupt handler spi_irq () that is called when an SPI receive event occurs. If data has arrived in the receive data register and its value is less than 96, then set Digital Pin 4 to 1, otherwise to 0. If an OVERRUN error has occurred, then set Digital Pin 5 to 1, otherwise to 0. Your answer should not use any library calls or include files (except for digitalWrite(pin, value)), must be clearly commented and use CMSIS naming scheme for all registers and flags. You can assume that SPI and other parts of the system, such as NVIC and PIO, have been already programmed. 3. (5 marks) In the context of SPI to UART data transfer (as described in part 2), explain the purpose of using direct memory access. Give an example of vate situation in which it is not advantageous over the implementation of part 2.
Expert Answer:
Related Book For
Computer Architecture Fundamentals And Principles Of Computer Design
ISBN: 9781032097336
2nd Edition
Authors: Joseph D. Dumas II
Posted Date:
Students also viewed these programming questions
-
Design a Java class that represents a cache with a fixed size. It should support operations like add, retrieve, and remove, and it should evict the least recently used item when it reaches capacity.
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
The city of Toledo has received a proposal to build a new multipurpose outdoor sports stadium. The expected life of the stadium is 20 years. It will be financed by a 20- year bond paying 8 percent...
-
Materials issued for the current month are as follows: Requisition No. Material Job No. Amount 103.....................................Plastic..........................400.................$ 2,800...
-
1. At a given point in a soil mass the major principal stress is 61.6 kPa and the minor principal stress is 54.5 kPa. 2. Determine the normal stress (kPa) acting on a plane that is 12 degrees counter...
-
In a recent season, hockey player Evgeni Malkin scored 27 goals in 57 games he played. Assume that his goal production stayed at that level for the next season. Find the probability that he would get...
-
The market for smoothies is perfectly competitive and the market demand schedule is in the first table. Each of the 100 producers of smoothies has the costs given in the second table when it uses its...
-
Assume that one of your clients asks for your assistance in allocating the $ 9 . 0 0 0 , 0 0 0 cost of a 1 0 0 % acquisition of a competitor firm. You estimate the fair value of the net assets on the...
-
Balance by using the half-reaction method? NH4CIO4(s) + Al(s) Al2O3(g) + HCl(g) + N2(g) + HO(g)
-
You are conducting a marketing research project for Starbucks Coffee. Research online to determine the main factors affecting consumer preference for certain coffee brands. Also, determine the...
-
Select an industry of your choice. Using secondary sources, obtain industry sales and the sales of the major firms in that industry for the past year. Estimate the market shares of each major firm....
-
Have you ever seen your companys organization chart? If so, how decentralized is it?
-
Which assigned counsel method do you find to be the better method for appointing lawyers?
-
What do you think of the ability of judges to choose the attorney who will represent an indigent defendant in the ad hoc assigned counsel system? Should there be some other method to ensure that...
-
Telta Inc. issued $15,000,000 of 12%, 40-year convertible bonds on November 1, 2017, at 97 plus accrued interest. The bonds were dated July 1, 2017, with interest payable January 1 and July 1. Bond...
-
One study found that the elderly who do not have children dissave at about the same rate as the elderly who do have children. What might this finding imply about the reason the elderly do not dissave...
-
Does an architecture that has fixed-length instructions necessarily have only one instruction format? If multiple formats are possible given a single instruction size in bits, explain how they could...
-
Given that many systems have a single bus that can be controlled by only one bus master at a time (and thus the CPU cannot use the bus for other activities during I/O transfers), explain how a system...
-
A circuit is to be built to add two 10-bit numbers x and y plus a carry in. (Bit 9 of each number is the most significant bit [MSB], and bit 0 is the least significant bit [LSB]. c 0 is the carry in...
-
Pegasus Veterinary Hospital (PVH) is a partnership of five veterinarian surgeons who specialize in treating horses. PVH is located in a $25 million facility on 20 acres of land, employing over 40...
-
A tender evaluation method specifies 60% price and 40% quality. What is the weighted score of a tender that scored 80 points (out of 100) for price and 60 for quality?
-
You are a recently appointed purchasing manager who is overseeing terms and con- ditions of contract for an important international purchase with a UN country. What rules should you be particularly...
Study smarter with the SolutionInn App