Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microcontroller basics

Similar presentations


Presentation on theme: "Microcontroller basics"— Presentation transcript:

1 Microcontroller basics
Embedded systems for mortals

2 Lesson 4 Wired communication Parallel vs. Serial Parallel LCD
Serial I2C and SPI

3 Parallel vs. Serial Parallel Serial
Conveying multiple binary digits (bits) simultaneously Conveys only a single bit at a time Many wires/traces (number of electrical conductors) Typically 1 wire/bit Less wires/traces Communication is based on rising and falling edges of a square wave Examples: ISA, ATA, SCSI, PCI Examples: UART, I2C, SPI

4 Parallel LCD (4-bit data bus)
Hitachi HD44780 LCD RS pin to digital pin 12 LCD Enable pin to digital pin 11 LCD D4 pin to digital pin 5 LCD D5 pin to digital pin 4 LCD D6 pin to digital pin 3 LCD D7 pin to digital pin 2

5 Parallel LCD (4-bit data bus)
Hitachi HD44780

6 Serial: I2C & SPI I2C (TWI) SPI Pins: SDA (A4), SCL (A5)
Pins: MISO (11), MOSI (12), SCK (13), SS (10/any) Up to 127 devices. Devices have an address (0x00 to 0x7F) which determines where data is sent/received from. SDA for both sending and receiving Devices are chosen based on SS (slave select pin). One line for sending (MOSI, master out, slave in) and one for receiving (MISO, master in, slave out). Data can go both ways at the same time Wire.h SPI.h Easier to daisy-chain Faster

7 I2C/SPI modules A wide variety of sensors, drivers and modules use serial data to communicate with microcontrollers PCD8544, Nokia LCD (SPI) Adafruit library with graphics Smaller footprint library MiniOLED display (I2C) Adafruit library (SSD1306) 128x64 i2c Wii Nunchuck (I2C) Library Example with Processing visualisation VL53L0X Time-of-Flight Distance Sensor (I2C) Description


Download ppt "Microcontroller basics"

Similar presentations


Ads by Google