Missing Special Function Registers - 0x9C and 0x9F in FX2LP TRM - KBA218336
- Subscribe to RSS Feed
- Mark as New
- Mark as Read
- Bookmark
- Subscribe
- Printer Friendly Page
- Report Inappropriate Content
Version: **
Translation - Japanese: FX2LP TRMの0x9Cおよび0x9Fの特殊機能レジスタがありません - KBA218336 - Community Translated (JA)
Question:
What are special function registers (SFRs) 0x9C and 0x9F that are not defined in the TRM?
Answer:
SFRs 0x9C and 0x9F are the same as data registers, XAUTODAT1 and XAUTODAT2, which are at external RAM locations 0xE67B and 0xE67C.
The declarations of XAUTODAT1 and XAUTODAT2 in firmware examples are as follows:
EXTERN xdata volatile BYTE XAUTODAT1 _AT_ 0xE67B;
EXTERN xdata volatile BYTE XAUTODAT2 _AT_ 0xE67C;
When using the auto pointers as XAUTODAT2 = XTAUTODAT1; the corresponding assembly instructions are:
MOV DPTR, #XAUTODAT1(0XE67B)
MOVX A,@DPTR
MOV DPTR, #XAUTODAT2(0XE67C)
MOVX A,@DPTR
However, the execution is faster when using SFRs 0x9C and 0x9F. To use these SFRs, add the following two definitions in the fx2regs.h, if not present:
sfr AUTOPTR_INTDATA1 = 0x9C;
sfr AUTOPTR_INTDATA2 = 0x9F;
When using the auto pointers as AUTOPTR_INTDATA2 = AUTOPTR_INTDATA1; the corresponding assembly instructions are:
MOV AUTOPTR_INT_DATA2, AUTOPTR_INT_DATA1 which is more efficient.
- Tags:
- ez-usb fx2lpa
-
This widget could not be displayed.Anonymous