Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Section A - Peripherals (25 marks) A data sheet for the SAM3X Serial Peripheral Interface (SPI) peripheral is included at the end of this paper.
Section A - Peripherals (25 marks) A data sheet for the SAM3X Serial Peripheral Interface (SPI) peripheral is included at the end of this paper. In answering this question, you must give all constants for register addresses and values in hexadecimal. 1. (10 marks) Assuming that the chip has just been reset, explain the sequence required to initialize SP11 in master mode. Enable the Variable Peripheral Select mode, such that you can address up to 4 peripheral devices without using a decoder. Configure the protocol mode (clock polarity and phase) for chip select 0 such that an 8-bit data is shifted on the rising edges and captured on the falling edges of the clock. Assuming a MCK of 84 MHz, set the baud rate to 4 Mbps. Do not enable any other mode or option (for example, interrupts or fault detection). 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 a code sequence which will send 0 to 9 as 8-bit values to slave 1 (connected to NPCS1) using SP11. Use polling, and assume that SP11 is already configured using your answer in part 1. Do not enable any other mode or option (for example, last transfer signals or shutdown). Your answer should not use any library calls or include files, must be clearly commented and use meaningful variable names. 3. (5 marks) Explain clearly how a UART transmits data, and draw the waveform required to transmit 8-bit value 0x03 with odd parity. Annotate your waveform to show where each bit is transmitted. Label both x and y axis, assuming it is measured from a SAM3X with a baudrate of 1000 bps. Section A - Peripherals (25 marks) A data sheet for the SAM3X Serial Peripheral Interface (SPI) peripheral is included at the end of this paper. In answering this question, you must give all constants for register addresses and values in hexadecimal. 1. (10 marks) Assuming that the chip has just been reset, explain the sequence required to initialize SP11 in master mode. Enable the Variable Peripheral Select mode, such that you can address up to 4 peripheral devices without using a decoder. Configure the protocol mode (clock polarity and phase) for chip select 0 such that an 8-bit data is shifted on the rising edges and captured on the falling edges of the clock. Assuming a MCK of 84 MHz, set the baud rate to 4 Mbps. Do not enable any other mode or option (for example, interrupts or fault detection). 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 a code sequence which will send 0 to 9 as 8-bit values to slave 1 (connected to NPCS1) using SP11. Use polling, and assume that SP11 is already configured using your answer in part 1. Do not enable any other mode or option (for example, last transfer signals or shutdown). Your answer should not use any library calls or include files, must be clearly commented and use meaningful variable names. 3. (5 marks) Explain clearly how a UART transmits data, and draw the waveform required to transmit 8-bit value 0x03 with odd parity. Annotate your waveform to show where each bit is transmitted. Label both x and y axis, assuming it is measured from a SAM3X with a baudrate of 1000 bps
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started