English
Language : 

MRF24J40_08 Datasheet, PDF (128/152 Pages) Microchip Technology – IEEE 802.15.4™ 2.4 GHz RF Transceiver
MRF24J40
3.17.3 UPPER LAYER ENCRYPTION
To encrypt an upper layer frame, perform the following
steps:
1. The host microcontroller loads the TXNFIFO
with the upper layer frame for encryption into the
TXNFIFO using the format shown in
Figure 3-23. The header length field indicates
the number of octets (bytes) that is not
encrypted.
Note:
The header length field, as implemented in
the MRF24J40, is 5 bits long. Therefore,
the header length maximum value is
31 octets (bytes). This conforms to the
IEEE 802.15.4-2003 Specification. How-
ever, it does not conform to the
IEEE 802.15.4-2006 Standard. The work
around is to:
- Use a header length no longer than
31 octets (bytes)
- Implement a security algorithm in the
upper layers
FIGURE 3-23:
UPPER LAYER ENCRYPTION AND DECRYPTION FORMAT
TX FIFO
1
1
Header Frame
Length Length
(m) (m + n)
m
HHeeaaddeerr
n
Data Payload
octets
Upper Layer
Encryption
m
Upper Layer
Security Header
n
Upper Layer
Encrypted Payload
octets
2. The host microcontroller loads the 13-byte
NONCE value into the UPNONCE12 through
UPNONCE0 (0x240 through 0x24C) registers.
3. Program the 128-bit security key into the TX
Normal FIFO Security Key FIFO memory
address, 0x280 through 0x28F.
4. Select the security suite and program the
TXNCIPHER (SECCON0 0x2C<2:0>) bits. The
security suite selection values are shown in
Table 3-24.
5. Enable Upper Layer Security Encryption mode by
setting the UPENC (SECCR2 0x37<6>) bit = 1.
6. Encrypt the frame by setting the TXNTRIG
(TXNCON 0x1B<0>) bit to 1.
7. A TXNIF (INTSTAT 0x31<0>) interrupt will be
issued. The TXNSTAT (TXSTAT 0x24<0>) bit = 0
indicates the encryption has completed.
8. The encrypted frame is available in the
TXNFIFO and can be read by the host
microcontroller.
Application Hint: The encryption can be
checked by decrypting the frame data (see next
section) and comparing it to the original frame
data.
DS39776B-page 126
Preliminary
© 2008 Microchip Technology Inc.