English
Language : 

ATMEGA128RFR2_14 Datasheet, PDF (159/611 Pages) ATMEL Corporation – Microcontroller with Low Power
ATmega256/128/64RFR2
length > 0) has been detected, but it is not checked if the received frame is valid (CRC
check). Timestamping must be enabled in the control register (Bit SCTSE of Register
SCCR0). A read access to SCTSRLL requires a maximum of three AVR clocks.
Reading the upper three bytes of the timestamp requires two CPU clock cycles for each
byte.
Note that there is no separate interrupt provided for timestamping. Instead the
TRX24_RX_START interrupt can be used (see "Interrupt Vectors in
ATmega256/128/64RFR2" on page 243).
10.6 Symbol Counter Beacon Timestamp Register (32 bit, SCBTSR)
If timestamping is enabled in the SCCR register, the beacon timestamp register is
updated with the SFD timestamp at the end of the received frame, if the received frame
was a beacon frame with valid FCS and:
• Source PAN identifier == {PAN_ID_1, PAN_ID_0}
or
• {PAN_ID_1, PAN_ID_0} == 0xFFFF
PAN_ID_0 and PAN_ID_1 are register of the radio transceiver, see "PAN_ID_0 –
Transceiver Personal Area Network ID Register (Low Byte)" on page 139.
Beacon timestamps can also be generated manually. Writing “1” to SCMBTS of
Register SCCR0 captures the current symbol counter value and stores it in the beacon
timestamp register. The bit is cleared automatically afterwards.
It is also possible to manually set the register in order to provide a distinct starting value
for the relative compare modes (see next section).
10.7 Compare Unit (3x 32 bit, SCOCR1, SCOCR2, SCOCR3)
The compare unit contains 3 independent 32 bit compare modules and is used to
compare the current counter value with the value stored in the compare register, and
optionally the beacon timestamp register. There are two possible modes available
which can be selected separately for all three compare modules:
1. Absolute Compare: In this mode the value stored in the compare register is
compared directly with the symbol counter value (SCCNT == SCOCRx). If the values
are equal an interrupt is generated.
2. Relative Compare: This mode allows the compare between the current symbol
counter value and the compare value plus the beacon timestamp value (SCCNT ==
SCBTSR + SCOCRx). This mode can be used to generate an interrupt at a time offset
relative to the value stored in the beacon timestamp register.
Note that a beacon timestamp is valid after a valid FCS. The relative compare must
exceed the beacon length, otherwise no relative compare interrupt will occur.
10.8 Interrupt Control Registers
The interrupt status and mask registers control the interrupt generation. Each interrupt
can be enabled in SCIRQM (Symbol Counter IRQ Mask Register). If an interrupt
occurs, the appropriate interrupt flag within the interrupt status register is set regardless
of the interrupt mask register setting. If the appropriate interrupt is enabled, an interrupt
is generated.
The interrupt flags can be cleared either by:
1. Entering the respective interrupt handler, or
2. Writing “one” to the according interrupt flag in the interrupt status register.
8393C-MCU Wireless-09/14
159