This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

我写的CC2530的模拟SPI程序为什么I/O不能正常工作?

Other Parts Discussed in Thread: CC2530

#define MOSI  P2_0

#define MISO  P2_1

#define SCLK  P2_2

#define CS      P2_3

#define DRDY P2_4

void Initial(void)

{

     CLKCONCMD &= ~0x40;//设置系统时钟源为32MHZ晶振

     while(CLKCONSTA & 0x40);//等待晶振稳定为32M

     CLKCONCMD &= ~0x47;//设置系统主时钟频率为32MHZ

     P2DIR |=0x17;

     P2DIR &=~0x08;

     P2INP &=0x1f;

     P2SEL &=0x1f;

}

我的I/O初始化是这样写的,用到SPI写函数里面,然后在主函数while(1)里面用spi写函数写一个数据,再用逻辑分析仪观察输出时候有的因脚不能正常工作,没有波形,是我配置错了吗?请教一下专家,帮帮我吧!

PS:我先用51单片机写好了的SPI程序,移植到CC2530上,51上波形很正常,用逻辑分析仪可以看到数据,可是到了CC2530上面各种问题出现了!