Question: / * * EX: 9 . 2 Create two new files: src / spi . c include / spi . h TASK: 1 . In
EX:
Create two new files:
srcspic
includespih
TASK:
In "spi.c declare and implement a function "spiinit" that will
initialise SPI in unbuffered mode, such that data can be written
to the shift register that controls the segment display.
This function should also enable the SPI interrupt via the IE bit
in INTCTRL.
Declare and implement the function spiwriteuintt b which
will write the byte b out via the SPI interface.
Declare and implement an ISR that handles the SPI interrupt, and
also creates a rising edge on the DISP LATCH net.
You will need to add some code to spiinit to enable the
required pins as outputs.
Declare prototypes for these functions in "spi.h and include
"spi.h at the top of this file.
Once this exercise is complete, uncomment the lines below. The
segment display should be blank after this code executes.
CODE: Write your code for Ex in spi.c and spi.h
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
