11.07.2015 Views

Clike here to get datasheet of CC1101 - Elechouse

Clike here to get datasheet of CC1101 - Elechouse

Clike here to get datasheet of CC1101 - Elechouse

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>CC1101</strong>The preamble pattern is an alternatingsequence <strong>of</strong> ones and zeros (10101010…).The minimum length <strong>of</strong> the preamble isprogrammable. When enabling TX, themodula<strong>to</strong>r will start transmitting the preamble.When the programmed number <strong>of</strong> preamblebytes has been transmitted, the modula<strong>to</strong>r willsend the sync word and then data from the TXFIFO if data is available. If the TX FIFO isempty, the modula<strong>to</strong>r will continue <strong>to</strong> sendpreamble bytes until the first byte is written <strong>to</strong>the TX FIFO. The modula<strong>to</strong>r will then send thesync word and then the data bytes. Thenumber <strong>of</strong> preamble bytes is programmed withthe MDMCFG1.NUM_PREAMBLE value.The synchronization word is a two-byte valueset in the SYNC1 and SYNC0 registers. Thesync word provides byte synchronization <strong>of</strong> theincoming packet. A one-byte synch word canbe emulated by setting the SYNC1 value <strong>to</strong> thepreamble pattern. It is also possible <strong>to</strong> emulatea 32 bit sync word by usingMDMCFG2.SYNC_MODE set <strong>to</strong> 3 or 7. The syncword will then be repeated twice.<strong>CC1101</strong> supports both constant packet lengthpro<strong>to</strong>cols and variable length pro<strong>to</strong>cols.Variable or fixed packet length mode can beused for packets up <strong>to</strong> 255 bytes. For longerpackets, infinite packet length mode must beused.Fixed packet length mode is selected bysetting PKTCTRL0.LENGTH_CONFIG=0. Thedesired packet length is set by the PKTLENregister.In variable packet length mode,PKTCTRL0.LENGTH_CONFIG=1, the packetlength is configured by the first byte after thesync word. The packet length is defined as thepayload data, excluding the length byte andthe optional CRC. The PKTLEN register isused <strong>to</strong> set the maximum packet lengthallowed in RX. Any packet received with alength byte with a value greater than PKTLENwill be discarded.With PKTCTRL0.LENGTH_CONFIG=2, thepacket length is set <strong>to</strong> infinite and transmissionand reception will continue until turned <strong>of</strong>fmanually. As described in the next section, thiscan be used <strong>to</strong> support packet formats withdifferent length configuration than nativelysupported by <strong>CC1101</strong>. One should make surethat TX mode is not turned <strong>of</strong>f during thetransmission <strong>of</strong> the first half <strong>of</strong> any byte. Refer<strong>to</strong> the <strong>CC1101</strong> Errata Notes [1] for more details.Note that the minimum packet lengthsupported (excluding the optional length byteand CRC) is one byte <strong>of</strong> payload data.15.2.1 Arbitrary Length Field ConfigurationThe packet length register, PKTLEN, can bereprogrammed during receive and transmit. Incombination with fixed packet length mode(PKTCTRL0.LENGTH_CONFIG=0) this opensthe possibility <strong>to</strong> have a different length fieldconfiguration than supported for variablelength packets (in variable packet length modethe length byte is the first byte after the syncword). At the start <strong>of</strong> reception, the packetlength is set <strong>to</strong> a large value. The MCU readsout enough bytes <strong>to</strong> interpret the length field inthe packet. Then the PKTLEN value is setaccording <strong>to</strong> this value. The end <strong>of</strong> packet willoccur when the byte counter in the packethandler is equal <strong>to</strong> the PKTLEN register. Thus,the MCU must be able <strong>to</strong> program the correctlength, before the internal counter reaches thepacket length.15.2.2 Packet Length > 255Also the packet au<strong>to</strong>mation control register,PKTCTRL0, can be reprogrammed during TXand RX. This opens the possibility <strong>to</strong> transmitand receive packets that are longer than 256bytes and still be able <strong>to</strong> use the packethandling hardware support. At the start <strong>of</strong> thepacket, the infinite packet length mode(PKTCTRL0.LENGTH_CONFIG=2) must beactive. On the TX side, the PKTLEN register isset <strong>to</strong> mod(length, 256). On the RX side theMCU reads out enough bytes <strong>to</strong> interpret thelength field in the packet and sets the PKTLENregister <strong>to</strong> mod(length, 256). When less than256 bytes remains <strong>of</strong> the packet the MCUdisables infinite packet length mode andactivates fixed packet length mode. When theinternal byte counter reaches the PKTLENvalue, the transmission or reception ends (theradio enters the state determined byTXOFF_MODE or RXOFF_MODE). Au<strong>to</strong>maticCRC appending/checking can also be used(by setting PKTCTRL0.CRC_EN=1).When for example a 600-byte packet is <strong>to</strong> betransmitted, the MCU should do the following(see also Figure 12)• Set PKTCTRL0.LENGTH_CONFIG=2.• Pre-program the PKTLEN register <strong>to</strong>mod(600, 256) = 88.SWRS061C Page 33 <strong>of</strong> 94

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!