Question: 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  

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!