EasyManuals Logo

Texas Instruments MSP430 User Manual

Texas Instruments MSP430
413 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #242 background imageLoading...
Page #242 background image
242
USCI SPI Interfacing SSD1306 OLED Display
SPI is perhaps best known for the communication speed it offers. This raw communication speed is
most needed when we need to interface external memories and smart displays like TFT displays and
OLED displays. Here, we will see how to interface a SSD1306 OLED display with MSP430 using half-
duplex or unidirectional USCI-based SPI communication bus.
Code Example
HW_SPI.h
#include <msp430.h>
void HW_SPI_init(void);
void SPI_write(unsigned char tx_data);
unsigned char SPI_read(void);
unsigned char SPI_transfer(unsigned char tx_data);
HW_SPI.c
#include "HW_SPI.h"
void HW_SPI_init(void)
{
UCB0CTL1 |= UCSWRST;
UCB0CTL0 = UCCKPH | UCMSB | UCMST | UCMODE_1 | UCSYNC;
UCB0CTL1 = UCSSEL_2;
UCB0BR0 = 8;
UCB0BR1 = 0;
UCB0CTL1 &= ~UCSWRST;
}
void SPI_write(unsigned char tx_data)

Table of Contents

Other manuals for Texas Instruments MSP430

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the Texas Instruments MSP430 and is the answer not in the manual?

Texas Instruments MSP430 Specifications

General IconGeneral
BrandTexas Instruments
ModelMSP430
CategoryMicrocontrollers
LanguageEnglish

Related product manuals