Rfm12b - IRQ always low
时间:04-06
整理:3721RD
点击:
Im working with RFM12B and MSP430. SPI - bit banging and module as transmitter. All i want to manage is to get nIRQ high after i read status command (0x0000) and as response 0x4000 -> Spi is workinG.
When i send the status command (0x0000) , the response is 0xA100 always and IRQ is low.
What am i doing wrong?
When i send the status command (0x0000) , the response is 0xA100 always and IRQ is low.
Code:
rf12_port_init(); rf12_wrt_cmd(0x0000); rf12_init(); rf12_reset_recv(); // reset fifo data=rf12_wrt_cmd(0x0000);
Code:
void rf12_port_init(void) {
_output(SEL);_output(SDI);_output(SCK);_input(SDO);
_input(IRQ);
_hi(SEL);_hi(SDI);_low(SCK);
}
void rf12_init() {
rf12_wrt_cmd(0x80E7); //868Mhz, 12pf, Enable TX reg, Enable RX FIFO buffrf12_wrt_cmd(0x8239);//!er,!ebb,ET,ES,EX,!eb,!ew,DCrf12_wrt_cmd(0xA640);//860.32rf12_wrt_cmd(0xC647);//4.8kbpsrf12_wrt_cmd(0x94A0);//VDI,FAST,134kHz,0dBm,-103dBmrf12_wrt_cmd(0xC2AC);//AL,!ml,DIG,DQD4rf12_wrt_cmd(0xCA81);//FIFO8,SYNC,!ff,DRrf12_wrt_cmd(0xCED4);//SYNC=2DD4;rf12_wrt_cmd(0xC483);//@PWR,NO RSTRIC,!st,!fi,OE,ENrf12_wrt_cmd(0x9850);//!mp,9810=30kHz,MAX OUTrf12_wrt_cmd(0xCC17);//OB1,OB0,!lpx,!ddy,DDIT,BW0rf12_wrt_cmd(0xE000);//NOT USErf12_wrt_cmd(0xC800);//NOT USErf12_wrt_cmd(0xC040);//1.66MHz,2.2V
}
uint16_t rf12_wrt_cmd(uint16_t cmd) {uint8_t i;uint16_t res=0;
_low(SCK);_low(SEL);for (i=0;i<16;i++) { if (cmd & 0x8000) _hi(SDI); else _low(SDI); _hi(SCK); res <<= 1; if (_is_hi(SDO)) res |= 0x0001; _low(SCK); cmd <<= 1;}_low(SCK);_hi(SEL);return (res);
}
void rf12_reset_recv(void) {rf12_wrt_cmd(0xCA81); // disable fiforf12_wrt_cmd(0xCA83); // enable fifo
}
IRQ is interupt request input. so you need to make it 1 in test bench.
Better post this question in digital section
I got two Rfm12b modules from some source. On sending Command 0x00 ,one responds with high nIRQ line and while nIRQ of other is always low with reply of 0xA100 same like OP. Is that Rfm12b(One with always low nIRQ) non functional?
Also has OP solved his/her problem?
Hi,
it was more than 1 year ago, hard to remember :) , I switched my application to use SPI (because of hardware support) and got it working. I was not able to find a cause with bit banging approach.
