Indigresso Wiki

Open Source Stuff for DASH7

User Tools

Site Tools


opentag:radios:sx1212

SX1212 Radio

The primary advantage of SX1212 transceiver is receiver current consumption in the 3mA to 3.5mA range.

  • This radio transceiver supports 55,555bps rate of Dash7.
  • 200kbps is not possible with this die. Instead, this rate is supported by SX1231 and other more recent designs. Users who desire superior RF performance should consider SX1231 instead.
  • Tag on this platform should be able to sleep for wake signal at better than 10μA current, due to wake signal recognition capability in under 5ms. Tags should be able to wake every 2.2 seconds to acquire a 2.35-second wake transmitter.

SX1212 SPI interface

The SPI interface of SX1212 may be connected to a 4-wire SPI interface. (On the DK7A433, it is connected to the STM32L's SPI2)

  • SX1212 has the limitation on SPI interface of having separate chip-selects for FIFO access vs another for register access.
  • NSS_DATA is used for FIFO access, and NSS_CONFIG is used for register access.
  • Furthermore, SPI clock frequency is limited to maximum 1MHz during FIFO access vs. 6MHz allowable on register access.
  • Add to that: FIFO access are 8-bit operations, where register accessed using 16-bit operations.
  • Therefore, the function set_spi2_datasize() manages all of these restrictions.

SX1212 Interrupt Signal Configuration for Dash7 Mode 2

Buffered mode of FIFO operation is used by SX1212 radio driver. This allows an unlimited packet lengths (larger than the 64-octet FIFO size).

Signal Name CPU pin TX function RX function
RF IRQ0 PA1 EXTI1 unused (start condition) FifoNotEmpty
RF IRQ1 PA2 EXTI2 FifoFull or Tx_done FifoFull
Notes
  • STM32 DMA cannot be used with SX1212 FIFO because NSS_DATA must re-assert between every octet transfered to/from radio FIFO.
  • DMA to radio FIFO is possible with more recent designs (such as SX1231), due to burst mode SPI access feature of those devices.

Radio Reception interrupts

  • FifoNotEmpty indicates that a packet has just started to be received: SYNC has been detected and the first octet has been put into the FIFO by radio receiver.
  • EXTI1 interrupt service routine fires off on the rising edge of FifoNotEmpty from the radio, which triggers an SPI read from the FIFO.

Radio Transmission interrupts

Upon successful TX CSMA operation, the RF-IRQ1 in trasmission mode is configured for either FifoFull or Tx_done. If less than 64 bytes total is to be sent over the air, RF-IRQ1 is configured to Tx_done because we are not concerned with FifoFull because it will never become full if we have less than 64 bytes to send. However, if we have more than 64 bytes to send, FifoFull will be the setting. Then, after all the bytes have been transmitted, RF-IRQ1 will be configured to Tx_done to inform us that transmission is complete.

Alternative to Buffered mode

Alternative to buffered mode is to use continuous mode of radio with SPI1 of STM32L.

  • DMA would drive SPI1, and DCLK from radio would drive SPI1_SCK in slave mode.
  • This would offer advantage of lower interrupt rate in microcontroller during packet transmission/reception. However, in reception mode this requires single-bit (20µs) interrupt latency service of Sync from radio. This may not be practical due to wake-up time of STM32 from sleep/stop modes, when added to interrupt latency service time.
  • The choice of Buffered mode operation permits an interrupt service forgiveness time of 504 bits maximum, which at 55555bps is 9 milliseconds allowed interrupt service latency.

SX1212 RSSI measurements

RSSI measurements are used for TX CSMA, signal strength of received packet, and termination of background reception.

  • When in receive mode, SX1212 samples RSSI at a rate equal to 1/Fdev, which means 20μs in the case of 50KHz Dash7 deviation.
  • When measuring RSSI during TX CSMA operation, we will usually be measuring the ambient noise on the radio channel. The ambient noise results in RSSI values which vary several dB from sample to sample. This requires oversampling and division to reduce the noise to obtain accurate measurement of energy on the radio channel. Usually 8 or 16 samples of RSSI are sufficient for this purpose. Count of samples should chosen as powers of two, in order to use right shifting binary operation to obtain value efficiently.
  • When measuring RSSI during received packet, we also want to oversample because the received packet may be of weak signal strength. Yet even if strength is strong, we have the possibility of multipath fading causing uncertainty in signal strength, which oversampling can also alleviate.
  • RSSI is also measured at beginning of background reception, in which a weak energy reading will cause immediate termination of background reception. Oversampling might also be needed here to prevent false termination of weak background signal.
  • At Dash7 bandwidths, this receiver has an RSSI dynamic range of 60dB when using fixed I.F. gain.
  • I.F gain is fixed at max gain, which results in maximum RSSI measurement of -40dBm. If higher power levels must be measured, the I.F. gain could be dynamically reduced under strong signal condition. The receiver demodulator is not effected by the -40dBm limit of RSSI at maximum I.F gain.

CSMA RSSI measurement time

Attention is required on any TCA time assignments involving transmitting.

  • Due to any added RSSI oversampling/averaging during TX CSMA, the TCA settings should be adjusted accordingly to prevent the premature abortion of CSMA process.
  • RSSI can be measured as fast as possible over SPI, meaning rm2_txcsma() can return 0 during oversampling because receiver takes measurements at 20µs rate, which is faster than SPI can read it.
  • The dominant time for CSMA will be due to wake-up time due to prior SX1212 mode of sleep or standby. RSSI measurement will not occur until PLL is locked.
  • This radio needs typically 500µs for PLL to lock from standby, and an additional 1.5 milliseconds to wake from sleep mode.
  • Assuming radio was asleep upon calling rm2_txinit_ff(), CSMA TCA needs to lengthen if radio_sleep() puts radio in to sleep mode, compared to standby mode.
  • SX1212 sleep mode has considerably less current draw for low power applications: as low as 100nA, where standby is typically 65µA.

Sync word detection for Dash7 Mode2

Sync word byte-ordering is selected for CC430 compatability: LSbyte first. For example in the case of 0x0b67 sync word: 0x67 is sent first in time, then 0x0b. MSbit is sent first.

  • SX12xx doesn't feature any formal preamble qualification to aid valid sync word detection.
  • Meaning that sync word match occurs on random noise in the receiver. With a 16-bit sync word of Dash7, this results in unacceptably frequent false sync word detections, which result in receiver missing real messages.
  • This can be mostly mitigated by adding the last octet of preamble to the first octet of sync word, meaning a 24-bit sync word. This substantially reduces false sync word detection, mitigating the lack of formal preamble qualification feature.
  • This is particularly important when enabling FEC. Since FEC is of value when used under high BER condition, some bit errors will need to be allowed in sync word. This increases the probability of false sync word detection, which increases the chance of missing a real message.

SX1212 Transmit Bandwidth

Transmit bandwidth compliance is met by two main factors:

  • Modulation shaping (ie Gaussian)
  • RF power ramp-up / ramp-down slew rate limiting

SX12xx Mode 1 Capability

(first see mode 1 generic description)

  • Mode 1 physical layer cannot be handled by the packet engine of SX1212. Bit-synchronizer in SX1212 adds far too much jitter when configured to Mode1 data period.
  • This protocol is implemented using continuous mode of the radio, with bit synchronizer off.

Official Boards That Use SX1212

Board Name/Link STM32 Variant Radio Features
DK7A433 Semtech SX1212 DASH7 dev kit STM32L151CBT6 SX1212 16KB SRAM, 128KB Flash, integrated USB, 2 LED, integrated antenna
opentag/radios/sx1212.txt · Last modified: 2012/03/07 20:42 by dudmuck