首页 | 新闻 | 新品 | 文库 | 方案 | 视频 | 下载 | 商城 | 开发板 | 数据中心 | 座谈新版 | 培训 | 工具 | 博客 | 论坛 | 百科 | GEC | 活动 | 主题月 | 电子展
返回列表 回复 发帖

normal expanded mode求助

原文:

Interfacing to 8-bit Peripherals
The External Bus Interface is primarily designed to interface the MCU to 16-bit peripherals. However, with
certain limitations, it can also be used to interface to an 8-bit peripheral (for example, an LCD driver). In
this case, the HDBE bit in EBICTL0 register is cleared, only the lower half of the data bus is used, and the
LDS and UDS signals are not used by the external bus interface. Registers of the peripheral are then
visible on odd addresses only. The fact that the peripheral!ˉs registers are visible on every other address
in the memory space presents a problem only if the peripheral contains some sort of linear buffer. Such
a buffer would ideally be addressed by the application as a linear array of bytes. In this case two simple
workarounds exist:
?Make the array twice as big, and address only every other location in the array.
?Create the array as an array of words, rather than bytes, and ignore the upper byte of every word
in the array.
Both workarounds lead to a slight software overhead in the application, but this is relatively minor and can
usually be tolerated.

有些地方理解得不是很明白!请赐教!

我认为这篇文档指的是本来在16位数据的(宽扩展)模式下,对某些8位数据的外设进行控制。文档的名称是什么?可否上传?
海纳百川  有容乃大

www.freescale.com/files/microcontrollers/doc/app_note/AN2708.pdf

上面这个地址可以下载!

这段话的意思是说,如果将EBICLT0寄存器中的HDBE位清零,那么数据总线中只有低8位有效,同时/LDS和/UDS脚也不再作为扩展总线信号使用。这样,可以腾出很多脚做普通I/O口。但同时,由于ADDR0位与/UDS是共用的,这样ADDR0也没有输出了。此时一般会将ADDR1接道外设的ADDR0。这样,对于S12X来说,外设的寄存器就只能每间隔一个地址才有一个有效地址了。

海纳百川  有容乃大

多谢strongchen指点!

那是否意味着外扩8bit外设时必须将ADDR1接外设的ADDR0,访问地址时先将待访问地址左移一位,再将最低位置1(保证为奇地址),这样就能访问所有的空间了!

不知道这样理解是否正确?

strongchen大侠能否提供相关的例子!多谢了!

返回列表