chico_pic
Joined: 21 Sep 2012 Posts: 10
|
save energy nRF24l01+ |
Posted: Tue Oct 25, 2016 1:06 am |
|
|
Hello to everybody
I want make a WSN using transponder nRF24l01+. & PIC16f1455.
So my WSN use nodes powered by battery and is important save energy,
I´ve edited the library created for Eduardo Guilherme Brandt, i just add this:
Code: | enum RF24_SETUP { //RF Setup Register
CONT_WAVE =0b10000000, //(0)Enables continuous carrier transmit when high(TX is always on transmitting sinc signal)
PLL_LOCK =0b00010000, //(0)Force PLL lock signal. Only used in test
RF_DR_250kbps=0b00100000, //(0)Select between the low speed data rates.
RF_DR_1Mbps =0b00000000, //(0)Select between the medium speed data rates.
RF_DR_2Mbps =0b00001000, //(1)(default_mode)Select between the high speed data rates. This bitis don't care if RF_DR_250kbps is set.
RF_PWR_n18dBm=0b00000000, //-18dBm. Set RF output power
RF_PWR_n12dBm=0b00000010, //-12dBm. Set RF output power
RF_PWR_n6dBm =0b00000100, //-6dBm. Set RF output power
RF_PWR_0dBm =0b00000110, //0dBm(default). Set RF output power
RF_LNA_EN =0b00000001 // HABILITA EL MODO DE AHORRO DE ENERGIA EN LA MODALIDAD DE TRANSMICION
}; |
RF_LNA_EN =0b00000001 // Enables energy saving mode in transmission mode.
The thing is save the most posible energy and I now can save 0.8mA.
I read other similar opinions on this forum, now i have a few questions:
For interrupt flag RX_DR:
Can i work over (POWER DOWN) and enable this interrupt?
For measure distance between nodes:
Can i use the bit CD (carrier detect) bit (RPD) ?
See datasheet rev 1 page 24 *6.4
https://www.sparkfun.com/datasheets/Components/SMD/nRF24L01Pluss_Preliminary_Product_Specification_v1_0.pdf
Or see datasheet rev 2 page 74 *appendix E
http://www.nordicsemi.com/eng/Products/2.4GHz-RF/nRF24L01
I add this function on file .h
Code: | enum RF24_CARRIER_DETECTE { // Registro de deteccion de CD (0X09)
INDIC_CD =0b00000001 // Banderilla de acuse de problemas en el canal
}; |
So now can someone give me a opinion?
I can't work with my own WSN because I not even receive my PCB from OSHPARK, and Proteus can't simulate this device.
Now someone have experience with WSN, that can give me a example code ? |
|