Lab 4: TWI Temperature Sensor

In this lab, you will implement a basic TWI driver and use it to interface with a TWI temperature sensor that is present on Ben’s Board.

A framework has been provided for you, including an implementation of a main function with a test procedure in place. This lab depends on functioning LCD driver code from the previous lab. Notice that the structure of the skeleton code is the same. The main.c file is updated for testing the temperature sensor readings, a twi/ directory is added, and the src/Makefile.am file is updated.

You will need to refer to the:

The TWI protocol itself is very simple. Pick a good value for the bitrate register that will give you 100 KHz transmission. Do not use the prescaler (set prescaler = 1). Make sure you understand how addressing works!

Checkoff on implementing the functionality tested by the main() function. You must display the temperature in degrees Celsius, and it must respond to changes in temperature (e.g. placing a finger on the sensor should show an increased temperature).

Can you implement to show Fahrenheit instead?

Only 8-bit temperature readings are required for this lab.

Starter code is here: Assignment Skeleton Code

Compilation and programming is as before.