Name: Ian Van Horn Email: imvanhorn1@gmail.com
HW 10 SIP
This
assignment requires Vivado and the Pmod ALS sensor
Task 1: Light sensor.(100 points).
Figure 1: Changes to constraints file
Code is found in the textbook
Module description:
SPI leader reciever module:
This module configures the FPGA to approptiatly read
in data from a slave transmitter. miso is the serial input of data.
data is the output for tecieved data. sck is the clock signal sent to
the slave. ss is slave select, it tells the slave to transmit.get busy
and ready help determine when
data reading should be done, and communicate when it is being done
binarytoBCD:
This module converts the binary data so it is easier
to display in decimal on the LCD. Binary is base 2 and dec is base 10,
so the binary needs to be changed into sections of ones, tens, huns,
and thous. To do theis division and the modolus operator are used.
Decoder 7 seg:
This module decodes the BCD output to the format for
display on the 7 segment with a case statment.
sevenseg_driver
This module cycles between dislpaying the numbers in
the different orders of magnitude positions (ones, tens, huns, thous)
so fast it appears all are displayed at once.
SPI_lightsensor
This module connects all the previous modules and
triggers "get" to tell the SPI leader follower when to get data.
Video 1: ALS Sensor
Conclusion: At first I didnt realize the code was in the textbook so I
was trying to write all the modules by my self. I failed. I did get
a better understanding of SPI though.