找回密码
 注册
搜索
查看: 1621|回复: 19

[讨论] MTK25平台能否通过EMI接口进行HPI通信?

[复制链接]
发表于 2009-11-24 23:47:54 | 显示全部楼层 |阅读模式
大家好,我现在做一个方案,在MTK25平台上,想通过EMI接口地址线A1----A8,数据线D0-----D15,片选ECS2来外挂一芯片,
但不知道怎样配置才能使ECS2生效?还有,进行通信时的命令地址和数据地址分别是什么?欢迎各位大侠赐教,多谢!
发表于 2009-11-25 02:44:01 | 显示全部楼层
Yes you can.
但不知道怎样配置才能使ECS2生效:
You should know the beginning address of CS2, if you read or write the address range in CS2, the CS2 will be activated.

通信时的命令地址和数据地址分别是什么:
It depends on the command and data register address of the chip. You should read the datasheet of chip.

Also you should know something about HPI, it's very simple.
点评回复

使用道具 举报

 楼主| 发表于 2009-11-25 23:04:37 | 显示全部楼层
dyyjun您好!
我今天尝试往0x10000000中送数据,并测量了ECS2的电平,发现一直是高,应该没有被激活!

请问ECS2的起始地址是0x10000000吗?

还有,假如ECS2已经激活,外挂芯片的命令地址是0x20030000,数据地址是0x20030002,那么相应的
读写接口函数是直接往上述两个地址中赋值就可以吗?谢谢
点评回复

使用道具 举报

 楼主| 发表于 2009-11-25 23:08:01 | 显示全部楼层
还有,怎样才能保证在传输命令和数据过程中,ECS2一直处于激活状态中?谢谢
点评回复

使用道具 举报

发表于 2009-11-26 04:34:40 | 显示全部楼层
Q:我今天尝试往0x10000000中送数据,并测量了ECS2的电平,发现一直是高,应该没有被激活!

请问ECS2的起始地址是0x10000000吗?
A:Maybe I  can help you if I have the datasheet of MCU.

Q:还有,假如ECS2已经激活,外挂芯片的命令地址是0x20030000,数据地址是0x20030002,那么相应的
读写接口函数是直接往上述两个地址中赋值就可以吗?

A:I believe the address 0x20030000 and 0x20030002 should be wrong, the register address should be offset address.
In this case, if your base address of CS2 is 0x10000000, maybe your command address is 0x10030000 and data address is 0x10030002.

A:怎样才能保证在传输命令和数据过程中,ECS2一直处于激活状态中
Q:You don't need to worry about it, once you write or read the address in the range correctly, the CS will be activated,
Actually, the CS is encoded by high address line.

Anyway, you'd better  send me the datasheet of MCU and DSP to xuhuan@live.ca.
点评回复

使用道具 举报

发表于 2009-11-26 11:02:23 | 显示全部楼层
我刚刚看了一下MCU的datasheet,感觉基地址0x10000000没有问题,你最好和support作一下double check,你用的是D0-D15,所以你的EMI应该设成16位模式,为了保险起见,你的时序参数(hold time,setup time。。。)最好先设成最大值。然后你在测试一下,用死循环不断读写这个地址,同时用示波器量CS,应该会有波形的。
另外,如果你的register的offset是0x30000的话,你的地址线不够用呀 。还有,如果你的EMI在16为模式的时候,地址应该也是16位的吧,为什么要用A1-A8,我觉得应该用A0-A7吧,你最好搞清楚
点评回复

使用道具 举报

 楼主| 发表于 2009-11-26 12:44:35 | 显示全部楼层
因为外挂IC需要用HPI通信,该HPI为8为地址线,16位数据线。故硬件上连接了EMI的8为地址线。

另外,我测试时就是不断的往0x10000000中送数据,同时测量ECS2,ECS2一直是高电平。

还有,总线通信时怎么区分数据和命令,是根据不同地址吗?那我往0x10000000送的数据应该叫命令呢还是数据?谢谢
点评回复

使用道具 举报

发表于 2009-11-26 13:01:56 | 显示全部楼层
1.EMI的地址线是不是8位寻址的?也就是说不管你设成8位或16位,都是8位寻址?16位是不是只针对data?
2.0x10000000是几位的地址8,16,32?
通信就是根据不同的地址,你要确定你的DSP种不同寄存器的offset。

。。。。。。。。。。。。。
又review了一下你的datasheet,没错,所有的地址都是基于byte的,你的EMI也是8位寻址的

把你的测试程序贴出来吧,我看看
[此贴子已经被作者于2009-11-26 14:07:55编辑过]
点评回复

使用道具 举报

 楼主| 发表于 2009-11-26 14:50:20 | 显示全部楼层
我的测试程序如下:
void EMI_test(void)
{
kal_uint16 count = 0;
while(count < 1000)
{
  *(volatile unsigned int*)0x10000000 = 0x55 ;
  Delay_ms(5);
  *(volatile unsigned int*)0x10000000 = 0xaa ;
  Delay_ms(5);
  count ++;
}
}
而且这三种:
*(volatile unsigned char*)0x10000000 = data;
*(volatile unsigned short*)0x10000000 = data;
*(volatile unsigned int*)0x10000000 = data;
我都试过了,ECS2没反应,还是一直为高。
点评回复

使用道具 举报

发表于 2009-11-26 21:41:00 | 显示全部楼层
把你相关的EMI设置寄存器打印出来我看看,就是EMI Control Register for BANK 2 EMI_CONC,和EMI Control Register 0 for MobileRAM EMI_CONI。然后把你的接其他外设的片选的相应寄存器打印出来做对比,比如NOR或者SRAM。

另外,有没有cache?你测试点是直接从MCU出来的么?

程序最好改成
void EMI_test(void)
{
kal_uint16 count = 0;
while(1)
{
  *(volatile unsigned int*)0x10000000 = 0x55 ;

  *(volatile unsigned int*)0x10000000 = 0xaa ;

}
}
点评回复

使用道具 举报

 楼主| 发表于 2009-11-26 21:41:59 | 显示全部楼层
不知道发给您的邮件收到没?

如果0x10000000是数据地址的话,那命令地址是多少呢?
ECS2没反应会不会跟命令地址配置不正确有关呢?谢谢!
点评回复

使用道具 举报

 楼主| 发表于 2009-11-26 22:02:20 | 显示全部楼层
我的测试点是直接从MCU出来的

EMI_CONC和EMI_CONI我没有对其配置。明天我试试,

另外,我还有一点不明白,EMI的基地址是0x80010000,你是依据什么判断0x10000000是数据地址的呢?

谢谢!!!
点评回复

使用道具 举报

发表于 2009-11-27 04:25:19 | 显示全部楼层
8001_0000h is EMI control register base address, it is totally different from bank address. Now your first step is to active the CS, 0x10000000 is enough, CMD and DATA address depends on the DSP, right now you don't need to care about it.
点评回复

使用道具 举报

 楼主| 发表于 2009-11-27 09:46:48 | 显示全部楼层
按您说的改过之后再进行测试,果然有效果,cs终于变低了,只是不明白为什么延时有影响?

经过测试,我发现只有数据总线上有数据,地址总线一直没信号,请问命令地址依据什么原则获得的呢?

我该往哪个地址送命令呢?谢谢!(我又发了两封邮件,不知道您收到没?)
点评回复

使用道具 举报

发表于 2009-11-27 11:24:49 | 显示全部楼层
因为你访问的是基地址,偏移为0,所以地址线没信号,你不要测数据线,ARM7是冯诺依曼结构,数据线没有意义,上面有code也有data。
去掉延时只是为了方便测量,你可以算一下循环里面你的有效指令不会超过0.1%

该往那个地址送命令让我看一下DSP datasheet的HPI interface
点评回复

使用道具 举报

发表于 2009-11-28 23:03:20 | 显示全部楼层
很好共享!
点评回复

使用道具 举报

发表于 2009-12-3 04:37:51 | 显示全部楼层
Recently I am very busy, so I just reviewed the DSP datasheet you sent me. So far the EMI interface of  host MCU is working. The next step is to make the DSP work with host via HPI .
Refer to page 81 of DSP datasheet, the base address of HPI register for HOST is 0. Refer to the write procedure and read procedure in page 80, you can use host EMI to simulate the HPI to control the DSP as followers:
void DSP_write_test(u16  dsp_test_address,u16 dsp_test_data)
{
disable_int();//you should disable teh DSP interrupt

*(volatile unsigned short*)0x1000000c = 0x01|0x01<<4;

  *(volatile unsigned short*)0x10000004 = dsp_test_address&0xff00;
  *(volatile unsigned short*)0x10000006 = dsp_test_address&0x00ff;
*(volatile unsigned short*)0x10000100 =  dsp_test_data;
  *(volatile unsigned short*)0x10000000 = (dsp_test_data_size&0xfc)|0x02;
while(*(volatile unsigned short*)0x10000002 &0xfe!=1);
printk("write successfully\r\n");

}
u16 DSP_read_test(u16  dsp_test_address)
{
u16 temp;
disable_int();//you should disable teh DSP interrupt

*(volatile unsigned short*)0x1000000c = 0x01|0x01<<4;

  *(volatile unsigned short*)0x10000004 = dsp_test_address&0xff00;
  *(volatile unsigned short*)0x10000006 = dsp_test_address&0x00ff;
  *(volatile unsigned short*)0x10000000 = (dsp_test_data_size&0xfc)|0x01;
while(*(volatile unsigned short*)0x10000002 &0xfe!=1);
temp=*(volatile unsigned short*)0x10000100 ;
printk("read result:0x%04x\r\n",temp);
return temp;
}
Before do the upper test, pls make sure the host EMI timing match the DSP HPI timing.
Looking forward your feedback
点评回复

使用道具 举报

发表于 2009-12-3 04:51:25 | 显示全部楼层
Refer your bus interface description and datasheet of MCU, I am using the byte address. DSP datasheet is using the 16-bit address. Host EMI only supports byte address, but you shift the address line, so I believe this way should be working. Pls note.
点评回复

使用道具 举报

 楼主| 发表于 2009-12-11 00:14:18 | 显示全部楼层
dyyjun 您好!

请问0x1000000c,0x10000004, 0x10000006,0x10000100等等是怎么得来的???

第81页也只有0x00-----0xff,麻烦您能说得详细点吗?多谢!!!!
点评回复

使用道具 举报

发表于 2009-12-11 09:04:34 | 显示全部楼层
The bus base address is 0x10000000(refer to the datasheet of MCU), 0x00--0xff in DSP datasheet is offset address to base address and it is 16-bit width.
So the 0x10000004=0x10000000+0x02*2,
          0x10000006=0x10000000+0x03*2,
......

there is something wrong with the test program above:
dsp_test_address should be u32 and
*(volatile unsigned short*)0x10000004 = dsp_test_address&0xff00;
  *(volatile unsigned short*)0x10000006 = dsp_test_address&0x00ff;
should be
*(volatile unsigned short*)0x10000004 = dsp_test_address>>16;
  *(volatile unsigned short*)0x10000006 = dsp_test_address&0xffff;
Please attention!!!!
点评回复

使用道具 举报

高级模式
B Color Image Link Quote Code Smilies

本版积分规则

Archiver|手机版|小黑屋|52RD我爱研发网 ( 沪ICP备2022007804号-2 )

GMT+8, 2024-11-15 20:32 , Processed in 0.048085 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表