905 Point of No Return Mega Upload
The nRF905 is a radio transceiver IC similar to the well known nRF24L01, only operates at 433/898/915MHz instead of 2.4GHz, has a much longer range and a few extra IO pins. However, the nRF905 data charge per unit is only 50Kbps compared to nRF24L01's 2Mbps.
This library offers quite a bit of flexibility: Optional utilize of interrupts, ii of the connections to the module are optional since their states can also exist accessed by the ICs status annals, and supports basic standoff avoidance.
Notation: v3.0.0 of the library was released on 12th September 2017, the default CD pin has changed and the AM pin is at present used past the library.
Download
Arduino: [HERE] and [Documentation] (or use the Arduino library director and search for "nrf905")
AVR (non-Arduino): [HERE] and [Documentation]
nRF905 | ATmega48/88/168/328 | Arduino Uno | Description |
---|---|---|---|
VCC | 3.3V | three.3V | Ability (iii.3V) |
CE | D7 (xiii) | 7 | Standby – High = TX/RX mode, Low = standby |
TXE | B1 (15) | 9 | TX or RX style – High = TX, Depression = RX |
PWR | B0 (14) | 8 | Power-up – High = on, Low = off |
CD | D4 (vi) | iv | Carrier discover – High when a signal is detected, for collision avoidance |
AM | D2 (4) | 2 | Address Match – High when receiving a packet that has the aforementioned address as the one ready for this device, optional since state is stored in annals, if interrupts are used (default) then this pin must exist connected. |
DR | D3 (five) | iii | Information Ready – Loftier when finished transmitting/High when new information received, optional since state is stored in register, if interrupts are used (default) and so this pin must be connected. |
Then | B4 (18) | 12 | SPI MISO (Mega pivot 50) |
SI | B3 (17) | 11 | SPI MOSI (Mega pivot 51) |
SCK | B5 (nineteen) | 13 | SPI SCK (Mega pin 52) |
CSN | B2 (16) | x | SPI SS |
GND | GND | GND | Ground |
Some of the module pin names differ from the IC pin names in the datasheet:
Module | IC |
---|---|
CE | TRX_EN |
TXE | TX_EN |
The nRF905 is non 5V compatible, so some level conversions will demand to exist done with the Arduino outputs. A simple voltage divider or resistor and zener diode volition practice the flim-flam. Only TXE, CE, PWR, SI, SCK and CSN pins need level conversion (not CD, AM, DR and So).
The nRF905 has 511 channels ranging 422.4MHz – 473.5MHz in 100KHz steps on the 433MHz band and 844.8MHz – 947MHz in 200KHz steps on the 868/915MHz ring (remember to bank check which frequencies are legal in your country!), but each channel overlaps adjacent channels and so in that location are merely a total of 170 usable channels at once.
Searching for nRF905, PTR8000 and PTR8000+ should yield some results for modules on AliExpress, Ebay and DealExtreme. You should be able to go 2 for effectually £x.
Callbacks
Since v3.0.0 this library uses callbacks which are ran when events occur. If the option to use interrupts is enabled and so the callbacks volition run from the interrupt routine and then be certain that whatever global variables you apply in them are declared 'volatile', just equally you would when dealing with normal ISRs. These events will wake the microcontroller if it is sleeping.
Event | Callback | Notes |
---|---|---|
New packet incoming | NRF905_CB_ADDRMATCH | |
Valid parcel received | NRF905_CB_RXCOMPLETE | |
Invalid packet received | NRF905_CB_RXINVALID | |
Packet manual complete | NRF905_CB_TXCOMPLETE | This merely works if the nextMode is NRF905_NEXTMODE_STANDBY when calling nRF905_TX() |
Nitty-gritty radio stuff
The actual air data-rate of nRF905 is 100Kbps, but the data is Manchester encoded which halves the throughput to 50Kbps. The modulation is GFSK with ±50KHz deviation. The radio also adds a few extra bits of data to the address and payload; a preamble and CRC.
Transmitted packet
Preamble x bits | Address 1 or 4 bytes | Payload 1 – 32 bytes | CRC 0 – 2 bytes |
The accost is also used as the syncword and should have as many level shifts as possible. 10100110 01100101 00011010 11011010 (2791643866) would be a practiced address to use, but 00000000 00000000 00000000 0010000 (32) would not be.
The CRC is used to detect errors in the received information. Having a CRC doesn't eliminate all bad packets, there is always a pocket-size chance of a bad parcel passing the CRC. Using larger CRCs helps to reduce that chance.
When the CRC is set to 16 bit the radio uses the CRC16-CCITT-Imitation (0xFFFF) algorithm. I'm not certain what it uses for 8 bit CRCs.
Transmission fourth dimension
The sizes of the address, payload and CRC can be adjusted for a residue between throughput and latency.
Example configurations
Address size | Payload size | CRC size | = | Throughput (bps) | Latency (ms) |
---|---|---|---|---|---|
four | 32 | 2 | = | 36940 | vi.93 |
i | 4 | i | = | 17680 | one.81 |
i | one | 0 | = | 6838 | one.17 |
Throughput is how much useful information can be sent (the payload role), assuming no delays for writing and reading the payload.
Latency is how long information technology takes for the transmission to complete.
Switching from standby mode to receive or transmit style takes a maximum of 650us and switching between receive and transmit modes takes a maximum of 550us.
Manual time tin can be worked out with:
tstartup is the time to switch mode as stated above (650us / 550us).
tpreamble is 200us for the 10 fleck preamble.
Naddress, Northwardpayload and NCRC are the accost, payload and CRC sizes in $.25.
BR is the bit rate which is l,000.
For config i, switching from standby to transmit:
A note to developers: Before v3.0.0 this library would load the address bytes in reverse order, keep that in mind if you're using an old version of the library to interface with other radio systems!
Source: https://blog.zakkemble.net/nrf905-avrarduino-librarydriver/
0 Response to "905 Point of No Return Mega Upload"
Post a Comment