Part Number:MSP430F5529
用MSP430F5529硬件spi方式驱动一个spi的液晶,可以正常显示,但是按键却无法进入中断,我的相同程序在msp430f2553中是正常的,这是什么原因造成的?
经过排查问题,用模拟spi方式驱动就没有任何问题,我想知道根本的原因。
void initSPI()
{
//SPI Pins
P3SEL |= BIT3 + BIT4; // P3.3,4 option select
P2SEL |= BIT7; // P2.7 option select
//Clock Polarity: The inactive state is high
//MSB First, 8-bit, Master, 3-pin mode, Synchronous
UCA0CTL1 |= UCSWRST; // **Put state machine in reset**
UCA0CTL0 |= UCMST+UCSYNC+UCCKPL+UCMSB; // 3-pin, 8-bit SPI master
// Clock polarity high, MSB
UCA0CTL1 |= UCSSEL_2; // SMCLK
UCA0BR0 |= 0x02; // /2
UCA0BR1 = 0; //
UCA0MCTL = 0; // No modulation
UCA0CTL1 &= ~UCSWRST; // **Initialize USCI state machine**
UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt
P1OUT &= ~BIT2; // Now with SPI signals initialized,
__delay_cycles(100000);
P1OUT |= BIT2; // reset slave
__delay_cycles(100000); // Wait for slave to initialize
}
void SPI_WriteByte(uint8_t MST_Data)
{
UCA0TXBUF = MST_Data; // Transmit first character
while (!(UCA0IFG & UCTXIFG)); // USCI_A0 TX buffer ready?
// guochl:上面这句没有不行,放在传输之前也不行,不知道?
}
guochl guochl:
// UCA0IE |= UCRXIE; // Enable USCI_A0 RX interrupt
// guochl:此句导致按键中断被和谐
未经允许不得转载:TI中文支持网 » MSP430F5529: MSP430F5529的SPI屏蔽了按键中断问题
相关推荐
- MSP430F5529: 编译出错,不知道如何解决
- MSP430F5529: 新人求解,Error connecting to the target:Unknown device
- MSP430F5529: PC的设备管理器无法识别MSP430
- MSP430F5529: 软件乱码问题
- MSP430F5529: fireware固件更新失败,无法修复
- MSP430F5529: Unable to burn program with CCS (MSP430F5529LP with type C port)
- MSP430F5529: 在哪里可以取得io430.h和io430f5529.h文件?
- OPT3101EVM: OPT3101 EVM 挂载外部EEPROM