SES Flashcards
What is a bus?
A communication highway shared by multiple devices
What are some challenges of using busses?
Maintaining synchronisation between devices
Differentiating between valid bits and an idle signal (when no data is being sent)
Knowing if a device is the intended recipient
Detecting message collisions
Prioritising senders
What is the solution to mismatched signals in busses?
The master controls the clock and sends it to the slave
What are the common communication protocols for microcontrollers?
RS232
I2C
SPI
What are the features of RS232?
Asynchronous
One wire is used for transmitting and another for receiving
Describe how an asynchronous serial bus functions
The sender doesn’t provide a clock to the receiver
Universal asynchronous receiver transmitter (UART) manages the transfer
Both ends must apply the same protocol
What are parts of a protocol?
Number of bits in the message msb or lsb first synchronisation of bits parity bits baud rate
How many wires are there in the I2C protocol?
2
serial data line (SDA) & serial clock line (SCL)
Briefly describe the I2C protocol
All communication is initiated by the master
In order to transmit to the slave the master must send the slave’s unique address
To receive data the master must send a read request alongside the slave’s address
For every 8 data bits an ‘ACK’ bit must be returned
Describe a multi-master I2C system
It must be decided which master has control of the bus
If a master tries to transmit a 1 but the wire has value another master must be sending
The master that lost the resolution stops sending
What does SPI stand for?
Serial Peripheral Interface
Describe the SPI protocol
Shift registers form a circular buffer
Data can be transferred in either direction using 2 pins
MISO - master in slave out
MOSI - master out slave in
Only the master can initiate a transfer
The SS (slave select) pin defines which slave should respond to a transaction so the master needs an SS pin for each peripheral
Alternatively slaves can be chained and all participate in transactions
What are the advantages of SPI?
High speed
No overhead
Full duplex
What are the disadvantages of SPI?
Master doesn’t know is slaves are online
Master doesn’t know if the data is received
At least 4 wires required
Multi-master is awkward
What are the advantages of I2C?
The master knows if data has been received
The master knows if slaves go offline
Only 2 wires required
Multi-master is easy to implement
What are the disadvantages of I2C?
Low speed
High power drain
Half duplex
What are the features of volatile memory?
Requires power to maintain stored data
Contents is lost when it’s switched off
At switch on the memory contains no useful data
What are the features of non-volatile memory?
Retains data when even when not powered
Contents preserved at switch off
At switch on contents is the same as at switch on
What is EEPROM?
Non-volatile memory
Field programmable
Re-programmable
Individual bytes can be erased
What is flash memory?
Non-volatile memory
Blocks (large) can be erased
Cheaper than EEPROM
Faster to program than EEPROM
Describe Von-Neumann architecture
One memory and one address but between a processor and memory
Instructions and data are sent sequentially which limits operation bandwidth
Describe Harvard architecture
Uses separate memories for instructions and data with different busses
Instructions and operands are fetched in parallel
Different program and data bus widths can be used to optimise the memories
What are the requirements of a system?
An informal description is what the customer wants
What is the specification of a system?
Precise description of what the design team should deliver