LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI. Laboratory Lesson 9: Serial Peripheral Interface (SPI)

Size: px
Start display at page:

Download "LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI. Laboratory Lesson 9: Serial Peripheral Interface (SPI)"

Transcription

1 LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI Laboratory Lesson 9: Serial Peripheral Interface (SPI) Prof. Luca Benini <luca.benini@unibo.it> Prof Davide Rossi <davide.rossi@unibo.it> Simone Benatti <simone.benatti@unibo.it> Victor Kartsch<victorjavier.kartsch@unibo.it>

2 Info & Communications

3 Recap LAB1: IDE & Debug LAB2: GPIO & Systick LAB3: Advanced Debug LAB4: EXTI LAB5: Timers LAB6: FLASH & DMA LAB7: USART LAB8: ADC LAB9: SPI SPI: init and read data from Accelerometer

4 Serial Peripheral Interface (SPI)

5 Serial Peripheral Interface (SPI) Serial Bus protocol Fast, Easy to use, Simple Everyone supports it

6 SPI characteristics A 4-wire communication bus Typically communicate across short distances (chips on PCB or boards in device) Supports Single master Multiple slaves Synchronized Communications are clocked Always full-duplex Communicates in both directions simultaneously Transmitted (or received) data may not be meaningful Multiple Mbps transmission speeds 0-50 MHz clock speeds not uncommon Transfer data in 8 to 16 bit characters

7 SPI bus wiring Bus wires Master-Out, Slave-In (MOSI) or SDO (Serial Port Data Output) Master-In, Slave-Out (MISO) or SDI (Serial Port Data Input) System Clock (SCLK) Slave Select/Chip Select (SS or CS) Master controls slave/chip select line (usually as GPIO) Master generates clock signal Shift registers shift data in and out

8 SPI signal functions MOSI carries data out of master to slave MISO carries data out of slave to master Both MOSI and MISO are active during every transmission In 3-wire mode MOSI and MISO are just one shared line SS (or CS) unique line to select each slave chip Usually active low SCLK produced by master to synchronize transfers

9 SPI communication model Master shifts out data to Slave, and shifts in data from Slave For every transmission data is shifted both ways Write: master writes desired data and ignores what comes in Read: master writes dummy data (e.g.0x00) to generate clock and reads incoming data

10 SPI communication model

11 SPI configuration models Parallel connection Daisy-chain connection

12 STM32 SPI

13 STM32 SPI features Full-duplex synchronous transfers on three lines Simplex synchronous transfers on two lines with or without a bidirectional data line. Master or slave operation, with multi-master capability 8- or 16-bit transfer frame format selection NSS management by hardware or software for both master and slave: dynamic change of master/slave operations Programmable clock polarity and phase Programmable data order with MSB-first or LSB-first shifting Dedicated transmission and reception flags with interrupt capability SPI bus busy status flag Hardware CRC feature for reliable communication Master mode fault, overrun and CRC error flags with interrupt capability 1-byte transmission and reception buffer with DMA capability for TX and RX requests

14 STM32 SPI Block diagram

15 LIS3DSH: MEMS Accelerometer

16 ST LIS3DSH The LIS3DSH is an ultra-compact low-power 3D digital linear accelerometer belonging to the nano family. 3 acceleration channels ±2g/±4g/±6g/±8g/±16g linear acceleration full scale 16-bit data output I2C/SPI serial interface Analog supply voltage 1.7 V to 3.6 V Power-down mode / low-power mode 2 independent programmable interrupt generators activated by user-generated motion patterns Info & data sheet:

17 ST LIS3DSH Block Diagram

18 ST LIS3DSH Block Diagram MEMS sensing and conditioning Internal ADC FSM and FIFIO I2C/SPI interface IRQ lines Digital control

19 Sensor connection Data sheet application suggestion and board schematic

20 How do I use the sensor? Use SPI communication to read/write sensor s internal registers Control registers for configuration, data registers for acquired signals Beside the communication via SPI it s as an additional external peripheral: First configure its registers to set the desired operation mode Then read data from internal data register To read/write a register follow the procedure on the datasheet The general procedure is: Master selects the device (sets CS low) Master sends desired register s address specifying read or write If read: master sends dummy data and gets value to read If write: master sends data to write and discards what comes in Master de-selects the device (sets CS high)

21 LIS3DSH SPI read and write protocol Set CS (NSS) low for the slave, then send address, then read/write data. Both the Read Register and Write Register commands are completed in 16 clock pulses (8 addr + 8 data) or in multiples of 8 in case of multiple bytes read/write (8 addr + N*8 data).

22 LIS3DSH SPI read and write protocol Bit 0: RW bit. When 0, the data DI(7:0) is written to the device. When 1, the data DO(7:0) is read from the device. In the latter case, the chip will drive SDO at the start of bit 8. Bit 1: MS bit. When 0, the address remains unchanged in multiple read/write commands. When 1, the address will be auto-incremented in multiple read/write commands. Bit 2-7: address AD(5:0). This is the address of the indexed register. Bit 8-15: data DI(7:0) (write mode). This is the data that will be written to the device (MSb first). Bit 8-15: data DO(7:0) (read mode). This is the data that will be read from the device (MSb first). In multiple read/write commands, further blocks of 8 clock periods will be added. When the MS bit is 0, the address used to read/write data remains the same for every block. When the MS bit is 1, the address used to read/write data is incremented at every block. The function and the behavior of SDI and SDO remain unchanged.

23 Which register do I write? Look at the sensor datasheet:

24 Control registers Example: CTRL_REG4 (Address: 0x20) select the Output Data Rate (ODR), enable/disable block data update and enable/disable each of the 3 accelerometer axis Read = current configuration, Write = set new configuration

25 Data registers Data registers contain the sampled signals converted to digital values. 16bit integer values stored in 2 8bit registers (L = LSB, H = MSB) According to settings and ODR, you must be careful to read the registers after the data has been updated to avoid reading old or corrupted values Block Data Update can prevent the update of data regiters before reading the current values Read = current configuration, NO Write (read only!)

26 How? Q. So I have to look at each register, write its address and the meaning of the bits? A. NO! we have a library! Download the provided files and copy them in the Utilities folder of your project: old version of the DISCOVERY board had a different sensor (LIS302DL): use the correct one! to use library remember to add: #include stm32f401_discovery_lis3dsh.h" Same structure as for internal peripherals: File.c/.h for the sensor Pins definitions Register addresses and fields defines Data structures for configuration Functions for main tasks

27 Some functions LIS3DSH_Init as usual needs a structure with the desired configuration It calls LIS3DSH_LowLevel_Init() which configures the GPIO and the SPI It writes the desired parameters in the control registers LIS3DSH_ReadAcc_Raw reads the 8bit data registers and combines them in 16 bit variables

28 Code example

29 What to do? We want to read accelerometer data at 25 Hz. You can check the values from the debugger or you can stream the data to a PC via USART or USB (see provided templates) Tasks: Configure LEDs, SysTick (as before ) Configure and initialize SPI peripheral (GPIOs, configuration) Set the sensor s internal register for initial configuration (write control registers) Periodically read output from sensor s internal register (read data registers) Reconstruct data (two 8 bit registers must be stored in a 16 bit variable) (optional) Send result via USART or USB to the PC

30 GPIO and SPI initialization void LIS3DSH_LowLevel_Init(void) { GPIO_InitTypeDef GPIO_InitStructure; SPI_InitTypeDef SPI_InitStructure; /* Enable the SPI periph */ RCC_APB2PeriphClockCmd(LIS3DSH_SPI_CLK, ENABLE); /* Enable SCK, MOSI and MISO GPIO clocks */ RCC_AHB1PeriphClockCmd(LIS3DSH_SPI_SCK_GPIO_CLK, ENABLE); /* Enable CS GPIO clock */ RCC_AHB1PeriphClockCmd(LIS3DSH_SPI_CS_GPIO_CLK, ENABLE); Enable the clocks for all the used peripherals and pins. /* Enable INT1 GPIO clock */ RCC_AHB1PeriphClockCmd(LIS3DSH_SPI_INT1_GPIO_CLK, ENABLE); /* Enable INT2 GPIO clock */ RCC_AHB1PeriphClockCmd(LIS3DSH_SPI_INT2_GPIO_CLK, ENABLE);...

31 GPIO and SPI initialization... GPIO_PinAFConfig(LIS3DSH_SPI_SCK_GPIO_PORT, LIS3DSH_SPI_SCK_SOURCE, LIS3DSH_SPI_SCK_AF); GPIO_PinAFConfig(LIS3DSH_SPI_MISO_GPIO_PORT, LIS3DSH_SPI_MISO_SOURCE, LIS3DSH_SPI_MISO_AF); GPIO_PinAFConfig(LIS3DSH_SPI_MOSI_GPIO_PORT, LIS3DSH_SPI_MOSI_SOURCE, LIS3DSH_SPI_MOSI_AF); GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; Config the SPI pins (SCK, MISO and MOSI) as alternate function /* SPI SCK pin configuration */ GPIO_InitStructure.GPIO_Pin = LIS3DSH_SPI_SCK_PIN; GPIO_Init(LIS3DSH_SPI_SCK_GPIO_PORT, &GPIO_InitStructure); /* SPI MOSI pin configuration */ GPIO_InitStructure.GPIO_Pin = LIS3DSH_SPI_MOSI_PIN; GPIO_Init(LIS3DSH_SPI_MOSI_GPIO_PORT, &GPIO_InitStructure); /* SPI MISO pin configuration */ GPIO_InitStructure.GPIO_Pin = LIS3DSH_SPI_MISO_PIN; GPIO_Init(LIS3DSH_SPI_MISO_GPIO_PORT, &GPIO_InitStructure);...

32 GPIO and SPI initialization... GPIO_PinAFConfig(LIS3DSH_SPI_SCK_GPIO_PORT, LIS3DSH_SPI_SCK_SOURCE, LIS3DSH_SPI_SCK_AF); GPIO_PinAFConfig(LIS3DSH_SPI_MISO_GPIO_PORT, LIS3DSH_SPI_MISO_SOURCE, LIS3DSH_SPI_MISO_AF); GPIO_PinAFConfig(LIS3DSH_SPI_MOSI_GPIO_PORT, LIS3DSH_SPI_MOSI_SOURCE, LIS3DSH_SPI_MOSI_AF); GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; /* SPI SCK pin configuration */ GPIO_InitStructure.GPIO_Pin = LIS3DSH_SPI_SCK_PIN; GPIO_Init(LIS3DSH_SPI_SCK_GPIO_PORT, &GPIO_InitStructure); /* SPI MOSI pin configuration */ GPIO_InitStructure.GPIO_Pin = LIS3DSH_SPI_MOSI_PIN; GPIO_Init(LIS3DSH_SPI_MOSI_GPIO_PORT, &GPIO_InitStructure); /* SPI MISO pin configuration */ GPIO_InitStructure.GPIO_Pin = LIS3DSH_SPI_MISO_PIN; GPIO_Init(LIS3DSH_SPI_MISO_GPIO_PORT, &GPIO_InitStructure);... All the needed pins are defined in the library (look in the.h file) to facilitate code development and re-use! Example: #define LIS3DSH_SPI_SCK_PIN GPIO_Pin_5

33 GPIO and SPI initialization... /* SPI configuration */ SPI_I2S_DeInit(LIS3DSH_SPI); SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex; SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b; SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low; SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge; SPI_InitStructure.SPI_NSS = SPI_NSS_Soft; SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_4; SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB; SPI_InitStructure.SPI_CRCPolynomial = 7; SPI_InitStructure.SPI_Mode = SPI_Mode_Master; SPI_Init(LIS3DSH_SPI, &SPI_InitStructure); /* Enable SPI1 */ SPI_Cmd(LIS3DSH_SPI, ENABLE);... Usual peripheral initialization: Reset the SPI, set the desired configuration parameters and enable it.

34 GPIO and SPI initialization... /* Configure GPIO PIN for Chip select */ GPIO_InitStructure.GPIO_Pin = LIS3DSH_SPI_CS_PIN; GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT; GPIO_InitStructure.GPIO_OType = GPIO_OType_PP; GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz; GPIO_Init(LIS3DSH_SPI_CS_GPIO_PORT, &GPIO_InitStructure); /* Deselect : Chip Select high */ GPIO_SetBits(LIS3DSH_SPI_CS_GPIO_PORT, LIS3DSH_SPI_CS_PIN); } Configure Chip Select (CS) pin. It is used as GPIO and it is active low: it is high and should be Reset (low) when writing/reading.

35 Accelerometer Config void Acc_Config(void) { LIS3DSH_InitTypeDef AccInitStruct; Same configuration paradigm as for internal peripherals AccInitStruct.Output_DataRate = LIS3DSH_DATARATE_50; AccInitStruct.Axes_Enable = LIS3DSH_XYZ_ENABLE; AccInitStruct.SPI_Wire = LIS3DSH_SERIALINTERFACE_4WIRE; AccInitStruct.Self_Test = LIS3DSH_SELFTEST_NORMAL; AccInitStruct.Full_Scale = LIS3DSH_FULLSCALE_2; AccInitStruct.Filter_BW = LIS3DSH_FILTER_BW_800; LIS3DSH_Init(&AccInitStruct); }

36 Accelerometer Config void Acc_Config(void) { LIS3DSH_InitTypeDef AccInitStruct; AccInitStruct.Output_DataRate = LIS3DSH_DATARATE_50; AccInitStruct.Axes_Enable = LIS3DSH_XYZ_ENABLE; AccInitStruct.SPI_Wire = LIS3DSH_SERIALINTERFACE_4WIRE; AccInitStruct.Self_Test = LIS3DSH_SELFTEST_NORMAL; AccInitStruct.Full_Scale = LIS3DSH_FULLSCALE_2; AccInitStruct.Filter_BW = LIS3DSH_FILTER_BW_800; Data Output Rate 50Hz This has to be set according to the desired sampling rate (possibly higher) LIS3DSH_Init(&AccInitStruct); }

37 Accelerometer Config void Acc_Config(void) { LIS3DSH_InitTypeDef AccInitStruct; AccInitStruct.Output_DataRate = LIS3DSH_DATARATE_50; AccInitStruct.Axes_Enable = LIS3DSH_XYZ_ENABLE; AccInitStruct.SPI_Wire = LIS3DSH_SERIALINTERFACE_4WIRE; AccInitStruct.Self_Test = LIS3DSH_SELFTEST_NORMAL; AccInitStruct.Full_Scale = LIS3DSH_FULLSCALE_2; AccInitStruct.Filter_BW = LIS3DSH_FILTER_BW_800; Enable all 3 axes LIS3DSH_Init(&AccInitStruct); }

38 Accelerometer Config void Acc_Config(void) { LIS3DSH_InitTypeDef AccInitStruct; AccInitStruct.Output_DataRate = LIS3DSH_DATARATE_50; AccInitStruct.Axes_Enable = LIS3DSH_XYZ_ENABLE; AccInitStruct.SPI_Wire = LIS3DSH_SERIALINTERFACE_4WIRE; AccInitStruct.Self_Test = LIS3DSH_SELFTEST_NORMAL; AccInitStruct.Full_Scale = LIS3DSH_FULLSCALE_2; AccInitStruct.Filter_BW = LIS3DSH_FILTER_BW_800; Select 4-wire SPI interface LIS3DSH_Init(&AccInitStruct); }

39 Accelerometer Config void Acc_Config(void) { LIS3DSH_InitTypeDef AccInitStruct; AccInitStruct.Output_DataRate = LIS3DSH_DATARATE_50; AccInitStruct.Axes_Enable = LIS3DSH_XYZ_ENABLE; AccInitStruct.SPI_Wire = LIS3DSH_SERIALINTERFACE_4WIRE; AccInitStruct.Self_Test = LIS3DSH_SELFTEST_NORMAL; AccInitStruct.Full_Scale = LIS3DSH_FULLSCALE_2; AccInitStruct.Filter_BW = LIS3DSH_FILTER_BW_800; Perform normal self-test (at sensor init) LIS3DSH_Init(&AccInitStruct); }

40 Accelerometer Config void Acc_Config(void) { LIS3DSH_InitTypeDef AccInitStruct; AccInitStruct.Output_DataRate = LIS3DSH_DATARATE_50; AccInitStruct.Axes_Enable = LIS3DSH_XYZ_ENABLE; AccInitStruct.SPI_Wire = LIS3DSH_SERIALINTERFACE_4WIRE; AccInitStruct.Self_Test = LIS3DSH_SELFTEST_NORMAL; AccInitStruct.Full_Scale = LIS3DSH_FULLSCALE_2; AccInitStruct.Filter_BW = LIS3DSH_FILTER_BW_800; Set Full Scale at ±2g LIS3DSH_Init(&AccInitStruct); }

41 Accelerometer Config void Acc_Config(void) { LIS3DSH_InitTypeDef AccInitStruct; } AccInitStruct.Output_DataRate = LIS3DSH_DATARATE_50; AccInitStruct.Axes_Enable = LIS3DSH_XYZ_ENABLE; AccInitStruct.SPI_Wire = LIS3DSH_SERIALINTERFACE_4WIRE; AccInitStruct.Self_Test = LIS3DSH_SELFTEST_NORMAL; AccInitStruct.Full_Scale = LIS3DSH_FULLSCALE_2; AccInitStruct.Filter_BW = LIS3DSH_FILTER_BW_800; LIS3DSH_Init(&AccInitStruct); Set internal Low Pass Filter at 800Hz

42 Accelerometer Config void Acc_Config(void) { LIS3DSH_InitTypeDef AccInitStruct; } AccInitStruct.Output_DataRate = LIS3DSH_DATARATE_50; AccInitStruct.Axes_Enable = LIS3DSH_XYZ_ENABLE; AccInitStruct.SPI_Wire = LIS3DSH_SERIALINTERFACE_4WIRE; AccInitStruct.Self_Test = LIS3DSH_SELFTEST_NORMAL; AccInitStruct.Full_Scale = LIS3DSH_FULLSCALE_2; AccInitStruct.Filter_BW = LIS3DSH_FILTER_BW_800; LIS3DSH_Init(&AccInitStruct); This function will call the SPI initialization function and then write the selected configuration to the LIS3DSH registers. Check the code!

43 Accelerometer Config void Acc_Config(void) { LIS3DSH_InitTypeDef AccInitStruct; } AccInitStruct.Output_DataRate = LIS3DSH_DATARATE_50; AccInitStruct.Axes_Enable = LIS3DSH_XYZ_ENABLE; AccInitStruct.SPI_Wire = LIS3DSH_SERIALINTERFACE_4WIRE; AccInitStruct.Self_Test = LIS3DSH_SELFTEST_NORMAL; AccInitStruct.Full_Scale = LIS3DSH_FULLSCALE_2; AccInitStruct.Filter_BW = LIS3DSH_FILTER_BW_800; LIS3DSH_Init(&AccInitStruct); This is the minimum configuration. Advanced functionalities include: data filtering, output buffers (FIFO), interrupt generation on various conditions, (look in the datasheet and the code)

44 Sensor data reading Periodically read sensor data: use SysTick to measure period, then read sensor output registers you can also configure the sensor to generate an interrupt (EXTI) when data is ready ensure to set the sensor s output data rate equal or higher than the read rate data is 16 bit signed, but registers are 8 bit: need to shift MSB and add to LSB to reconstruct final value (look in the ReadAcc_Raw function) readbuffer[0] <<8 readbuffer [1] dataout[0] (Acc X)

45 Sensor data reading How can I interpret the numbers I read? It s the same as with the ADC: you are actually reading the value converted by the internal ADC. The full scale sets the range of the acceleration to measure (in our example: ±2g) The resolution is 16bit Do the math and convert the output value in g (or mg). (hint: check the sensor sensitivity in the datasheet and look in the library) Try to change the full scale value and see what happens to the output values. I got the data from the sensor, what does it mean? When still the accelerometer reports -1g on the vertical axis (gravity acceleration) Try to change the orientation of your board

46 Data streaming You can now use the USART or USB to send sensor data to the PC You can use any terminal to read the values or you can plot them (e.g. using Serial Chart)

47 Weekly assignments

48 Exercise 1) Write a program that reads accelerometer data at 25Hz and computes for each axes the mean, maximum and minimum values on 1s data windows. you can stream data to the PC using USART/USB. Use s to start/stop streaming

49 Questions 1. Try to change the Full Scale value of the accelerometer. What happens to the output values? 2. Describe the operations you have to do in order to configure and read data from a sensor interfaced trought the SPI.

SPI( 2M-Flash-W25X16 )

SPI( 2M-Flash-W25X16 ) SPI( 2M-Flash-W25X16 ) E-Mail fire firestm32@foxmail.com QQ 313303034 firestm32.blog.chinaunix.net STM32 ST3.0.0 FLASH ID PA4-SPI1-NSS : W25X16-CS PA5-SPI1-SCK : W25X16-CLK PA6-SPI1-MISO : W25X16-DO PA7-SPI1-MOSI

More information

LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI

LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI Laboratory Lesson 7: Universal Serial Asynchronous Receiver Transmitter (USART) Prof. Luca Benini

More information

LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI. Laboratory Lesson 2: - General Purpose I/O - SysTick

LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI. Laboratory Lesson 2: - General Purpose I/O - SysTick LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI Laboratory Lesson 2: - General Purpose I/O - SysTick Prof. Luca Benini Prof Davide Rossi

More information

STM32F4 Standard Peripheral Library. EE599: Real-Time Operating Systems University of Kentucky. Dr. Samir Rawashdeh

STM32F4 Standard Peripheral Library. EE599: Real-Time Operating Systems University of Kentucky. Dr. Samir Rawashdeh STM32F4 Standard Peripheral Library EE599: Real-Time Operating Systems University of Kentucky Dr. Samir Rawashdeh Includes material by: - ST Reference Material 1 Include files STM32F10x_StdPeriph_Driver

More information

< W3150A+ / W5100 Application Note for SPI >

< W3150A+ / W5100 Application Note for SPI > < W3150A+ / W5100 Application Note for SPI > Introduction This application note describes how to set up the SPI in W3150A+ or W5100. Both the W3150A+ and W5100 have same architecture. W5100 is operated

More information

17. Serial communication - I 2 C

17. Serial communication - I 2 C 7. Serial communication - I 2 C Two typical serial busses will be discussed and their use will be demonstrated in this and next chapter, these are I 2 C (Inter Integrated Circuit, IIC or I2C) and SPI (Serial

More information

Serial Peripheral Interface. What is it? Basic SPI. Capabilities. Protocol. Pros and Cons. Uses

Serial Peripheral Interface. What is it? Basic SPI. Capabilities. Protocol. Pros and Cons. Uses Serial Peripheral Interface What is it? Basic SPI Capabilities Protocol Serial Peripheral Interface http://upload.wikimedia.org/wikipedia/commons/thumb/e/ed/ SPI_single_slave.svg/350px-SPI_single_slave.svg.png

More information

For reference only Refer to the latest documents for details

For reference only Refer to the latest documents for details STM32F3 Technical Training For reference only Refer to the latest documents for details Serial peripheral interface SPI 3 SPI Features (1/2) 3 Full duplex synchronous transfers (3 lines) Half duplex/simplex

More information

Serial Peripheral Interface (SPI)

Serial Peripheral Interface (SPI) SPI and I 2 C 1 Serial Peripheral Interface (SPI) SPI allow half/full duplex, synchronous, serial communication with external devices The interface can be configured as master for MCU board Communication

More information

LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI

LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI Laboratory Lesson 10: CMSIS DSP Library and Functions Final Assignment Prof. Luca Benini Prof Davide

More information

Content Hardware Platform Resources Driver Library s Indroduction of Driver Library s Platform Dependen

Content Hardware Platform Resources Driver Library s Indroduction of Driver Library s Platform Dependen V1.2 Shenzhen Rakwireless Technology Co.,Ltd www.rakwireless.com Email: info@rakwireless.com Content 1. 2. 3. 4. 5. 6. Hardware Platform Resources... - 1 Driver Library s... - 1 2.1 Indroduction of Driver

More information

OUTLINE. SPI Theory SPI Implementation STM32F0 SPI Resources System Overview Registers SPI Application Initialization Interface Examples

OUTLINE. SPI Theory SPI Implementation STM32F0 SPI Resources System Overview Registers SPI Application Initialization Interface Examples SERIAL PERIPHERAL INTERFACE (SPI) George E Hadley, Timothy Rogers, and David G Meyer 2018, Images Property of their Respective Owners OUTLINE SPI Theory SPI Implementation STM32F0 SPI Resources System

More information

Accel 5 click. PID: MIKROE 3149 Weight: 24 g

Accel 5 click. PID: MIKROE 3149 Weight: 24 g Accel 5 click PID: MIKROE 3149 Weight: 24 g Accel 5 click features an ultra-low power triaxial accelerometer sensor, labeled as the BMA400. This Click board allows linear motion and gravitational force

More information

spi 1 Fri Oct 13 13:04:

spi 1 Fri Oct 13 13:04: spi 1 Fri Oct 1 1:: 1.1 Introduction SECTION SERIAL PERIPHERAL INTERFACE (SPI) The SPI module allows full-duplex, synchronous, serial communication with peripheral devices.. Features Features of the SPI

More information

An SPI Temperature Sensor Interface with the Z8 Encore! SPI Bus

An SPI Temperature Sensor Interface with the Z8 Encore! SPI Bus Application Note An SPI Temperature Sensor Interface with the Z8 Encore! SPI Bus AN012703-0608 Abstract This Application Note provides an overview of Zilog s Z8 Encore! Serial Peripheral Interface (SPI)

More information

Pedometer 3 Click. PID: MIKROE 3259 Weight: 24 g

Pedometer 3 Click. PID: MIKROE 3259 Weight: 24 g Pedometer 3 Click PID: MIKROE 3259 Weight: 24 g The Pedometer 3 click is a tri-axis acceleration sensing Click board utilizing the KX126-1063. An advanced three-axis acceleration sensor, the KX126-1063

More information

Serial communications with SPI

Serial communications with SPI Serial communications with SPI DRAFT VERSION - This is part of a course slide set, currently under development at: http://mbed.org/cookbook/course-notes We welcome your feedback in the comments section

More information

or between microcontrollers)

or between microcontrollers) : Communication Interfaces in Embedded Systems (e.g., to interface with sensors and actuators or between microcontrollers) Spring 2016 : Communication Interfaces in Embedded Systems Spring (e.g., 2016

More information

Shenzhen Rakwireless Technology Co.,Ltd

Shenzhen Rakwireless Technology Co.,Ltd RAK439 Porting Manual Shenzhen Rakwireless Technology Co.,Ltd www.rakwireless.com Email: info@rakwireless.com Content 1. Hardware Platform Resources...- 1-2. Driver Library s...- 1-2.1 Indroduction of

More information

EE 456 Fall, Table 1 SPI bus signals. Figure 1 SPI Bus exchange of information between a master and a slave.

EE 456 Fall, Table 1 SPI bus signals. Figure 1 SPI Bus exchange of information between a master and a slave. EE 456 Fall, 2009 Notes on SPI Bus Blandford/Mitchell The Serial Peripheral Interface (SPI) bus was created by Motorola and has become a defacto standard on many microcontrollers. This is a four wire bus

More information

Amarjeet Singh. January 30, 2012

Amarjeet Singh. January 30, 2012 Amarjeet Singh January 30, 2012 Website updated - https://sites.google.com/a/iiitd.ac.in/emsys2012/ Lecture slides, audio from last class Assignment-2 How many of you have already finished it? Final deadline

More information

ECE Microcontrollers. Serial Peripheral Interface (SPI) & NRF24 Radio

ECE Microcontrollers. Serial Peripheral Interface (SPI) & NRF24 Radio ECE 381 - Microcontrollers Serial Peripheral Interface (SPI) & NRF24 Radio Lab 9 Summary We will develop a wireless temperature sensor Once a second, sample LM34CZ voltage Convert to floating point with

More information

Serial Communication. Simplex Half-Duplex Duplex

Serial Communication. Simplex Half-Duplex Duplex 1.5. I/O 135 Serial Communication Simplex Half-Duplex Duplex 136 Serial Communication Master-Slave Master Master-Multi-Slave Master Slave Slave Slave (Multi-)Master Multi-Slave Master Slave Slave Slave

More information

YOU WILL NOT BE ALLOWED INTO YOUR LAB SECTION WITHOUT THE REQUIRED PRE-LAB.

YOU WILL NOT BE ALLOWED INTO YOUR LAB SECTION WITHOUT THE REQUIRED PRE-LAB. Page 1/5 Revision 2 OBJECTIVES Learn how to use SPI communication to interact with an external IMU sensor package. Stream and plot real-time XYZ acceleration data with USART to Atmel Studio s data visualizer.

More information

ArduCAM-M-2MP Camera Shield

ArduCAM-M-2MP Camera Shield 33275-MP ArduCAM-M-2MP Camera Shield 2MP SPI Camera Hardware Application Note Rev 1.0, Mar 2015 33275-MP ArduCAM-M-2MP Hardware Application Note Table of Contents 1 Introduction... 2 2 Typical Wiring...

More information

Introduction the Serial Communications Huang Sections 9.2, 10.2 SCI Block User Guide SPI Block User Guide

Introduction the Serial Communications Huang Sections 9.2, 10.2 SCI Block User Guide SPI Block User Guide Introduction the Serial Communications Huang Sections 9.2,.2 SCI Block User Guide SPI Block User Guide Parallel Data Transfer Suppose you need to transfer data from one HCS2 to another. How can you do

More information

Universität Dortmund. IO and Peripheral Interfaces

Universität Dortmund. IO and Peripheral Interfaces IO and Peripheral Interfaces Microcontroller System Architecture Each MCU (micro-controller unit) is characterized by: Microprocessor 8,16,32 bit architecture Usually simple in-order microarchitecture,

More information

Microcontrollers and Interfacing

Microcontrollers and Interfacing Microcontrollers and Interfacing Week 10 Serial communication with devices: Serial Peripheral Interconnect (SPI) and Inter-Integrated Circuit (I 2 C) protocols College of Information Science and Engineering

More information

C8051F700 Serial Peripheral Interface (SPI) Overview

C8051F700 Serial Peripheral Interface (SPI) Overview C8051F700 Serial Peripheral Interface (SPI) Overview Agenda C8051F700 block diagram C8051F700 device features SPI operation overview SPI module overview Where to learn more 2 Introducing The C8051F700

More information

Serial Peripheral Interface (SPI)

Serial Peripheral Interface (SPI) SPI = Simple, 3 wire, full duplex, synchronous serial data transfer Interfaces to many devices, even many non-spi peripherals Can be a master or slave interface 4 interface pins: -MOSI master out slave

More information

Interfacing Techniques in Embedded Systems

Interfacing Techniques in Embedded Systems Interfacing Techniques in Embedded Systems Hassan M. Bayram Training & Development Department training@uruktech.com www.uruktech.com Introduction Serial and Parallel Communication Serial Vs. Parallel Asynchronous

More information

An SPI interface for the 65(C)02 family of microprocessors

An SPI interface for the 65(C)02 family of microprocessors Rev 4/B Dec 30, 2011 65SPI/B An SPI interface for the 65(C)02 family of microprocessors This device was created to provide a basic SPI interface for the 65xx family of microprocessors. Currently, the only

More information

PARALLEL COMMUNICATIONS

PARALLEL COMMUNICATIONS Parallel Data Transfer Suppose you need to transfer data from one HCS12 to another. How can you do this? You could connect PORTA of the sending computer (set up as an output port) to PORTA of the receiving

More information

More on the 9S12 SPI Using the Dallas Semiconductor DS1302 Real Time Clock with the 9S12 SPI

More on the 9S12 SPI Using the Dallas Semiconductor DS1302 Real Time Clock with the 9S12 SPI More on the 9S12 SPI Using the Dallas Semiconductor DS1302 Real Time Clock with the 9S12 SPI Using the 9S12 SPI The SPI has a data register (SPIDR) and a shift register. To write data to the SPI, you write

More information

Section 5 SERCOM. Tasks SPI. In this section you will learn:

Section 5 SERCOM. Tasks SPI. In this section you will learn: Section 5 SERCOM SPI Tasks In this section you will learn: SPI protocol SERCOM Engine on SAMD20 How to use SERRCOM in SPI mode Implementation of SPI communication 04/12/2013 Table of Contents 1. The SPI

More information

PIC Serial Peripheral Interface (SPI) to Digital Pot

PIC Serial Peripheral Interface (SPI) to Digital Pot Name Lab Section PIC Serial Peripheral Interface (SPI) to Digital Pot Lab 7 Introduction: SPI is a popular synchronous serial communication protocol that allows ICs to communicate over short distances

More information

Raspberry Pi - I/O Interfaces

Raspberry Pi - I/O Interfaces ECE 1160/2160 Embedded Systems Design Raspberry Pi - I/O Interfaces Wei Gao ECE 1160/2160 Embedded Systems Design 1 I/O Interfaces Parallel I/O and Serial I/O Parallel I/O: multiple input/output simultaneously

More information

SPI (Serial & Peripheral Interface)

SPI (Serial & Peripheral Interface) SPI (Serial & Peripheral Interface) What is SPI SPI is a high-speed, full-duplex bus that uses a minimum of 3 wires to exchange data. The popularity of this bus rose when SD cards (and its variants ie:

More information

Learn how to communicate

Learn how to communicate USART 1 Learn how to communicate Programmed I/O (Software Polling) Interrupt Driven I/O Direct Memory Access (DMA) 2 Programmed I/O (Polling) Processor must read and check I/O ready bits for proper value

More information

Introduction to I2C & SPI. Chapter 22

Introduction to I2C & SPI. Chapter 22 Introduction to I2C & SPI Chapter 22 Issues with Asynch. Communication Protocols Asynchronous Communications Devices must agree ahead of time on a data rate The two devices must also have clocks that are

More information

Embedded Systems and Software. Serial Interconnect Buses I 2 C (SMB) and SPI

Embedded Systems and Software. Serial Interconnect Buses I 2 C (SMB) and SPI Embedded Systems and Software Serial Interconnect Buses I 2 C (SMB) and SPI I2C, SPI, etc. Slide 1 Provide low-cost i.e., low wire/pin count connection between IC devices There are many of serial bus standards

More information

SPI Universal Serial Communication Interface SPI Mode

SPI Universal Serial Communication Interface SPI Mode SPI Universal Serial Communication Interface SPI Mode Serial Peripheral Interface (SPI) is not really a protocol, but more of a general idea. It s the bare-minimum way to transfer a lot of data between

More information

Using the Z8051 MCU s USI Peripheral as an SPI Interface

Using the Z8051 MCU s USI Peripheral as an SPI Interface Using the Z8051 MCU s USI Peripheral as an SPI Interface AN035901-0513 Abstract This document describes how to configure Zilog s Z8051 Universal Serial Interface (USI) peripheral to operate as Serial Peripheral

More information

Understanding SPI with Precision Data Converters

Understanding SPI with Precision Data Converters Understanding SPI with Precision Data Converters By: Tony Calabria Presented by: 1 Communication Comparison SPI - Serial Peripheral Interface Bus I2C - Inter- Integrated Circuit Parallel Bus Advantages

More information

EE 308 Spring Using the 9S12 SPI

EE 308 Spring Using the 9S12 SPI Using the 9S12 SPI The SPI has a data register (SPIDR) and a shift register. To write data to the SPI, you write to the SPIDR data register. The 9S12 automatically transfers the data to the shift register

More information

LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI

LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI Laboratory Lesson 1: - Introduction to System Workbench for STM32 - Programming and debugging Prof. Luca Benini

More information

Serial Communication. Simplex Half-Duplex Duplex

Serial Communication. Simplex Half-Duplex Duplex 1.5. I/O 128 Serial Communication Simplex Half-Duplex Duplex 129 Serial Communication Master-Slave Master Master-Multi-Slave Master Slave Slave Slave (Multi-)Master Multi-Slave Master Slave Slave Slave

More information

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso

Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso Design and development of embedded systems for the Internet of Things (IoT) Fabio Angeletti Fabrizio Gattuso Microcontroller It is essentially a small computer on a chip Like any computer, it has memory,

More information

Design Development and Implementation of SPI

Design Development and Implementation of SPI MIT International Journal of Electronics and Communication Engineering, Vol. 4, No. 2, August 2014, pp. 65 69 65 Design Development and Implementation of SPI A. Sirisha Kurnool (DT), A.P, INDIA M. Sravanthi

More information

ECE 471 Embedded Systems Lecture 20

ECE 471 Embedded Systems Lecture 20 ECE 471 Embedded Systems Lecture 20 Vince Weaver http://web.eece.maine.edu/~vweaver vincent.weaver@maine.edu 20 October 2017 Announcements Project coming Only one person was in class Wednesday due to Career

More information

Application Note, V1.0, Jul AP XC16x. Interfacing the XC16x Microcontroller to a Serial SPI EEPROM. Microcontrollers

Application Note, V1.0, Jul AP XC16x. Interfacing the XC16x Microcontroller to a Serial SPI EEPROM. Microcontrollers Application Note, V1.0, Jul. 2006 AP16095 XC16x Interfacing the XC16x Microcontroller to a Serial SPI EEPROM Microcontrollers Edition 2006-07-10 Published by Infineon Technologies AG 81726 München, Germany

More information

McMaster University Embedded Systems. Computer Engineering 4DS4 Lecture 6 Serial Peripherals Amin Vali Feb. 2016

McMaster University Embedded Systems. Computer Engineering 4DS4 Lecture 6 Serial Peripherals Amin Vali Feb. 2016 McMaster University Embedded Systems Computer Engineering 4DS4 Lecture 6 Serial Peripherals Amin Vali Feb. 2016 Serial Peripherals I2C Inter-IC Bus X/Y Coord. RGB data LCD config controller LCD data controller

More information

Serial Peripheral Interface Bus SPI

Serial Peripheral Interface Bus SPI Serial Peripheral Interface Bus SPI SPI Bus Developed by Motorola in the mid 1980 s Full-duplex, master-slave serial bus suited to data streaming applications for embedded systems Existing peripheral busses

More information

USART. USART stands for Universal Synchronous Asynchronous Receiver Transmitter. Full-duplex NRZ asynchronous serial data transmission

USART. USART stands for Universal Synchronous Asynchronous Receiver Transmitter. Full-duplex NRZ asynchronous serial data transmission USART 1 USART USART stands for Universal Synchronous Asynchronous Receiver Transmitter Full-duplex NRZ asynchronous serial data transmission Offer wide ranges of baud rate 2 Serial communication Can support

More information

ECE2049: Embedded Computing in Engineering Design C Term Spring 2018

ECE2049: Embedded Computing in Engineering Design C Term Spring 2018 ECE2049: Embedded Computing in Engineering Design C Term Spring 2018 Lecture #19: Using SPI The LCD Screen and DAC Reading for Today: User's Manual Ch 35, Davies 101.5, DAC datasheet Reading for Next Class:

More information

Serial Communication. Spring, 2018 Prof. Jungkeun Park

Serial Communication. Spring, 2018 Prof. Jungkeun Park Serial Communication Spring, 2018 Prof. Jungkeun Park Serial Communication Serial communication Transfer of data over a single wire for each direction (send / receive) Process of sending data one bit at

More information

Motherboard to MicroZed Interfaces

Motherboard to MicroZed Interfaces Motherboard to MicroZed Interfaces Excerpts and Thoughts on Various Interfaces Christopher Woodall Benjamin Havey ADC Data (Parallel) Interface Requirements

More information

Hello, and welcome to this presentation of the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter Interface. It covers the main features

Hello, and welcome to this presentation of the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter Interface. It covers the main features Hello, and welcome to this presentation of the STM32 Universal Synchronous/Asynchronous Receiver/Transmitter Interface. It covers the main features of this USART interface, which is widely used for serial

More information

Serial Peripheral Interface (SPI) Host Controller Data Sheet

Serial Peripheral Interface (SPI) Host Controller Data Sheet Serial Peripheral Interface (SPI) Host Controller Data Sheet Proven System Block (PSB) for QuickLogic Customer Specific Standard Products (CSSPs) Features Supports Master configuration (Multi-Master configuration

More information

UART TO SPI SPECIFICATION

UART TO SPI SPECIFICATION UART TO SPI SPECIFICATION Author: Dinesh Annayya dinesha@opencores.org Table of Contents Preface... 3 Scope... 3 Revision History... 3 Abbreviations... 3 Introduction... 3 Architecture... 4 Baud-rate generator

More information

Module 3.C. Serial Peripheral Interface (SPI) Tim Rogers 2017

Module 3.C. Serial Peripheral Interface (SPI) Tim Rogers 2017 Module 3.C Serial Peripheral Interface (SPI) Tim Rogers 2017 Learning Outcome #3 An ability to effectively utilize the wide variety of peripherals integrated into a contemporary microcontroller How? A:

More information

PAN502x Capacitive Touch Controller Datasheet

PAN502x Capacitive Touch Controller Datasheet PAN502x Capacitive Touch Controller sheet PAN502x-A-A, Rev 1.0 Panchip Microelectronics www.panchip.com Copyright@2014, Panchip Microelectronics, CO., LTD. All right reserved. 1 / 16 Table of Contents

More information

1 The Attractions of Soft Modems

1 The Attractions of Soft Modems Application Note AN2451/D Rev. 0, 1/2003 Interfacing a Low Data Rate Soft Modem to the MCF5407 Microprocessor The traditional modem has been a box or an add-on card with a phone connection on one end and

More information

LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI

LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI LABORATORIO DI ARCHITETTURE E PROGRAMMAZIONE DEI SISTEMI ELETTRONICI INDUSTRIALI Laboratory Lesson 5: -Timers Prof. Luca Benini Simone Benatti Bojan Milosevic

More information

SPI Framework Module Guide

SPI Framework Module Guide Application Note Introduction This module guide will enable you to effectively use a module in your own design. Upon completion of this guide, you will be able to add this module to your own design, configure

More information

Gaussmeter click. PID: MIKROE 3099 Weight: 23 g

Gaussmeter click. PID: MIKROE 3099 Weight: 23 g Gaussmeter click PID: MIKROE 3099 Weight: 23 g Gaussmeter click is a device that is used for measuring the magnetic field in X, Y and Z axes. This Click board features the MLX90393, a micropower magnetometer

More information

AN-1025 APPLICATION NOTE

AN-1025 APPLICATION NOTE APPLICATION NOTE One Technology Way PO Box 9106 Norwood, MA 02062-9106, USA Tel: 7813294700 Fax: 7814613113 wwwanalogcom Utilization of the First In, First Out (FIFO) Buffer in Analog Devices, Inc Digital

More information

AN510 Using SPI protocol with pressure sensor modules

AN510 Using SPI protocol with pressure sensor modules 1 USING SPI PROTOCOL WITH PRESSURE SENSOR MODULES This application note describes the possibility of communication between a microcontroller and MEAS Switzerland's pressure sensor modules (MS55XX series)

More information

The 9S12 Serial Peripheral Inteface (SPI) Huang Section 10.2 through 10.6 SPI Block User Guide

The 9S12 Serial Peripheral Inteface (SPI) Huang Section 10.2 through 10.6 SPI Block User Guide The 9S12 Serial Peripheral Inteface (SPI) Huang Section 102 through 106 SPI Block User Guide The 9S12 Serial Peripheral Interface (SPI) The 9S12 has a Synchronous Serial Interface On the 9S12 it is called

More information

Mbed Microcontroller SPI. Spring, 2018 Prof. Jungkeun Park

Mbed Microcontroller SPI. Spring, 2018 Prof. Jungkeun Park Mbed Microcontroller SPI Spring, 2018 Prof. Jungkeun Park SPI Logic Signals Full duplex mode using a master-slave architecture Single master Originates the frame for reading and writing https://en.wikipedia.org/wiki/serial_peripheral_interface_bus

More information

ZigBee Compliant Platform 2.4G RF Low Power Transceiver Module for IEEE Standard. DATA SHEET Version B

ZigBee Compliant Platform 2.4G RF Low Power Transceiver Module for IEEE Standard. DATA SHEET Version B ZMD400-A01 ZigBee Compliant Platform 2.4G RF Low Power Transceiver Module for IEEE 802.15.4 Standard DATA SHEET Version B Quan International Co., Ltd., ZMD400 Features Fully compliant 802.15.4 Standard

More information

The Serial Peripheral Interface

The Serial Peripheral Interface (SPI) ARSLAB - Autonomous and Robotic Systems Laboratory Dipartimento di Matematica e Informatica - Università di Catania, Italy santoro@dmi.unict.it L.S.M. 1 Course What is SPI? The SPI Serial Peripheral

More information

DEVBOARD3 DATASHEET. 10Mbits Ethernet & SD card Development Board PIC18F67J60 MICROCHIP

DEVBOARD3 DATASHEET. 10Mbits Ethernet & SD card Development Board PIC18F67J60 MICROCHIP DEVBOARD3 DATASHEET 10Mbits Ethernet & SD card PIC18F67J60 MICROCHIP Version 1.0 - March 2009 DEVBOARD3 Version 1.0 March 2009 Page 1 of 7 The DEVBOARD3 is a proto-typing board used to quickly and easily

More information

From Datasheets to Digital Logic. synthesizing an FPGA SPI slave from the gates

From Datasheets to Digital Logic. synthesizing an FPGA SPI slave from the gates From Datasheets to Digital Logic synthesizing an FPGA SPI slave from the gates Joshua Vasquez March 26, 2015 The Road Map Top-Level Goal Motivation What is SPI? SPI Topology SPI Wiring SPI Protocol* Defining

More information

± 2g Tri-axis Accelerometer Specifications

± 2g Tri-axis Accelerometer Specifications Product Description The is a Tri-axis, silicon micromachined accelerometer with a full-scale output range of +/-2g (19.6 m/s/s). The sense element is fabricated using Kionix s proprietary plasma micromachining

More information

IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -4 1 UNIT 4

IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -4 1 UNIT 4 IV B.Tech. I Sem (R13) ECE : Embedded Systems : UNIT -4 1 UNIT 4 4.1. Serial data communication basics ----------- 1 4.2. UART ------------------------------------------------ 4 4.3. Serial Peripheral

More information

Asynchronous & Synchronous Serial Communications Interface. Student's name & ID (1): Partner's name & ID (2): Your Section number & TA's name

Asynchronous & Synchronous Serial Communications Interface. Student's name & ID (1): Partner's name & ID (2): Your Section number & TA's name MPS Serial Communication Lab Exercise Asynchronous & Synchronous Serial Communications Interface Student's name & ID (1): Partner's name & ID (2): Your Section number & TA's name Notes: You must work on

More information

17. I 2 C communication channel

17. I 2 C communication channel 17. I 2 C communication channel Sometimes sensors are distant to the microcontroller. In such case it might be impractical to send analog signal from the sensor to the ADC included in the microcontroller

More information

Arduino Uno R3 INTRODUCTION

Arduino Uno R3 INTRODUCTION Arduino Uno R3 INTRODUCTION Arduino is used for building different types of electronic circuits easily using of both a physical programmable circuit board usually microcontroller and piece of code running

More information

PIXI click PID: MIKROE Weight: 28 g

PIXI click PID: MIKROE Weight: 28 g PIXI click PID: MIKROE-2817 Weight: 28 g PIXI click is equipped with MAX11300 IC from Maxim Integrated, which features Maxim Integrated's versatile, proprietary PIXI technology - it is the industry's first

More information

Design with Microprocessors

Design with Microprocessors Design with Microprocessors Lecture 6 Interfaces for serial communication Year 3 CS Academic year 2017/2018 1 st Semester Lecturer: Radu Dănescu Serial communication modules on AVR MCUs Serial Peripheral

More information

AN HI-3200 Avionics Data Management Engine Evaluation Board Software Guide

AN HI-3200 Avionics Data Management Engine Evaluation Board Software Guide August 12, 2011 AN - 166 HI-3200 Avionics Data Management Engine Evaluation Board Software Guide Introduction This application note provides more detail on the HI-3200 demo software provided in the Holt

More information

The I2C BUS Interface

The I2C BUS Interface The I 2 C BUS Interface ARSLAB - Autonomous and Robotic Systems Laboratory Dipartimento di Matematica e Informatica - Università di Catania, Italy santoro@dmi.unict.it L.S.M. 1 Course What is I 2 C? I

More information

USER GUIDE EDBG. Description

USER GUIDE EDBG. Description USER GUIDE EDBG Description The Atmel Embedded Debugger (EDBG) is an onboard debugger for integration into development kits with Atmel MCUs. In addition to programming and debugging support through Atmel

More information

SPI Block User Guide V02.07

SPI Block User Guide V02.07 DOCUMENT NUMBER S12SPIV2/D SPI Block User Guide V02.07 Original Release Date: 21 JAN 2000 Revised: 11 Dec 2002 Motorola, Inc. Motorola reserves the right to make changes without further notice to any products

More information

Lecture 14 Serial Peripheral Interface

Lecture 14 Serial Peripheral Interface www.atomicrhubarb.com/systems Lecture 14 Serial Peripheral Interface Section Topic Where in the books Zilog PS220 "Enhanced Serial Peripheral Interface" Assorted datasheets Synchronous Serial Buses 1-wire

More information

Pressure 4 click. PID: MIKROE 3020 Weight: 24 g

Pressure 4 click. PID: MIKROE 3020 Weight: 24 g Pressure 4 click PID: MIKROE 3020 Weight: 24 g Pressure 4 click is an absolute barometric pressure measurement Click board, which features a low power consumption, high precision barometric pressure sensor.

More information

Serial Communications

Serial Communications 1 Serial Interfaces 2 Embedded systems often use a serial interface to communicate with other devices. Serial Communications Serial implies that it sends or receives one bit at a time. Serial Interfaces

More information

Microcontroller basics

Microcontroller basics FYS3240 PC-based instrumentation and microcontrollers Microcontroller basics Spring 2017 Lecture #4 Bekkeng, 30.01.2017 Lab: AVR Studio Microcontrollers can be programmed using Assembly or C language In

More information

SPI 3-Wire Master (VHDL)

SPI 3-Wire Master (VHDL) SPI 3-Wire Master (VHDL) Code Download Features Introduction Background Port Descriptions Clocking Polarity and Phase Command and Data Widths Transactions Reset Conclusion Contact Code Download spi_3_wire_master.vhd

More information

M68HC08 Microcontroller The MC68HC908GP32. General Description. MCU Block Diagram CPU08 1

M68HC08 Microcontroller The MC68HC908GP32. General Description. MCU Block Diagram CPU08 1 M68HC08 Microcontroller The MC68HC908GP32 Babak Kia Adjunct Professor Boston University College of Engineering Email: bkia -at- bu.edu ENG SC757 - Advanced Microprocessor Design General Description The

More information

Hands-On with STM32 MCU Francesco Conti

Hands-On with STM32 MCU Francesco Conti Hands-On with STM32 MCU Francesco Conti f.conti@unibo.it Calendar (Microcontroller Section) 07.04.2017: Power consumption; Low power States; Buses, Memory, GPIOs 20.04.2017 21.04.2017 Serial Interfaces

More information

Application Guidelines for LIS3DSH State Machine

Application Guidelines for LIS3DSH State Machine Application Guidelines for LIS3DSH State Machine June 24 2013 AMS Application Team Application RtM Agenda 2 Educational part: What is state machine? Applications of state machine State Machine of LIS3DSH

More information

Real-Time Embedded Systems. CpE-450 Spring 06

Real-Time Embedded Systems. CpE-450 Spring 06 Real-Time Embedded Systems CpE-450 Spring 06 Class 5 Bruce McNair bmcnair@stevens.edu 5-1/42 Interfacing to Embedded Systems Distance 100 m 10 m 1 m 100 cm 10 cm "Transmission line" capacitance ( C) Distance

More information

Section 16. Basic Sychronous Serial Port (BSSP)

Section 16. Basic Sychronous Serial Port (BSSP) M 16 Section 16. Basic Sychronous Serial Port (BSSP) BSSP HIGHLIGHTS This section of the manual contains the following major topics: 16.1 Introduction...16-2 16.2 Control Registers...16-3 16.3 SPI Mode...16-6

More information

Parallel Data Transfer. Suppose you need to transfer data from one HCS12 to another. How can you do this?

Parallel Data Transfer. Suppose you need to transfer data from one HCS12 to another. How can you do this? Introduction the Serial Communications Huang Sections 9.2, 10.2, 11.2 SCI Block User Guide SPI Block User Guide IIC Block User Guide o Parallel vs Serial Communication o Synchronous and Asynchronous Serial

More information

Hello, and welcome to this presentation of the STM32 Low Power Universal Asynchronous Receiver/Transmitter interface. It covers the main features of

Hello, and welcome to this presentation of the STM32 Low Power Universal Asynchronous Receiver/Transmitter interface. It covers the main features of Hello, and welcome to this presentation of the STM32 Low Power Universal Asynchronous Receiver/Transmitter interface. It covers the main features of this interface, which is widely used for serial communications.

More information

Nano RK And Zigduino. wnfa ta course hikaru4

Nano RK And Zigduino. wnfa ta course hikaru4 Nano RK And Zigduino wnfa ta course hikaru4 Today's outline Zigduino v.s. Firefly Atmel processor and the program chip I/O Interface on the board Atmega128rfa1, FTDI chip... GPIO, ADC, UART, SPI, I2C...

More information

Module Introduction. PURPOSE: The intent of this module, is to explain several of the important features of Freescale s i.mx1 applications processor.

Module Introduction. PURPOSE: The intent of this module, is to explain several of the important features of Freescale s i.mx1 applications processor. Module Introduction PURPOSE: The intent of this module, is to explain several of the important features of Freescale s i.mx1 applications processor. OBJECTIVES: - Describe the features and functions of

More information

Serial Peripheral Interface (SPI) Last updated 8/7/18

Serial Peripheral Interface (SPI) Last updated 8/7/18 Serial Peripheral Interface (SPI) Last updated 8/7/18 MSP432 SPI eusci = enhanced Universal Serial Communications Interface 2 tj MSP432 SPI ARM (AMBA Compliant) 7/8 bit transmission Master/Slave LSB/MSB

More information