nRF905 Radio Library for AVR and Arduino | Zak’s Electronics Blog ~*

nRF905 Radio Library for AVR and Arduino | Zak’s Electronics Blog ~* Вертолеты

Callbacks

Since v3.0.0 this library uses callbacks which are ran when events occur. If the option to use interrupts is enabled then the callbacks will run from the interrupt routine so be sure that any global variables you use in them are declared ‘volatile’, just as you would when dealing with normal ISRs. These events will wake the microcontroller if it is sleeping.

Download

Arduino:[HERE] and [Documentation] (or use the Arduino library manager and search for “nrf905”)AVR (non-Arduino):[HERE] and [Documentation]

Some of the module pin names differ from the IC pin names in the datasheet:

The nRF905 is not 5V compatible, so some level conversions will need to be done with the Arduino outputs. A simple voltage divider or resistor and zener diode will do the trick. 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 band (remember to check which frequencies are legal in your country!), but each channel overlaps adjacent channels so there are only 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 get 2 for around £10.

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.

Смотрите про коптеры:  ArduPilot Mega sensor shield testing report II - Blogs - diydrones

Transmitted packet

The address is also used as the syncword and should have as many level shifts as possible. 10100110 01100101 00011010 11011010 (2791643866) would be a good address to use, but 00000000 00000000 00000000 0010000 (32) would not be.

The CRC is used to detect errors in the received data. Having a CRC doesn’t eliminate all bad packets, there is always a small chance of a bad packet 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-FALSE (0xFFFF) algorithm. I’m not sure what it uses for 8 bit CRCs.

Transmission timeThe sizes of the address, payload and CRC can be adjusted for a balance between throughput and latency.

Example configurations

Throughput is how much useful data can be sent (the payload part), assuming no delays for writing and reading the payload.Latency is how long it takes for the transmission to complete.Switching from standby mode to receive or transmit mode takes a maximum of 650us and switching between receive and transmit modes takes a maximum of 550us.

Transmission time can be worked out with:

t = tstartup tpreamble ((Naddress Npayload NCRC) / BR)

tstartup is the time to switch mode as stated above (650us / 550us).tpreamble is 200us for the 10 bit preamble.Naddress, Npayload and NCRC are the address, payload and CRC sizes in bits.BR is the bit rate which is 50,000.

For config 1, switching from standby to transmit:

t = 0.00065 0.0002 ((32 256 16) / 50000)t = 0.00693 seconds (6.93ms)

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!

Nrf905 – spi модуль трансивера 433 / 868 / 915 мгц

Модуль nRF905 обладает хорошей защитой от помех и способен работать в широком спектре ISM диапазонов передачи данных, использование которых возможно без дополнительного лицензирования.

В модуле использована частотная модуляция с минимальной девиацией частоты, а запатентованная технология ShockBurst повышает помехоустойчивость. Имеется возможность программной смены чувствительности приемника и мощности передатчика. Управление модулем выполняется по SPI. Микросхема nRF905 имеет встроенный стабилизатор напряжения питания.

nRF905 не совместим с 5В уровнями логики, поэтому подключение без преобразователя уровней может вывести модуль из строя.

Подключение модуля выполняется по следующей схеме:

  • VCC – питание
  • TXE – режим: 1 – передача, 0 – прием
  • CE – включение радиолога
  • PWR – управление энергопотреблением
  • CLK – выход тактового генератора
  • CD – обнаружение несущей
  • AM – совпадение адреса
  • DR – готовность обмена
  • GND – общая земля

Интерфейс SPI:

  • MISO – мастер вход, помощник выход
  • MOSI – мастер выход, помощник вход
  • SCK – такт
  • CSN – активность
Оцените статью
Радиокоптер.ру
Добавить комментарий