Project Info
Author: Chris
Difficulty: Medium
Time Invested: 2 Hours
Prerequisites:
Take a look at the above
tutorials before continuing
to read this tutorial.
Author: Chris
Difficulty: Medium
Time Invested: 2 Hours
Prerequisites:
Take a look at the above
tutorials before continuing
to read this tutorial.
In this tutorial the two types of SPI devices that exist in the world will be introduced: the SPI Master and the SPI Slave. The SPI Master controls the flow communication on the dataline while SPI Slave waits for contact from the Master before reading or writing data.
Purpose & Overview of this project
This tutorial will use two PIC 18F452 microcontrollers to create one SPI Master device and one SPI Slave device. The SPI Master should be continuously sending the SPI Slave commands to change the status of an output port. The output port on the slave will consist of 7 LEDs, which should start counting from 255 downto 0, in short, 0.5 second steps.
To create the SPI interface we will take a look at the SPI hardware already available on the PIC microcontroller and see how to use the C18 libraries to configure and communicate using the hardware SPI module interface.