此帖出自微控制器 MCU论坛
最新回复
多多指教:
// P9.1,2,3 option select
P9SEL |= 0xe;
// **Put state machine in reset**
UCB2CTL1 |= UCSWRST;
// 3-pin, 8-bit SPI master
// Clock polarity high, MSB
UCB2CTL0 |= UCMST+UCSYNC+UCMSB+UCCKPH;
// SMCLK
UCB2CTL1 |= UCSSEL_2;
UCB2BR0 = 2; //2
UCB2BR1 = 0; //
//UCB2STAT |= 0x80;
// No modulation
//UCB2MCTL = 0;
// **Initialize USCI state machine**
UCB2CTL1 &= ~UCSWRST;
// Ena××e USCI_B2 RX interrupt
//UCB2IE |= UCRXIE;
P10DIR |= BIT6;
// Wait for sl××e to initialize
__delay_cycles(100);
详情
回复
发表于 2009-12-24 09:58
| ||
|
||
此帖出自微控制器 MCU论坛
| ||
|
||
| |
|
|
| |
|
|
此帖出自微控制器 MCU论坛
| ||
|
||
EEWorld Datasheet 技术支持