欢迎访问ic37.com |
会员登录 免费注册
发布采购

LMV321IDBVR 参数 Datasheet PDF下载

LMV321IDBVR图片预览
型号: LMV321IDBVR
PDF下载: 下载PDF文件 查看货源
内容描述: 适用于MSP430的Launchpad [Works with MSP430 Launchpad]
分类和应用:
文件页数/大小: 14 页 / 554 K
品牌: TI [ TEXAS INSTRUMENTS ]
 浏览型号LMV321IDBVR的Datasheet PDF文件第1页浏览型号LMV321IDBVR的Datasheet PDF文件第2页浏览型号LMV321IDBVR的Datasheet PDF文件第3页浏览型号LMV321IDBVR的Datasheet PDF文件第4页浏览型号LMV321IDBVR的Datasheet PDF文件第6页浏览型号LMV321IDBVR的Datasheet PDF文件第7页浏览型号LMV321IDBVR的Datasheet PDF文件第8页浏览型号LMV321IDBVR的Datasheet PDF文件第9页  
MSP430 Code
4.1.1
TC5405 Overview
As shown in
a ten bit serial transfer is required to set the five outputs on the TCA5405. The first
four bits, 0101 (S0-S3), act as a start flag for the TCA5405. S0 is a start bit and S1-S3 are the clock sense
bits for the TCA5405. The next five bits (D4-D0) are the data bits associated with each of the outputs. The
tenth bit returns the serial line back to high to ready the TCA5405 for the next input.
In the source code there are two methods to handle this communication. These functions are located in
Single_Wire.c
1. Use a GPIO (general purpose input/output) and a clock delay to emulate S0-D0.
2. Use one of the MSP430 timers to change the output at a specified bit interval.
4.1.2
bit_bang_TCA5405_byte(unsigned char byte)
The function bi_bang_TCA5405_byte(unsigned char byte) will emulate the required ten bits for
communication with the TCA5405. This function works very simply by driving a GPIO pin to high or low
and utilizing the _delay_cycles() function to hold the value. After each assert on the GPIO pin a
_delay_cycles(16) is called to wait roughly 2 microseconds before the next bit. The section that handles
the data bits (D4-D0) only uses a _delay_cycles(10) function; this is to adjust for the time spent on if
statements.
4.1.3
send_TCA5405_byte
The function send_TCA5405_byte(unsigned char byte) along with 5405_Timer_ISR() implements the
required serial data by using one of the MSP430 timers. When a byte is sent to send_TCA5405_byte(),
the function adds the start flag (S0-S3) to the beginning and the stop bit (1) to the end (LSB), stores the
new value to a global variable, and enables the timer interrupts. After a set number of clock cycles defined
by NEXT_BIT_TIME, 5405_Timer_ISR() is called and adjusts the output of the P2.0 accordingly.
NOTE:
The start flag S0-S3 is hard coded into each of these methods
SCPU034
December 2011
TCA7408EVM,TCA5405EVM
Copyright
©
2011, Texas Instruments Incorporated
5