Giter VIP home page Giter VIP logo

inter_device_communication_protocols's Introduction

Inter Device Communication Protocols

In this repository we will be looking at verilog codes of various Inter Device Communication protocols like Universal Asynchronous Receiver Transmitter (UART), Serial Peripheral Interface (SPI).

Universal Asynchronous Receiver Transmitter (UART)

Terminologies used in UART

  • Start bit:- It is the first bit of one byte UART transmission. It is used to indicate the receiver that data bits are going to arrive i.e it indicates that data line is leaving it's idle state. In general idle state is Logic HIGH and Start bit is Logic LOW.

  • Stop bit:- It is the last bit of one byte UART transmission. It has the same logic level idle state.

  • Baud rate:- It is the approximate rate at which data can be transmitted. Approximately the time period of one bit in a UART transmission is inverse of Baud rate.

Serial Peripheral Interface (SPI)

Here communication happens between master chip and slave chips. The important terminologies used in SPI are as follow.

Terminologies used in SPI

It is a "Full Duplex Communication Protocol"

  • SCK:- This is the clock generated by master and is made available to all the slaves connected to it.

  • MOSI:- This is the one bit data line which corresponds to "Master Output and Slave Input" i.e data is sent by the master over this data line to the slave.

  • MISO:- This is the one bit data line which corresponds to "Master Input and Slave Output" i.e data is sent from slave to master over this data line.

  • SS:- This is known as "Slave Select". In general, the number of slave lines are equal to number of slaves that a master controls. In general slave select lines are kept "LOGIC HIGH" to disable all the slaves. Whenever a master wants to send data to a slave that particular slave's slave select line is made "LOGIC LOW" to enable the slave to receive the data sent by the master.

There are various modes of transmission which depends on the datasheet of the particular component. They are as follow [5]

Mode Clock Polarity (CPOL) Clock Phase (CPHA) Output Edge Data Capture
SPI_MODE0 0 0 Falling Rising
SPI_MODE1 0 1 Rising Falling
SPI_MODE2 1 0 Rising Falling
SPI_MODE3 1 1 Falling Rising

References

[1] Back to Basics: The Universal Asynchronous Receiver/Transmitter (UART)
[2] Fun and Easy SPI - How the SPI Protocol Works
[3] Serial Communication
[4] Serial Peripheral Interface (SPI) from sparkfun
[5] SPI library
[6] Clock Phase and Polarity

inter_device_communication_protocols's People

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

sankethvk

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.