CC2500芯片解读
void main()
{
WDTCTL = WDTPW + WDTHOLD;
InitSys();
P3DIR|=BIT0+BIT1+BIT3;
P4DIR|=BIT0;
P1SEL=0x00;
P3SEL=0x00;
CpuInit();
POWER_UP_RESET_CC2500();
halRfWriteRfSettings();
halSpiWriteBurstReg(CCxxx0_PATABLE,PaTabel,8);
while(1)
{
halSpiStrobe(CCxxx0_SIDLE);
halRfSendPacket(txBuffer,3);
delay(1000);
}
}
void halRfSendPacket(INT8U *txBuffer, INT8U size)
{
halSpiWriteReg(CCxxx0_TXFIFO, size);
halSpiWriteBurstReg(CCxxx0_TXFIFO, txBuffer, size); //写入要发送的数据
//VER=halSpiReadStatus(0x3A); //读出发送的数据个
halSpiStrobe(CCxxx0_STX); //进入发送模式发送数据
while (!GDO0); // Wait for GDO0 to be set -> sync transmitted
while (GDO0); // Wait for GDO0 to be cleared -> end of packet
halSpiStrobe(CCxxx0_SFTX);
}
一直停在while(!GDO0)这里,我检查了下,什么配置都正确写入了,然后复位以后,GDO0上有135KHZ的脉冲,但是数据发不出去
void halRfSendPacket(INT8U *txBuffer, INT8U size)
{
halSpiWriteReg(CCxxx0_TXFIFO, size);
halSpiWriteBurstReg(CCxxx0_TXFIFO, txBuffer, size); //写入要发送的数据
//VER=halSpiReadStatus(0x3A); //读出发送的数据个
halSpiStrobe(CCxxx0_STX); //进入发送模式发送数据
while (!GDO0); // Wait for GDO0 to be set -> sync transmitted
while (GDO0); // Wait for GDO0 to be
我想学 但们都还没入 唉!没人指导 效率低!