使用msp430F5529的IIC模块 SCL无时钟输出,这个问题可能出现在什么地方??
使用msp430F5529的IIC模块,控制一个数字电阻器DS1803,将P3.0(UCB0IICSDA)和P3.1(UCB0IICSCL)与ds1803的对应管脚连接,同时通过上拉电阻连接DVCC(3.3V),按照示例程序,修改从机地址和发送内容,完全没响应。
用示波器查看,3.1没有时钟输出,只有开始时候跳变到底,这是个什么情况?
有大神能帮帮忙吗,调了3天了,查到了一些问题,但是无助于结果啊?
程序如下:
#include "msp430x552x.h"
unsigned char *PTxData; // Pointer to TX data
unsigned char TXByteCtr;
const unsigned char TxData[] = // Table of data to transmit
{ 0xA9,0xFB }; // 这里的发送内容做了改动
void main(void)
{
unsigned int i;
WDTCTL = WDTPW + WDTHOLD; // Stop WDT
P3SEL |= 0x03; // Assign I2C pins to USCI_B0
UCB0CTL1 |= UCSWRST; // Enable SW reset
UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC; // I2C Master, synchronous mode
UCB0CTL1 = UCSSEL_2 + UCSWRST; // Use SMCLK, keep SW reset
UCB0BR0 = 12; // fSCL = SMCLK/12 = ~100kHz
UCB0BR1 = 0;
UCB0I2CSA = 0x29; // Slave Address is 048h
//从地址由示例程序更改。由此确定start后的首字节为0x53,01010011,1-7位为从地址,0位为R/W位。
UCB0CTL1 &= ~UCSWRST; // Clear SW reset, resume operation
UCB0IE |= UCTXIE + UCNACKIE; // Enable TX interrupt
for(i=0;i<10;i++); // Delay required between transaction
PTxData = (unsigned char *)TxData; // TX array start address
// Place breakpoint here to see each
// transmit operation.
TXByteCtr = sizeof TxData; // Load TX byte counter
while (UCB0CTL1 & UCTXSTP); // Ensure stop condition got sent