将慢速设备连接到 MCF5270 微控制器
我正在寻找将慢速设备(ADC - ~1.2MHz)连接到我的 mcf5270 微控制器的方法,这是一个相当快的设备(~150MHz)。 我正在使用 ADC0817,并尝试了以下操作:GPIO 读取数据线、内存映射访问(因为 adc 与 uP 兼容)。
当映射为内存中的位置时,我使用最大等待状态(15ws,大约 107ns)。 mcf5270 在不使用其总线模型(ADC 不支持)的情况下不支持任何进一步的等待。
使用 GPIO,仅读取垃圾值。
注意:ADC 实际上正在工作,除了读取数据之外,其接口也正常工作。 我正在使用 C/C++ 和汇编。
简而言之,我正在寻找尝试从 ADC0817 读取数据的方法的建议。
非常感谢您的评论和回复。
I'm looking for ways to interface a slow device (an ADC - ~1.2MHz) to my mcf5270 microcontroller, which is a rather fast device (~150MHz). I am using ADC0817, and have tried the following: GPIO read off the data lines, memory mapped access (since the adc is uP compatible).
When mapped as a location in memory, I am using the maximum wait states (15ws, which is about 107ns). The mcf5270 does not support any further waiting without using their bus model (which the ADCs do not support).
Using GPIO, only junk values are read.
Note: The ADC is actually working, and other than reading data the interface to it is functional. I am using C/C++ and assembly.
In short, I am looking for suggestions for ways in which to try to read the data off the ADC0817.
Comments and responses are greatly appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您可以通过某些 GPIO 触发 ADC,执行适当数量的 NOP,然后读取值。 此外,您需要在执行此操作时禁用中断。
You could trigger the ADC through some GPIO, do an appropriate number of NOPs and then read the value. Also, you'd need to disable interrupts while doing this.
我认为内存映射应该可以工作 - 通常我会等待来自 ADC 的中断,然后读取指定地址处的字节。 由于您收到中断,因此不需要等待状态。 我错过了什么吗? GPIO 也应该可以工作。 您如何知道 ADC 正在工作? 你能在数据和数据上放置一个逻辑分析仪吗? 中断来证明 ADC 正在产生正确的输出?
I think memory mapped should work - normally I would wait for the interrupt from the ADC, then read the byte at the specified address. Since you get an interrupt, there is no wait state needed. Am I missing something? GPIO should also work. How do you know the ADC is working? Can you put a logic analyzer on the data & interrupt to prove the ADC is producing the correct output?
我认为从他的说法来看,MMIO 不会工作,因为他需要总线上超过最大数量的等待状态才能使胶合逻辑做出响应 - 即,A/D 不会足够快地设置其总线引脚uC要快乐。 有时这是一个问题。
但 GPIO 方法应该可行。 如果正在读取垃圾值,我认为您没有遵循提供的时序图。 在发出读取信号后,您必须等待一定的时间才能使数据有效。 查看数据表了解具体信息。
I think from what he's saying MMIO wont' work because he would need more than the maximum number of wait states on the bus to get the glue logic to respond - ie, the A/D won't set its bus pins soon enough for the uC to be happy. That's a problem sometimes.
But the GPIO approach should work. If junk values are being read I assume that you aren't following the timing diagram provided. You'll have to be able to wait certain amounts of time after you signal a read before the data is valid. Check out the datasheet for specifics.