Dear Customer,
Please try with the following assembly code snippet
Code:
CODE
;start of code
.include "ATxmega64A1def.inc"
.equ RTC_BASE_ADDR = 0x0400
.equ RTC_TEMP_REG_OFFSET_ADDR = 0x04
.equ RTC_CNT_LOW_REG_OFFSET_ADDR = 0x08
.equ RTC_CNT_HIGH_REG_OFFSET_ADDR = 0x09
Start:
ldi r16,0x55
ldi r17,0xAA
;to write into 16 bit register
cli
sts RTC_BASE_ADDR +RTC_TEMP_REG_OFFSET_ADDR,r16
sts RTC_BASE_ADDR +RTC_CNT_HIGH_REG_OFFSET_ADDR,r17
sei
ldi r16,0x33
ldi r17,0x66
;to read from 16 bit register
cli
lds r16, RTC_BASE_ADDR +RTC_CNT_LOW_REG_OFFSET_ADDR
lds r17, RTC_BASE_ADDR +RTC_TEMP_REG_OFFSET_ADDR
sei
;end of code
Please refer "Section: 3.11: Accessing 16 bit Registers" (Page Number:12)
in the Xmega A manual.
Please refer "Section : Peripheral Module Address Map" (Page Number:58) to
get the peripheral base address (for example 0x0400 for RTC) of ATxmega64A1
device in the datasheet.
Please refer "Section 17.4 RTC : Register Summary" (Page Number : 196) to
get the RTC registers address (for example base address 0x0400 + offset
address 0x04 = 0x0404 for RTC TEMP register) in the Xmega A manual.
The XmegaA manual and ATxmega64A1 device datasheet is available at the
following path (under "datasheets" section)
http://www.atmel.com/dyn/products/product_...mp;part_id=4297The above address definitions have been included in "ATxmega64A1def.inc"
file also.For example RTC base address has been defined in the
"ATxmega64A1def.inc" file (as .equ RTC_base = 0x0400)under "ALL MODULE BASE
ADRESSES" section.
Hope this helps.Sorry for the inconvenience.
Best Regards,
Vijay Jayaraman K
Atmel Technical Support Team