Real Time Clock and LCD Display

25 downloads 352 Views 308KB Size Report
Real Time Clock and LCD Display. Task: Using UP3 Education Kit board implement a stop-watch timer. Initialize Real Time Clock. (RTC) device and read  ...
Real Time Clock and LCD Display Task: Using UP3 Education Kit board implement a stop-watch timer. Initialize Real Time Clock (RTC) device and read seconds value afterwards. Minutes may either be read from RCT as well, or computed based on seconds value. Output seconds and minutes on LCD display. Also incorporate a Reset mechanism, so the stop-watch may be halted and started over. Refer to UP3 manual for pin numbers.

I2C Bus I2C is a two-line, bi-directional serial bus most suitable for short distance communication. It was developed by Phillips in the 1980s, but still remains a widely used mean for data exchange between many devices.

Devices on the I2C bus are organized as Masters and Slaves. To begin communication Master device issues a start sequence. To end transmission Master device sends a stop sequence. Slave devices just respond to these requests. Slave device is selected using a 7-bit address, which is unique for every device connected to the same I2C bus.

Data exchange is made using two wires – SCL (clock line) and SDA (serial data and address line). Master device drives the SCL line to clock each new bit on the SDA line in either direction. Slave device can force a wait by driving the SCL line Low. Before each new clock cycle Master device must ensure the wait condition is not present.

Both SCL and SDA lines are open-drain pulled up with resistors. It means that any device attached to the bus can drive the line Low, but it cannot drive it High. The device releases the line instead to let it float. To implement a bi-directional transmission on SDA line an open-drain buffer must be used. It can be instantiated using the following VHDL code: with data_in select data_out