If we can just send 1 signal correctly over the SPI MOSI line, then Lab 4 will work!!!

Size: px
Start display at page:

Download "If we can just send 1 signal correctly over the SPI MOSI line, then Lab 4 will work!!!"

Transcription

1 If we can just send 1 signal correctly over the SPI MOSI line, then Lab 4 will work!!! Design and implementation details on the way to a valid SPI-LCD interface driver

2 Slides 3 to 13 are old versions of the new code in Ideas for Lab 4 Laboratories Skipping to hardware details in Slide 13 2/ 29

3 To be tackled today Review -- What is SPI? Review -- What is the SPI master slave relationship? How do we configure the SPI interface inside the Blackfin? How do we activate the chip-select line PF5? Does activating the PF5 line as SPI output control mean we have to change all the SetupPF8to11ASM( ) and other routines? When do we activate the chip-select line, and how long for? What happens when there is not a new value in the SPI transmit buffer what does the SPI interface do it can t do nothing does it start transmitting zeros (which would turn out all the LEDs we just turned on One function left to be developed InitHardware_SPI( ), NO_DELAY, RUN_ONCE) perhaps contains InitializeSPI (unsigned short int SPI_baudrate); and void StartSPI_ASM(void); 3/ 29

4 Lab 4 looks something like three new types of uttcos threads InitScheduler( ) AddThread(InitHardware, NO_DELAY, RUN_ONCE) AddThread(Init_SPI, NO_DELAY, RUN_ONCE) AddThread(SPI_WriteMessages, SHORT_DELAY, RUN_OFTEN) AddThread(SPI_Message_InitLCD, 2 * SHORT_DELAY, RUN_ONCE); AddThread(MeasureTemperatureTiming, NO_DELAY, 1); AddThread(CalculateTemperature, QUARTER_SECOND, QUARTER_SECOND) AddThread(DisplayTempertureLED, 3/8 seconds, QUARTER_SECOND) AddThread(SPI_Message_HappyXmasLCD, 4.5_SECOND, THREE_SECONDS); AddThreadSPI_Message_TemperatureLCD, 5.5_SECOND, THREE_SECONDS); AddThread(SPI_511RULES_LCD, 6.5_SECOND, THREE_SECONDS); StartScheduler( ) Loop GotoSleepTillInterrupt Dispatch Tasks -- DO CODE REVIEW

5 SPI_Message_LCD( ) ; All message threads look similar extern bool SPI_InUse; extern bool sendinstruction; extern int numwordslefttosend; extern int numwordssent; extern unsigned short int arraytosend[150]; void SPI_Message(void) { if (SPI_InUse == true) return; SPI_InUse = true; char message[ ] = My message ; CopyCharArrayToIntArray(arrayToSend, message); numwordssent = 0; sendinstruction = false; numwordslefttosend = strlen(message); } 5/ 29

6 SPI_Message_InitLCD ( ) ; extern bool SPI_InUse; extern bool sendinstruction; extern int numwordslefttosend; extern int numwordssent; extern unsigned short int arraytosend[150]; void SPI_InitMessage(void) { if (SPI_InUse == true) return; SPI_InUse = true; char message[ ] = { 0x30, 0x30, etc}; CopyCharArrayToIntArray(arrayToSend, message); numwordssent = 0; sendinstruction = true; numwordslefttosend = strlen(message); } 6/ 29

7 SPI_Message_Temperature ( ) ; extern bool SPI_InUse; extern bool sendinstruction; extern int numwordslefttosend; extern int numwordssent; extern unsigned short int arraytosend[150]; void SPI_MessageTemperature(void) { if (SPI_InUse == true) return; SPI_InUse = true; // Different way to copy char [ ] sprintf(arraytosend, Temperature is %f C, Lab3_temperature); numwordssent = 0; sendinstruction = true; numwordslefttosend = strlen(arraytosend); } 7/ 29

8 Lab 4 looks something like three new types of uttcos threads InitScheduler( ) AddThread(InitHardware, NO_DELAY, RUN_ONCE) AddThread(Init_SPI, NO_DELAY, RUN_ONCE) AddThread(SPI_WriteMessages, SHORT_DELAY, RUN_OFTEN) AddThread(SPI_Message_InitLCD, 2 * SHORT_DELAY, RUN_ONCE); AddThread(MeasureTemperatureTiming, NO_DELAY, 1); AddThread(CalculateTemperature, QUARTER_SECOND, QUARTER_SECOND) AddThread(DisplayTempertureLED, 3/8 seconds, QUARTER_SECOND) AddThread(SPI_Message_HappyXmasLCD, 4.5_SECOND, THREE_SECONDS); AddThreadSPI_Message_TemperatureLCD, 5.5_SECOND, THREE_SECONDS); AddThread(SPI_511RULES_LCD, 6.5_SECOND, THREE_SECONDS); StartScheduler( ) Loop GotoSleepTillInterrupt Dispatch Tasks -- DO CODE REVIEW

9 Void SPI_WriteMessages(void) uttcos thread Do code review bool SPI_InUse = false; bool sendinstruction false; int numwordslefttosend = 0; int numwordssent = 0; unsigned short int arraytosend[150]; enum {EHIGH, ELOW, EHIGH2}; void SPI_WriteMessage(void) { if (SPI_InUse == false) return; // No message to send if (numwordslefttosend == 0) {SPI_InUse = false; return); // all words sent get ready static whichspidriverstate = EHIGH; nextspidrivestate = whichspidriverstate ; switch (whichspidriverstate ) {.. 9/ 29

10 SPI_WriteMessages(void) Do code review switch (whichstate) { case EHIGH; if (SPI_Ready( ) = false) return; // E high RS low WriteSPI(0x0800 arraytosend(numwordssent); nextspidrivestate = ELOW; break; case ELOW; if (SPI_Ready( ) = false) return; // E low RS low WriteSPI(0x0000 arraytosend(numwordssent) nextspidrivestate = EHIGH2; break; case EHIGH2; 10 / 29

11 SPI_WriteMessages(void) Do code review switch (whichstate) { case EHIGH;. break; case ELOW;... break;; case EHIGH2; if (SPI_Ready( ) = false) return; // E high RS low WriteSPI(0x0800 arraytosend(numwordssent); numwordssent++; --numwordslefttosend ; nextspidrivestate = EHIGH; break; } currentspidrivestate = nextspidrivestate; } 11 / 29

12 Lab 4 looks something like three new types of uttcos threads InitScheduler( ) AddThread(InitHardware, NO_DELAY, RUN_ONCE) AddThread(Init_SPI, NO_DELAY, RUN_ONCE) AddThread(SPI_WriteMessages, SHORT_DELAY, RUN_OFTEN) AddThread(SPI_Message_InitLCD, 2 * SHORT_DELAY, RUN_ONCE); AddThread(MeasureTemperatureTiming, NO_DELAY, 1); AddThread(CalculateTemperature, QUARTER_SECOND, QUARTER_SECOND) AddThread(DisplayTempertureLED, 3/8 seconds, QUARTER_SECOND) AddThread(SPI_Message_HappyXmasLCD, 4.5_SECOND, THREE_SECONDS); AddThreadSPI_Message_TemperatureLCD, 5.5_SECOND, THREE_SECONDS); AddThread(SPI_511RULES_LCD, 6.5_SECOND, THREE_SECONDS); StartScheduler( ) Loop GotoSleepTillInterrupt Dispatch Tasks -- DO CODE REVIEW

13 KIS Get something sent over the SPI We need to send 12 signals to LCD We need the wiring correct We need the timing correct We need the signals correct including INIT code TOO COMPLICATED GO FOR KIS Hook up to Interface output to the LEDs on Logic Lab station Send a simple 16-bit value over SPI Does it appear (in the correct Check using E-UNIT not uttcos bit order) on LEDs 13 / 29

14 Lab. 4 interface SPI from Blackfin master (MOSI, MISO, CLK, PF5 SPI to interface (slave) (MOSI, MISO, CLK, slave select ) LINES TO LOGIC LAB LED LOOK HERE FOR EXPECTED SIGNALS HOOK TO LOGIC LAB STATION LIGHTS 14 / 26

15 Things we are missing All relate to SPI HARDWARE bool SPI_Ready(void) --- Quiz 1 void WriteSPI(unsigned short SPIvalue); void InitSPI(void); We are going to have to read the reference sheet 15 / 26

16 Review -- Master / Slave concept Slave Select (Chip Select) We put a value into the Blackfin SPI_TDBR register hardware does the rest Blackfin sends out active low chip select signal PF5 Blackfin sends out the valuebits on the MOSI signal. Slave accepts signal as SS1 is connected to PF5 Then PF5 goes high no more information for SLAVE If we get the first step correct then everything else should happen automatically provided we have set up the SPI interface correctly 16 / 29

17 Review -- Using an SPI interface to logic lab LED SPI_TDBR Blackfin Processor SPI_RXBR MOSI SLAVE SELECT PF5 used (PF0 to PF7) SPI CLOCK MISO SLAVE INPUT INTERFACE CONTROL DATA CJ7 / CJ8 output to LED LOAD Slave to LCD SLAVE OUTPUT INTERFACE SWITCHES (LOGIC LAB) 17 / 29

18 Blackfin transmits 16 bits with THIS format over the MOSI line We don t care about format at the moment THIS IS NEW STUFF DB7, DB6, DB1, DB0 We just want to make something E Enable / Strobe RS valid to appear on 1 MOSI 0 When line this line goes from high to the 1 LCD data low, then the command is send to (latched into) LCD 0 LCD instruction Use test driven development To make LCD respond and to command E-Unit 0x4F0 R/W Then Blackfin must transmit to explore new ideas 0x5F0 ( NOT E High ) TTCOS 1 Read from LCD 0x4F0 ( E low ) 0 Write to LCD 0x5F0 ( E high ) 18 / 29

19 Start with something we know how to do PF5 as Output signal Need to set PF5 as output to make SPI work But if we change Init_MySwitchesASM(); from Lab. 1 too much else MIGHT need changing TEST(GPIO_Setup_TEST) { CHANGING Init_MySwitchesASM(would mean we would have to change all Tests from Lab. 1 } CHANGES NEEDED FOR LAB. 10 (FAR FUTURE) BUT NOT NOW -- CAN WE DO SOMETHING ELSE? 19 / 29

20 void ChangePFtoOutputASM(int which_pins ) Make sure nothing else changes in FIO_DIR so read, then OR, then write ONE SOLUTION -- Review for Quiz 3 and Final exam PF5 GPIO changed to Output without changing other things #include <blackfin.h>.global _ChangePF.;// void ChangePFtoOutputASM(int which_pins ) _ChangePF. P1.L = lo (FIO_DIR); P1.H = hi (FIO_DIR); old_value_r1 = W[P1] (Z); // Get old value -- unsigned new_value_r2 = old_value_r1 which_pins_r0 // INPAR1 in R0 W[P1] = new_value_r2; ssync; // Force Blackfin to do the write (store) NOW not later 20 / 29

21 Blackfin interface details This part is more slave side We care about Blackfin side of SPI interface Possible quiz question is it on reference sheet 21 / 29

22 Concept We write 16-bits (0xFF0A) into SPI_TDBR Hardware transfers this to SHIFT register SPI_TDBR now empty 0x F F 0 A For next 16 ticks of SPI clock MASTER talks to SLAVE Hardware SENDS out 1 bit from shift register over MOSI line to SLAVE each clock tick speeds up to 25 MHz per bit SLAVE talks to MASTER Hardware CAN ALSO RECEIVE 1 bit over MISO line from the SLAVE and puts into shift register each clock tick speeds up to 25 MHz per bit Hardware transfers shift register value (from slave) into SPI_RDBR (receive DBR) SPI_RDBR is now FULL This transmission over a serial line (16-bits 1 at a time) is much slower than other internal Blackfin operation Must be careful not to overwrite last transmission with new transmission by trying to hard writing values too quickly 22 / 29

23 TRY about 0x8000 baud rate to start with 23 / 29

24 SPI_registers -- Hardware Chap. 10 WHAT TO WORRY ABOUT WHAT TO IGNORE SPI_BAUD We want to be able to change this slow it down to??? Maximum serial clock rate is ¼ of the system clock rate SCK freq = Peripheral clock frequency / 2 * SPI_BAUD -- Many Megabits / sec SPI_FLG (Not SPI_FLAG) do we need ChangePFtoOutputASM FLS5 bit activates PF5 as slave select line FLG5 bit could be used by us to control value of PF5 line (Slave select) when FLG5 bit is low, PF5 output is low, when FLG5 bit is high, PF5 output is high, However we would rather have the SPI hardware change PF5 output line at the correct time for us. Page of the manual says if CPHA = 0, the SPI hardware sets the output value (PF5) and the FLG5 bit (that developer sets) is ignored MEANS WE WOULD NOT NEED TO CHANGE MyInitSwitchesASM( )!!!! SOUNDS GOOD TO ME JUST SET PLS5 TO 1 AND THE PROCESSOR DOES THE WORK -- except how do you make CPHA = 0? 24 / 29

25 Status register information RO and W1C bits -- SPI_Ready( ); 25 / 29

26 SPI-registers -- more SPI_STAT SPI Status register Has some read only (RO R-Oh) bits RO bits are changed by processor SPI hardware NOT us Has some write 1 to clear sticky bits which are set when error condition occurs Remember to write 1 to clear these bits during SPI Setup NOT Write 0 SPI_TDBR transmit data buffer register Value written to this register is transmitted over SPI interface Writing to this register clears the SPI transmit interrupt signal One of the questions about writing the SPI_ISR function is answered by this information When we write to the SPI_TDBR register, the interrupt signal is cleared automatically. We don t have to clear a bit as we would do with the core timer and general purpose timer register interrupts However we not writing an SPI_ISR in Lab 4 what a shame all that information going to waste use in Quiz 3 or final perhaps 26 / 29

27 Chapter 10 in reference manual and reference sheet SPI_Ready( ) code We don t have a ready to start bit like coffeepot we have a have finished bit instead NOTE RO not R0 (Read only) SYSTEM CHANGED 27 / 29

28 Set this bit after others set Separate line of code All set in InitSPI( )???????? INFO WE NEEDED This is for SLAVE talking to MASTER 28 / 29

29 SPI_CTL register InitSPI( ) Values needed during setup TIMOD transfer initiation mode 01 Start transfer with write to SPI_TDBR. Interrupt when SPI_TDBR is empty. Timing issues possible here get an interrupt after SPI_TDBR is empty the first time PSSE Slave Select Enable 0 Disable setting this as 1 makes this Blackfin a slave device. There might be circumstances where you want one Blackfin as master, and another as a slave but this is not one of them. SIZE = 1 (16 bits) LSBF Last significant bit first 0 as we want MSBF first as that is the way the LCD interface has been designed MSTR master 1 as we want Blackfin to be master, not slave SPE SPI Enable 1 but we might not want to do this during set-up, configure SPI then enable SPI as last step WOM Write open drain master 0 Normal because this was the way the interface was designed EMISO Enable MISO to allow slave to talk to master 0 Not in this part of the lab GM Get more data 0 when SPI_RDBR (receive buffer) is full discard new incoming data don t really care at the moment 29 / 29

30 SPI_CTL register Things we still don t understand SZ send zeros (or last word again) when SPI_TDBR is empty causes what to happen? Sending zeros sounds bad as that means the LCD will think we are sending it commands SLAVE TALK TO MASTER CPOL clock polarity Means what and do we care? CPHA Clock Phase When CPHA = 1, slave select controlled by user software When CPHA = 0, slave select controlled by SPI hardware MURPHY S RULE any bit whose function is not obvious will be the key of whether you get the interface to work or not 30 / 29

31 VALID slave load on signal transition VALID DATA STORED Figure SLAVE DATA IS LOADED ON L-to-H CLOCK TRANSITION Different than Slave is SELECTED when PF5 = 0 INVALID slave load on signal transition INVALID DATA STORED 31 / 29

32 We are now at the stage where we can do some experimenting with the hardware We know that the following pins are key to the operation of the SPI interface. MOSI this will show the data being transmitted from the SPI interface PF5 chip select line When this is pulled low, then the slave will accept any data being transmitted, otherwise data is ignored When this goes low to high then the serial data transmitted to the slave is latched (converted into a parallel signal that is then sent to LCD as a data or a command request. Place scope probes on these lines 32 / 29

33 Lab 4 quick test Hook up the lines to the logic lab LIGHTS not LCD InitScheduler( ) --- Can also do inside E_Unit Final hint InitHardware Blackfin LED, switches AddTask(Init_SPI, NO_DELAY, RUN_ONCE) AddTask(AnythingOnMOSILine,Test 4.5_SECOND, TWO_SECOND); These commands should appear on LLS LEDS AddTask(MeasureTemperatureTiming, NO_DELAY, 1); AddTask(CalculateTemperature, QUARTER_SECOND, QUARTER_SECOND) AddTask(DisplayTempertureLED, 3/8 seconds, QUARTER_SECOND) AddTask(SPI_Message_HappyXmasLCD, 4.5_SECOND, TWO_SECOND); AddTask(SPI_Message_TemperatureLCD, 5.5_SECOND, TWO_SECOND); StartScheduler( ) Loop GotoSleepTillInterrupt Dispatch Tasks

34 AnythingOnMOSILine( ) This is essentially send a special message bool SPI_In_USE; // SEMAPHORE (lock) short int sendmymessage; // MESSAGE (simple) char SPImessage[80]; // MESSAGE body char SimpleTestMessageWithShakespeare[ ] = {0xFF, 0xAA, 0x23, 0x67, 0x2B,!0x2B, EOS /* end of string character */}; #include <stdio.h> void AnythingOnMOSILine (void) { if (SPI_In_Use == true) return; // Must wait till SPI interface is not in use by another task // SPI_In_Use is false // We want to use the SPI interface block other tasks from using it SPI_In_Use = true; } strcpy(spimessage, SimpleTestMessageWithShakespeare); sendmymessage = DATA; // DEFINE INSTRUCTION AS 2 SOMEWHERE -- DO CODE REVIEW 34 / 26

35 Concept We write 16-bits (0xFF0A) into SPI_TDBR Hardware transfers this to SHIFT register SPI_TDBR now empty For next 16 ticks of SPI clock 0x F F 0 A Hardware sends out 1 bit from shift register over MOSI line to SLAVE each clock tick speeds up to 25 MHz per bit Hardware receives 1 bit over MISO line from the SLAVE and puts into shift register each clock tick speeds up to 25 MHz per bit Hardware transfers shift register value (from slave) into SPI_RDBR (receive DBR) SPI_RDBR is now FULL This transmission over a serial line (16-bits 1 at a time) is much slower than other internal Blackfin operation Must be handled via interrupt control 35 / 29

36 Lab. 4 interface SPI from Blackfin master (MOSI, MISO, CLK, PF5 SPI to interface (slave) (MOSI, MISO, CLK, slave select ) LINES TO LOGIC LAB LED LOOK HERE FOR EXPECTED SIGNALS HOOK TO LOGIC LAB STATION LIGHTS 36 / 26

37 What we should see on scope Sending 0xFF, 0xAA, 0x23, 0x67, EOS Make SPI_BAUD very large (0x8000 very slow SPI transmission) Connect Lab. 4 interface to logic lab station lights (top) See 0x05FF, 0x04FF, 0x05FF Then 0x05AA, 0x04AA, 0x05AA Then 0x0523, 0x0423, 0x0523 Then 0x0567, 0x0467, 0x / 29

38 Things we are missing All relate to SPI HARDWARE bool SPI_Ready(void) { Check SPI Finished bit in SPI status register } void WriteSPI(unsigned short SPIvalue) { Write the value to SPI transmit buffer register } void InitSPI(void) { Set slave select in SPI flag register Set Baud rate Set all necessary bits in SPI Control register Enable SPI interface } 38 / 26

39 Final Lab. 3 and Lab. 4 InitScheduler( ) -- Lab 3 looks something like this AddTask(InitHardware, NO_DELAY, RUN_ONCE) AddTask(MeasureTemperatureTiming, NO_DELAY, 1); AddTask(CalculateTemperature, QUARTER_SECOND, QUARTER_SECOND) AddTask(DisplayTempertureLED, 3/8 seconds, QUARTER_SECOND) AddTask(FlashLED6, NO_DELAY, EIGHTH_SECOND StartScheduler( ) Loop GotoSleepTillInterrupt Dispatch Tasks 39 / 29

40 Lab 4 looks something like three new types of uttcos threads InitScheduler( ) AddThread(InitHardware, NO_DELAY, RUN_ONCE) AddThread(Init_SPI, NO_DELAY, RUN_ONCE) AddThread(SPI_WriteMessages, SHORT_DELAY, RUN_OFTEN) AddThread(SPI_Message_InitLCD, 2 * SHORT_DELAY, RUN_ONCE); AddThread(MeasureTemperatureTiming, NO_DELAY, 1); AddThread(CalculateTemperature, QUARTER_SECOND, QUARTER_SECOND) AddThread(DisplayTempertureLED, 3/8 seconds, QUARTER_SECOND) AddThread(SPI_Message_HappyXmasLCD, 4.5_SECOND, THREE_SECONDS); AddThreadSPI_Message_TemperatureLCD, 5.5_SECOND, THREE_SECONDS); AddThread(SPI_511RULES_LCD, 6.5_SECOND, THREE_SECONDS); StartScheduler( ) Loop GotoSleepTillInterrupt Dispatch Tasks -- DO CODE REVIEW

41 Code reminder using sprintf( ) Xmas message and temperature I want to put the temperature (as a number) into a string that gets transmitted over SPI how would I do that using C? volatile bool SPI_In_USE; // SEMAPHORE (lock) volatile short int sendmymessage; // MESSAGE (simple) volatile char SPImessage[80]; // MESSAGE body volatile float temperature; // Calculated as a Lab. 3 Task // Know terms in red for final #include <stdio.h> -- DO CODE REVIEW void SPI_Message_TemperatureLCD(void) { if (SPI_In_Use == true) return; // Must wait till SPI interface is not in use by another task // SPI_In_Use must be false therefore we can change it and use SPI // We want to use the SPI interface block other tasks from using it SPI_In_Use = true; sprintf(spimessage, Temperature %f4.2 C, temperature); sendmymessage = DATA; // DEFINE DATA AS 1 SOMEWHERE } 41 / 26

42 SPI_Message_LCD( ) ; All look similar extern bool SPI_InUse; extern bool sendinstruction; extern int numwordslefttosend; extern int numwordssent; extern unsigned short int arraytosend[150]; void SPI_Message(void) { if (SPI_InUse == true) return; SPI_InUse = true; char message[ ] = My message ; CopyCharArrayToIntArray(arrayToSend, message); numwordssent = 0; sendinstruction = false; numwordslefttosend = strlen(message); } 42 / 29

43 SPI_Message_InitLCD ( ) ; extern bool SPI_InUse; extern bool sendinstruction; extern int numwordslefttosend; extern int numwordssent; extern unsigned short int arraytosend[150]; void SPI_InitMessage(void) { if (SPI_InUse == true) return; SPI_InUse = true; char message[ ] = { 0x30, 0x30, etc}; CopyCharArrayToIntArray(arrayToSend, message); numwordssent = 0; sendinstruction = true; numwordslefttosend = strlen(message); } 43 / 29

44 SPI_WriteMessages(void) Do code review bool SPI_InUse = false; bool sendinstruction false; int numwordslefttosend = 0; int numwordssent = 0; unsigned short int arraytosend[150]; enum {EHIGH, ELOW, EHIGH2}; SPI_WriteMessage(void) { if (SPI_InUse == false) return; // No message to send if (numwordslefttosend == 0) {SPI_InUse = false; return); // all words sent get ready static whichstate = EHIGH; switch (whichstate) { case EHIGH; if (SPI_Ready( ) = false) return; // E high RS low whichstate = ELOW; WriteSPI(0x0800 arraytosend(numwordssent); 44 / 29

45 SPI_WriteMessages(void) Do code review switch (whichstate) { case EHIGH; if (SPI_Ready( ) = false) return; // E high RS low whichstate = ELOW; WriteSPI(0x0800 arraytosend(numwordssent); break; ; case ELOW; if (SPI_Ready( ) = false) return; // E low RS low whichstate = EHIGH2; WriteSPI(0x0000 arraytosend(numwordssent); break; case EHIGH2; if (SPI_Ready( ) = false) return; // E high RS low whichstate = EHIGH; WriteSPI(0x0800 arraytosend(numwordssent); break; numwordssent++; --numwordslefttosend ; } 45 / 29

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

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

Lab. 2 Overview. Echo Switches to LED to test LEDs and Switches. How would you handle a more complex set of embedded tests

Lab. 2 Overview. Echo Switches to LED to test LEDs and Switches. How would you handle a more complex set of embedded tests Lab. 2 Overview Echo Switches to LED to test LEDs and Switches volatile unsigned char GPIOvalue; // In embedded systems ALL Global variable must be // made volatile (change-able) to reflect they are //

More information

Serial Peripheral Interface (SPI)

Serial Peripheral Interface (SPI) Serial Peripheral Interface (SPI) MSP432 SPI eusci = enhanced Universal Serial Communications Interface 2 tj MSP432 SPI ARM (AMBA Compliant) 7/8 bit transmission Master/Slave LSB/MSB first Separate RX/TX

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

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

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

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

Microcontroller Not just a case of you say tomarto and I say tomayto

Microcontroller Not just a case of you say tomarto and I say tomayto Microprocessor or Microcontroller Not just a case of you say tomarto and I say tomayto M. Smith, ECE University of Calgary, Canada Information taken from Analog Devices On-line Manuals with permission

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

< 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

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

Microprocessor or Microcontroller Not just a case of you say tomarto and I say tomayto

Microprocessor or Microcontroller Not just a case of you say tomarto and I say tomayto Microprocessor or Microcontroller Not just a case of you say tomarto and I say tomayto Discussion of the capabilities of the Analog Devices ADSP-5333 Evaluation Board used in this course M. Smith, ECE

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

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

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

Introduction to Lab. 3

Introduction to Lab. 3 Solving a Lab 1 Issue Introduction to Lab. 3 Also includes Solving a Lab. 1 issues Using the graphics LCD with your assignment 1 Rediscuss the Watchdog timer for Assignment 2 Many people have said My Enable

More information

Graduate Institute of Electronics Engineering, NTU FIR Filter Design, Implement, and Applicate on Audio Equalizing System ~System Architecture

Graduate Institute of Electronics Engineering, NTU FIR Filter Design, Implement, and Applicate on Audio Equalizing System ~System Architecture FIR Filter Design, Implement, and Applicate on Audio Equalizing System ~System Architecture Instructor: Prof. Andy Wu 2004/10/21 ACCESS IC LAB Review of DSP System P2 Basic Structure for Audio System Use

More information

Menu. What is SPI? EEL 3744 EEL 3744 SPI

Menu. What is SPI? EEL 3744 EEL 3744 SPI Menu Concepts >Problems in serial communications Timing Synchronization: How do you line up the bit boundaries? Message Synchronization: How do you line up messages? Look into my... >Synchronous data solves

More information

Microprocessor or Microcontroller Not just a case of you say tomarto and I say tomayto

Microprocessor or Microcontroller Not just a case of you say tomarto and I say tomayto Microprocessor or Microcontroller Not just a case of you say tomarto and I say tomayto Discussion of the capabilities of the Analog Devices ADSP-5333 Evaluation Board used in this course M. Smith, ECE

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

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

ECE 4510/5530 Microcontroller Applications Week 6

ECE 4510/5530 Microcontroller Applications Week 6 ECE 4510/5530 Microcontroller Applications Week 6 Dr. Bradley J. Bazuin Associate Professor Department of Electrical and Computer Engineering College of Engineering and Applied Sciences Lab 5 Element Hardware

More information

Getting the O in I/O to work on a typical microcontroller

Getting the O in I/O to work on a typical microcontroller Getting the O in I/O to work on a typical microcontroller Ideas of how to send output signals to the radio controlled car. The theory behind the LED controller used in the Familiarization Lab Agenda Processors

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

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

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

Real Time Embedded Systems. Lecture 1 January 17, 2012

Real Time Embedded Systems.  Lecture 1 January 17, 2012 SPI 4-Wire 3-Wire Real Time Embedded Systems www.atomicrhubarb.com/embedded Lecture 1 January 17, 2012 Topic Section Topic Where in the books Catsoulis chapter/page Simon chapter/page Zilog UM197 (ZNEO

More information

SPI: Serial Peripheral Interface

SPI: Serial Peripheral Interface ECE3411 Fall 2015 Lab 6c. SPI: Serial Peripheral Interface Marten van Dijk, Syed Kamran Haider Department of Electrical & Computer Engineering University of Connecticut Email: {vandijk, syed.haider}@engr.uconn.edu

More information

Getting the O in I/O to work on a typical microcontroller

Getting the O in I/O to work on a typical microcontroller Getting the O in I/O to work on a typical microcontroller Ideas of how to send output signals to the radio controlled car. The theory behind the LED controller used in the Familiarization Lab Agenda Processors

More information

A look at interrupts Dispatch_Tasks ( )

A look at interrupts Dispatch_Tasks ( ) SHOWS WHERE S FIT IN A look at interrupts Dispatch_Tasks ( ) What are interrupts and why are they needed in an embedded system? Equally as important how are these ideas handled on the Blackfin Assignment

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

Getting Started with ESPI Interface Using the Z8 Encore! XP F1680

Getting Started with ESPI Interface Using the Z8 Encore! XP F1680 Application Note Getting Started with ESPI Interface Using the Z8 Encore! XP F1680 AN027301-0308 Abstract This application note demonstrates how to use the Enhanced Serial Peripheral Interface (ESPI) in

More information

Building a COFFEE POT simulation on CCESS for Blackfin BF533

Building a COFFEE POT simulation on CCESS for Blackfin BF533 Building a COFFEE POT simulation on CCESS 2.6.0 for Blackfin BF533 Last lecture covered some detailed ideas Let step back and do something simpler to get an introduction of ideas needed for Lab0 and Assignment

More information

App Note Application Note: Addressing Multiple FPAAs Using a SPI Interface

App Note Application Note: Addressing Multiple FPAAs Using a SPI Interface Rev: 1.0.0 Date: 23 rd Jan 2015 App Note - 310 Application Note: Addressing Multiple FPAAs Using a SPI Interface TABLE OF CONTENTS 1 PURPOSE... 2 2 THE SPI INTERFACE... 3 2.1 OVERVIEW... 3 2.2 DETAILED

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

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

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

Part 1 Using Serial EEPROMs

Part 1 Using Serial EEPROMs Part 1 Using Serial EEPROMs copyright 1997, 1999 by Jan Axelson If you have a project that needs a modest amount of nonvolatile, read/write memory, serial EEPROM may be the answer. These tiny and inexpensive

More information

Communication. Chirag Sangani

Communication. Chirag Sangani Communication Scope of Communication Telephones and cell phones. Satellite networks. Radio and DTH services. Campus LAN and wireless. Internet. Intra-galactic communication. Essentials of Communication

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

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

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

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

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

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

EECS 373 Design of Microprocessor-Based Systems

EECS 373 Design of Microprocessor-Based Systems EECS 373 Design of Microprocessor-Based Systems Prabal Dutta University of Michigan Lecture 10: Serial buses October 2, 2014 Some material from: Brehob, Le, Ramadas, Tikhonov & Mahal 1 Announcements Special

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

FPGA Implementation Of SPI To I2C Bridge

FPGA Implementation Of SPI To I2C Bridge FPGA Implementation Of SPI To I2C Bridge Abhilash S.Warrier Akshay S.Belvadi Dhiraj R.Gawhane Babu Ravi Teja K Abstract Today s electronic system is not a standalone unit instead working in a group, where

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

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 MPSD 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

More information

EECS 373 Design of Microprocessor-Based Systems

EECS 373 Design of Microprocessor-Based Systems EECS 373 Design of Microprocessor-Based Systems Mark Brehob University of Michigan Timers Material taken from Dreslinski, Dutta, Le, Ramadas, Smith, Tikhonov & Mahal 1 Agenda A bit on timers Project overview

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

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

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

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

Lecture 25 March 23, 2012 Introduction to Serial Communications

Lecture 25 March 23, 2012 Introduction to Serial Communications Lecture 25 March 23, 2012 Introduction to Serial Communications Parallel Communications Parallel Communications with Handshaking Serial Communications Asynchronous Serial (e.g., SCI, RS-232) Synchronous

More information

EECS 373 Design of Microprocessor-Based Systems

EECS 373 Design of Microprocessor-Based Systems EECS 7 Design of Microprocessor-Based Systems Matt Smith University of Michigan Serial buses, digital design Material taken from Brehob, Dutta, Le, Ramadas, Tikhonov & Mahal 1 Timer Program //Setup Timer

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

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

AT89S4D12. 8-Bit Microcontroller with 132K Bytes Flash Data Memory AT89S4D12. Features. Description. Pin Configurations

AT89S4D12. 8-Bit Microcontroller with 132K Bytes Flash Data Memory AT89S4D12. Features. Description. Pin Configurations Features Compatible with MCS-51 Products 128K Bytes of In-System Reprogrammable Flash data memory and 4K Bytes of Downloadable Flash Program Memory Endurance: 1,000 Write/Erase Cycles per Sector Data Retention:

More information

Laboratory 1 Manual V1.2 1 st September 2007 Developing a Blackfin GPIO interface using an automated embedded testing environment

Laboratory 1 Manual V1.2 1 st September 2007 Developing a Blackfin GPIO interface using an automated embedded testing environment Laboratory 1 Manual V1.2 1 st September 2007 Developing a Blackfin GPIO interface using an automated embedded testing environment These pages are cut-and-paste from the Lab. 1 web-pages. I have not spent

More information

DS1306. Serial Alarm Real Time Clock (RTC)

DS1306. Serial Alarm Real Time Clock (RTC) www.dalsemi.com FEATURES Real time clock counts seconds, minutes, hours, date of the month, month, day of the week, and year with leap year compensation valid up to 2100 96-byte nonvolatile RAM for data

More information

LAB4. Program the on chip SPI module

LAB4. Program the on chip SPI module LAB4 Program the on chip SPI module Outline Learn to utilize the on-chip SPI module Implement it in C Translate it to ARM Assembly Test and verify the result using oscilloscope and shift register. 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

a Serial Peripheral Interace (SPI). Embedded RISC Microcontroller Core Peripheral

a Serial Peripheral Interace (SPI). Embedded RISC Microcontroller Core Peripheral Features Full-duplex, 3-wire Synchronous Data Transfer Master or Slave Operation Maximum Bit Frequency of f CLOCK /4 (in M-bits/second) LSB First or MSB First Data Transfer Four Programmable Bit Rates

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

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

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

Chapter Operation Pinout Operation 35

Chapter Operation Pinout Operation 35 68000 Operation 35 Chapter 6 68000 Operation 6-1. 68000 Pinout We will do no construction in this chapter; instead, we will take a detailed look at the individual pins of the 68000 and what they do. Fig.

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

ECE 4510/5530 Microcontroller Applications Week 10

ECE 4510/5530 Microcontroller Applications Week 10 ECE 4510/5530 Microcontroller Applications Week 10 Dr. Bradley J. Bazuin Associate Professor Department of Electrical and Computer Engineering College of Engineering and Applied Sciences ECE 4510/5530

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

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

DS1305EN. Serial Alarm Real-Time Clock

DS1305EN. Serial Alarm Real-Time Clock Serial Alarm Real-Time Clock www.maxim-ic.com FEATURES Real-time clock (RTC) counts seconds, minutes, hours, date of the month, month, day of the week, and year with leap-year compensation valid up to

More information

I2C and SPI Foundation

I2C and SPI Foundation Revision 30 September 2010 Release I2C and SPI Foundation 17 March 2018 changed ref: command f to x Introduction I2C (I squared C) and SPI (Serial peripheral Interface) are two main ways that microcontrollers

More information

DS1305EN. Serial Alarm Real-Time Clock

DS1305EN. Serial Alarm Real-Time Clock Serial Alarm Real-Time Clock www.maxim-ic.com FEATURES Real-time clock (RTC) counts seconds, minutes, hours, date of the month, month, day of the week, and year with leap-year compensation valid up to

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

Addressing scheme to address a specific devices on a multi device bus Enable unaddressed devices to automatically ignore all frames

Addressing scheme to address a specific devices on a multi device bus Enable unaddressed devices to automatically ignore all frames 23. USART 23.1 Features Full-duplex operation Asynchronous or synchronous operation Synchronous clock rates up to 1/2 of the device clock frequency Asynchronous clock rates up to 1/8 of the device clock

More information

IMASK FIO_FLAG_S FIO_DIR SIC_IMASK FIO_EDGE FIO_POLAR ILAT FIO_BOTH TCOUNT FIO_FLAG_D FIO_ENEN PF_STATUS_D

IMASK FIO_FLAG_S FIO_DIR SIC_IMASK FIO_EDGE FIO_POLAR ILAT FIO_BOTH TCOUNT FIO_FLAG_D FIO_ENEN PF_STATUS_D SECTION B -- ATTEMPT NO MORE THAN 2 QUESTIONS These are open-ended questions and you may be required to make some educated, engineering relevant, design decisions. Only the first two answers to questions

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

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

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

USB-910H API DLL and Include File Reference Manual

USB-910H API DLL and Include File Reference Manual USB-910H API DLL and Include File Reference Manual APPLICABLE ADAPTERS This Application Note applies to the following Keterex products: KXUSB-910H. AN2101 Application Note INTRODUCTION The Keterex USB-910H

More information

Project Final Report Internet Ready Refrigerator Inventory Control System

Project Final Report Internet Ready Refrigerator Inventory Control System Project Final Report April 25, 2006 Dustin Graves, dgraves@gwu.edu Project Abstract Appliance vendors have started producing internet enabled refrigerators which allow users to keep track of refrigerator

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

ECE 391 Exam 1 Review Session - Spring Brought to you by HKN

ECE 391 Exam 1 Review Session - Spring Brought to you by HKN ECE 391 Exam 1 Review Session - Spring 2018 Brought to you by HKN DISCLAIMER There is A LOT (like a LOT) of information that can be tested for on the exam, and by the nature of the course you never really

More information

LB5900 Series Power Sensor SPI & I2C Interface Guide

LB5900 Series Power Sensor SPI & I2C Interface Guide LB5900 Series Power Sensor SPI & I2C Interface Guide TABLE OF CONTENTS TABLE OF CONTENTS... 1 NOTICE... 4 GENERAL... 5 Sensor Power... 6 Data Line Electrical Specifications... 6 Commands, Data Transmission

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

COOKING WITH TEAM 279

COOKING WITH TEAM 279 COOKING WITH TEAM 279 ANALOG SIGNALS WITH MCP3002/MCP3008 ADC The RPi does not have analog input pins. To read analog signals, and Analog to Digital Converter (ADC) should be used. The MCP3002 and MCP3008

More information

Synchronous = SPI (3 options)

Synchronous = SPI (3 options) CS/ECE 6780/5780 Al Davis Today s topics: Last lecture general serial I/O concepts more specifics on asynchronous SCI protocol Today specifics of synchronous SPI details of the SCI programming ritual 1

More information

8051 Peripherals. On-Chip Memory Timers Serial Port Interrupts. Computer Engineering Timers

8051 Peripherals. On-Chip Memory Timers Serial Port Interrupts. Computer Engineering Timers 8051 Peripherals On-Chip Memory Timers Serial Port Interrupts Computer Engineering 2 2-1 8051 Timers 8051 Timers The 8051 has 2 internal 16-bit timers named Timer 0 and Timer 1 Each timer is a 16-bit counter

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

FM25CL64 64Kb FRAM Serial 3V Memory

FM25CL64 64Kb FRAM Serial 3V Memory 64Kb FRAM Serial 3V Memory Features 64K bit Ferroelectric Nonvolatile RAM Organized as 8,192 x 8 bits Unlimited Read/Write Cycles 10 Year Data Retention NoDelay Writes Advanced High-Reliability Ferroelectric

More information

Lecture 5: Computing Platforms. Asbjørn Djupdal ARM Norway, IDI NTNU 2013 TDT

Lecture 5: Computing Platforms. Asbjørn Djupdal ARM Norway, IDI NTNU 2013 TDT 1 Lecture 5: Computing Platforms Asbjørn Djupdal ARM Norway, IDI NTNU 2013 2 Lecture overview Bus based systems Timing diagrams Bus protocols Various busses Basic I/O devices RAM Custom logic FPGA Debug

More information

Figure 1: Byte 1 Byte 2 MISO <--- OVF EOM P0 P1 P2 P3 P4 P5 P6 P7 P8 P9 P

Figure 1: Byte 1 Byte 2 MISO <--- OVF EOM P0 P1 P2 P3 P4 P5 P6 P7 P8 P9 P A Winbond Company Applications Note 5A Operations, a Simplified Guide A simple but powerful command structure is built into the 4000 series SPI control port. It s inherent flexibility allows the software

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

PIC-I/O Multifunction I/O Controller

PIC-I/O Multifunction I/O Controller J R KERR AUTOMATION ENGINEERING PIC-I/O Multifunction I/O Controller The PIC-I/O multifunction I/O controller is compatible with the PIC-SERVO and PIC-STEP motor control modules and provides the following

More information

DS1305 Serial Alarm Real Time Clock (RTC)

DS1305 Serial Alarm Real Time Clock (RTC) Serial Alarm Real Time Clock (RTC) www.dalsemi.com FEATURES Real time clock counts seconds, minutes, hours, date of the month, month, day of the week, and year with leap year compensation valid up to 2100

More information

80C51 Block Diagram. CSE Overview 1

80C51 Block Diagram. CSE Overview 1 80C51 Block Diagram CSE 477 8051 Overview 1 80C51 Memory CSE 477 8051 Overview 3 8051 Memory The data width is 8 bits Registers are 8 bits Addresses are 8 bits i.e. addresses for only 256 bytes! PC is

More information

By the end of Class. Outline. Homework 5. C8051F020 Block Diagram (pg 18) Pseudo-code for Lab 1-2 due as part of prelab

By the end of Class. Outline. Homework 5. C8051F020 Block Diagram (pg 18) Pseudo-code for Lab 1-2 due as part of prelab By the end of Class Pseudo-code for Lab 1-2 due as part of prelab Homework #5 on website due before next class Outline Introduce Lab 1-2 Counting Timers on C8051 Interrupts Laboratory Worksheet #05 Copy

More information