Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. (10 marks) Assuming that the chip has just been reset, explain how to program the registers of SPI1, so that it is set

   

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.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Computer Architecture Fundamentals And Principles Of Computer Design

Authors: Joseph D. Dumas II

2nd Edition

1032097337, 978-1032097336

More Books

Students also viewed these Programming questions