【求助】SI4432 能发不能收
经过1周的努力,现在可以发了,但是却怎么都收不到数据,请教下,软件没有初始化好还是硬件问题呢?初始化函数SDN_CLR;
Delay_ms(1000);
SpiWriteAddressData( 0x07 , 0x80);
Delay_ms(100);
SpiReadAddressData(0x03);
SpiReadAddressData(0x04);
SpiWriteAddressData( 0x05 , 0x00);
SpiWriteAddressData( 0x06 , 0x00);
SpiWriteRegister(0x09, 0x7F);
SpiWriteAddressData( 0x0B , 0x12);
SpiWriteAddressData( 0x0C , 0x15);
SpiWriteAddressData( 0x0D , 0x1F);
SpiWriteAddressData( 0x75 , 0x53);
SpiWriteAddressData( 0x76 , 0x4b);
SpiWriteAddressData( 0x77 , 0x00);
SpiWriteRegister(0x6E, 0x4E); //write 0x4E to the TXDataRate 1 register
SpiWriteRegister(0x6F, 0xA5); //write 0xA5 to the TXDataRate 0 register
SpiWriteRegister(0x70, 0x2C);
SpiWriteRegister(0x72, 0x48);
SpiWriteRegister(0x1C, 0x1E); //write 0x1E to the IF Filter Bandwidth register
SpiWriteRegister(0x20, 0xD0); //write 0xD0 to the Clock Recovery Oversampling Ratio register
SpiWriteRegister(0x21, 0x00); //write 0x00 to the Clock Recovery Offset 2 register
SpiWriteRegister(0x22, 0x9D); //write 0x9D to the Clock Recovery Offset 1 register
SpiWriteRegister(0x23, 0x49); //write 0x49 to the Clock Recovery Offset 0 register
SpiWriteRegister(0x24, 0x00); //write 0x00 to the Clock Recovery Timing Loop Gain 1 register
SpiWriteRegister(0x25, 0x24); //write 0x24 to the Clock Recovery Timing Loop Gain 0 register
SpiWriteRegister(0x1D, 0x40); //write 0x40 to the AFC Loop Gearshift Override register
SpiWriteRegister(0x1E, 0x0A); //write 0x0A to the AFC Timing Control register
SpiWriteRegister(0x2A, 0x20);
SpiWriteRegister(0x34, 0x0A); //write 0x0A to the Preamble Length register
//set preamble detection threshold to 20bits
SpiWriteRegister(0x35, 0x2A); //write 0x2A to the Preamble Detection Controlregister
//Disable header bytes; set variable packet length (the length of the payload is defined by the
//received packet length field of the packet); set the synch word to two bytes long
SpiWriteRegister(0x33, 0x02); //write 0x02 to the Header Control2 register
//Set the sync word pattern to 0x2DD4
SpiWriteRegister(0x36, 0x2D); //write 0x2D to the Sync Word 3 register
SpiWriteRegister(0x37, 0xD4); //write 0xD4 to the Sync Word 2 register
//enable the TX & RX packet handler and CRC-16 (IBM) check
SpiWriteRegister(0x30, 0x8D); //write 0x8D to the Data Access Control register
//Disable the receive header filters
SpiWriteRegister(0x32, 0x00 ); //write 0x00 to the Header Control1 register
//enable FIFO mode and GFSK modulation
SpiWriteRegister(0x71, 0x63); //write 0x63 to the Modulation Mode Control 2 register
/*set the GPIO's according to the RF switch */
SpiWriteRegister(0x0C, 0x12); //write 0x12 to the GPIO1 Configuration(set the TX state)
SpiWriteRegister(0x0D, 0x15); //write 0x15 to the GPIO2 Configuration(set the RX state)
/*set the non-default Si443x registers*/
//setcap. bank
SpiWriteRegister(0x09, 0x1f); //write 0xD7 to the Crystal Oscillator Load Capacitance register
/*enable receiver chain*/
SpiWriteRegister(0x07, 0x05); //write 0x05 to the Operating Function Control 1 register
//Enable two interrupts:
// a) one which shows that a valid packet received: 'ipkval'
// b) second shows if the packet received with incorrect CRC: 'icrcerror'
SpiWriteRegister(0x6D, 0x1F);
SpiWriteRegister(0x05, 0x03); //write 0x03 to the Interrupt Enable 1 register
SpiWriteRegister(0x06, 0x00); //write 0x00 to the Interrupt Enable 2 register
SpiWriteRegister(0x07, 0x01); 图纸:
用的是B版的4432,也用excel表格计算过,也是不行的。
接受发送函数用的苹果猫给的参考程序。void RF_R(unsigned char *d)
{
unsigned char index,yyy,ttt;
SpiWriteAddressData( OperatingFunctionControl2 , 0x02);
SpiWriteAddressData( OperatingFunctionControl2 , 0x00);
SpiWriteAddressData( OperatingFunctionControl1 , 0x05);
while(1)
{
yyy = SpiReadAddressData(InterruptStatus2);
yyy = SpiReadAddressData(InterruptStatus1);
LEDRX_ON;
WDR();
if(yyy&0x02) break;
}
LEDRX_OFF;
SpiWriteAddressData( OperatingFunctionControl1 , 0x01);
ttt = SpiReadAddressData(ReceivedPacketLength);
for(index=0;index<ttt;index++)
{
d=SpiReadAddressData(FIFOAccess);
}
SendUARTData(d,ttt);
}
void RF_T(unsigned char *d,unsigned char l)
{
unsigned char i;
SpiWriteAddressData( OperatingFunctionControl1 , 0x01);
SpiWriteAddressData( OperatingFunctionControl2 , 0x01);
SpiWriteAddressData( OperatingFunctionControl2 , 0x00);
SpiWriteAddressData( InterruptEnable1 , 0x00);
SpiWriteAddressData( InterruptEnable2 , 0x00);
SpiWriteAddressData( TransmitPacketLength , l);
for(i=0;i<l;i++)
{
SpiWriteAddressData( FIFOAccess , *d);
d++;
}
SpiWriteAddressData( OperatingFunctionControl1 , 0x09);
SpiWriteAddressData( InterruptEnable1 , 0x04);//使能发送有效包中断
while((SpiReadAddressData(InterruptStatus1)&0x04)==0)
{
LEDTX_ON;
WDR();
}
LEDTX_OFF;
} 只要能完成最起码的接收发送就行,没做过无线,调试起来真是一头雾水,求高手帮帮忙。
有人能帮帮我吗?越高越迷糊了 随着大家对SILABS的了解,和对SI4432的兴趣,特拿出一些开发时注意的地方告诉大家,以免大家在开发过程中在犯错。
一、在开发硬件时:
1、布线尽量均匀,按照50欧姆的要求去画,
2、记得过孔、铺地。
3、亏电电路尽量小,
二、软件调试:
1、按照原长的例程去修改,不要自己来设置寄存器,
2、原长会有寄存器设置工具
3、做简单的硬件测试和软件判断
4、确认需要修改的寄存器值是否是正确的,
三、注意问题:
1、晶体的精度可能导致你接收不到信号
2、发射和接收的频率是否一致
发射机是否正常
(1)看频谱
(2)设置中断
(3)测量电流是否是在正常工作的值
(4)采用内置PN9做信号源
接收机是否正常
(1)采用信号发生器
(2)设置中断
(3)测量电流
还有一些,后续加上。
有其他问题希望交流!!QQ:113714426
附加一些:
元器件放置以及布线注意事项:
芯片是4.0mm*4.0mm,20脚QFN封装,底部为地。必须通过一些过孔将芯片的地与pcb板的地很好的结合起来;
为了减少不必要的耦合,尽量避免一些较敏感的数字(和MCU相通信的网络),
射频走线平行,芯片底部不能走线。同样是为了尽量减少耦合,确保相同网络的走线线宽要相同,以及在空间允许的范围内敏感走线间距离至少为线宽的3倍;
在射频前端电路,相邻电感成相互垂直状放置,以较少耦合;
发射电路和接收电路中间留下足够大的地,避免相互间的耦合;
偏置电路中的扼流电感尽量靠近TX脚,减少发射对接收电路的影响;
射频电路中的元器件,尽量靠拢并使用较小封装的元器件,减少寄生电容的产生或影响;
在空间允许的情况下,尽量保持射频走线和地之间的距离,最好大于0.5mm;
射频电路中,元器件接地的脚周围放置尽量多的过孔来减少寄生电感及其影响;
电源滤波电路中的电路应该尽量靠近vdd脚,以确保滤波电容和VDD间的环路面积最小;(要强调一点,参考电路中的电源滤波电容一个都不能少,每个电容都有其作用。此前有过,因为少了某个电容致使模块工作不正常,死机的现象发生)
晶振尽量靠近芯片减少寄生电容的产生,寄生电容过多容易产生频率漂移,晶体下面不要走任何线,特别是电源线;
射频前段电路放置尽量大的地和足够多的过孔,射频走线下面(BOTTOM 面)尽量不要走线或走过长的线,这样可以避免信号通过它们辐射出去;
射频线宽尽量粗,pcb板近量薄。
si4432 由发送状态切换到接受状态需要一段时间,本人调试时最小到6ms,再小就只能发不能收了! 墨非 发表于 2012-4-18 09:46 static/image/common/back.gif
si4432 由发送状态切换到接受状态需要一段时间,本人调试时最小到6ms,再小就只能发不能收了! ...
感谢,我再试试,我现在怀疑还是我没有初始化好,找到好多V版的程序,貌似B版和V版好多区别,文档不看全了还真难搞。 MiniCat 发表于 2012-4-18 15:11 static/image/common/back.gif
感谢,我再试试,我现在怀疑还是我没有初始化好,找到好多V版的程序,貌似B版和V版好多区别,文档不看全 ...
你好!
迷你CAT,可不可以分享一下你调好的程序,我也是刚开始调si4432,能发,但收不到。很是折磨人啊!
我的邮箱:hwc0702@126.com
谢谢! {:smile:} 初始化 现在我也是只能发 不能收 求指导啊 caoyiping 发表于 2013-1-21 02:28 static/image/common/back.gif
初始化
您好 我是新注册所以不能加您好友 麻烦问下 我的扣扣号码是527540746 您能加我扣扣吗? 我有问题想向您咨询。谢谢。 MiniCat 发表于 2012-4-18 15:11 static/image/common/back.gif
感谢,我再试试,我现在怀疑还是我没有初始化好,找到好多V版的程序,貌似B版和V版好多区别,文档不看全 ...
您好 麻烦问下 您现在这个问题解决了吗? 我也遇到了这个问题 很折磨人!如果解决了 望您赐教 我的扣扣号码是527540746。我是新手加不了您好友。
页:
[1]