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 #269 background imageLoading...
Page #269 background image
269
Simulation
Explanation
Software SPI requires digital I/Os only. Software SPI is achieved using bit-banging technique. For this
demo, a MCP4921 12-bit DAC is used. This DAC communicates with a host micro using SPI bus. Check
the function below. Here from the data bit to the clock signal, everything is controlled by changing the
logic states of digital I/Os. The changes are done in such a way that they do exactly the same thing a
hardware SPI would have done. If we used hardware-based SPI as in the last example, it would have
taken one or two lines of code unlike the long listing given below. This extra coding along with some
hardware limitations reduces SPI clock speed.
void MCP4921_write(unsigned char cmd, unsigned int dac_value)
{
unsigned char s = 16;
unsigned int value = 0;
value = cmd;
value <<= 8;
value |= (dac_value & 0x0FFF);
CS_LOW();

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