本帖最后由 yym86202 于 2020-11-4 08:57 编辑
求大神指点,最近翻译一段汇编程序,使用的c8051f505单片机,汇编定义MOV EMI0CF, #09H MOV EMI0TC, #045H通过中断能读取到数据
MOV DPTR,#02001H
MOVX A,@DPTR
JB B.0,A1D19
MOV RMSB,A
我翻译成c以后,EMI0CF = 0x09; //配置EMIF端口复用方式,带块选择的分片方式,<4k用内存,>4k用外存
EMI0TC = 0x45;
if(BB0)
{
RLSB=XBYTE[0x2001];
BB3=1;
}为什么就读取不到数据呢?这种复用地址数据地址线还涉及到时序还是怎么的?求指点,其中EMI0CF的第4、3位定义为10介绍如下:
EMIF Operating Mode Select Bits.
00: Internal Only: MOVX accesses on-chip XRAM only. All effective addresses alias to
on-chip memory space
01: Split Mode without Bank Select: Accesses below the 4 kB boundary are directed
on-chip. Accesses above the 4 kB boundary are directed off-chip. 8-bit off-chip MOVX
operations use current contents of the Address high port latches to resolve the upper
address byte. To access off chip space, EMI0CN must be set to a page that is not contained
in the on-chip address space.
10: Split Mode with Bank Select: Accesses below the 4 kB boundary are directed onchip.
Accesses above the 4 kB boundary are directed off-chip. 8-bit off-chip MOVX
operations uses the contents of EMI0CN to determine the high-byte of the address.
11: External Only: MOVX accesses off-chip XRAM only. On-chip XRAM is not visible to the CPU.附件是c8051f500手册
|