Lecture 10: Communications protocols Flashcards
What does USART stand for?
Universal Synchronous and Asynchronous Receiver and Transmitter
What is USART?
It is a highly flexible transmission device. It has a configurable transmission speed and data format with error checking.
In a USART, how do we implement 0 and 1?
using different voltages that depend on the connector standard.
What is the BAUD rate?
It is the speed of transmission and represents the number of bits sent per second.
How do we connect two USARTS?
Connect the transmitter of one device to the receiver of the other and vice versa.
What is a frame?
It is how we send data. One frame will contain the data bits to be generated along with bits to start and stop transmission. There is an optional parity bit for error checking.
What happens when one frame has been transmitted?
We can transmit a new frame or we can send the line into an idle state.
What is the value of the start bit?
Low
What is the value of the stop bit?
High
What happens if our parity bit does not match the computed bit?
This means that the data is incorrect and it will be discarded.
How does the Parity bit work?
We add it to the end of our data bits to make the number of High bits even or odd.
How do we calculate the Parity bit?
Through the XOR of all the data bits.
What is the location of the Parity bit?
between the last data bit and the stop transmission bit.
What are the 5 steps for transmission?
Set the idle bit to high. Set the start bit to low Set the bits according to the data being sent Set the Parity bit Set the stop bit to high/
What happens when we activate USART transmission?
The normal port operation is overridden and the function is given to the transmitters serial output.
How do we initiate data transmission?
We load the transmission register with the data to be sent.
Move the data to a shift register when it is ready to send a new frame.
Once complete the frame will be transferred at the set clock rate.
When will the receiver begin to receive data?
When it recognises a valid start bit
What happens to the received data?
It will be received at the baud rate and transferred into a shift register.
What are the 3 interrupts of the receiver?
Frame Error: This will detect out of sync conditions
Data Overrun: Indicates loss of data because the receiver is full
Parity Error: The Parity bit does not match
What happens if we have incorrect baud rates between devices?
Then we will not correctly transmit the data and end up with weird results.
What are the four clock modes that we can use for generation and transmission?
Normal or double speed asynchronous
Master | Slave synchronous
What does SPI stand for?
Serial Peripheral Interface
What is SPI?
It allows for high speed data transfer between the ATMega8 and its peripherals.
How many data registers does the SPI consist of?
2 shift registers and a clock generator.