LCD配置:发送和传输时序
我正在用 VHDL 编程并尝试配置 LCD。我的问题与 LCD 接口时序和开机初始化所需的时间有关。
进行初始化时,有一些时序限制,例如用户指南中说:
- 等待 15 毫秒
- 写入 0x30 并等待 240 纳秒
- 等待 4.1 毫秒 等等
当我将 0x30 写入 LCD 时,我应该遵守 240ns + 接口时序时间吗? (用于设置、启用高、启用保持、启用低)。
如果我错了,请纠正我,但我认为当我初始化时,我不关心接口计时。当我发送命令(如功能设置、显示开/关等)时,我将负责界面计时。
谢谢。 !
I'm programming in VHDL and trying to configure an LCD. My questions are related to the LCD-interface-timing and the times required for Power-On-Initilization.
When doing the initialization, there are some timing restrictions for example in the user guide says something like:
- Wait 15ms
- Write 0x30 and wait 240ns
- Wait 4.1ms
and so on and so forth
When I write the 0x30 to the LCD should I respect the 240ns + the times on interface-timing? (those for setup, enable high, enable hold, enable low).
Correct me if I'm wrong, but what I think is when I'm at initialization I don't care about interface-timing. When I'm sending commands (like function set, display On/Off, so on) I will take care of interface-timing.
Thanks. !
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在向显示控制器写入任何内容时,您始终需要遵守接口时序,否则可能会发送无效数据。较长的超时通常是为了让显示控制器有时间运行各种软件例程,这可能会阻止它监视接口端口。
因此,是的,在将 0x30 写入作为初始化序列的一部分时,您需要尊重接口时序。
You always need to respect the interface timings when writing anything to the display controller or you could send invalid data. The longer timeouts are typically to give the display controller time to run various software routines which may prevent it from monitoring the interface port.
So, yes, you need to respect the interface timings when writing the 0x30 as part of the initialization sequence.
新答案:
遵循评论中提供的数据表
http://www.xilinx.com/support/documentation/boards_and_kits/ug334.pdf
值得注意的是,您的大多数评论都声称接口时间比设置时间长。这是倒退。设置时间比与 LCD 对话的时间长。
为了让这对我来说更容易,我将进行一个名为脉冲 LCD_E 的伪函数调用,您每次都可以在头脑中替换它。
标准写入命令的时序图要求您
初始化非常相似,尽管您有一个初始等待时间并且仅写入 4 位命令,并且中间等待时间较长。
执行此操作以进行初始化
如果您出于某种原因需要获得更快的写入时间,您可以在较长的等待期间设置下一个数据输入,并删除脉冲 LCD_E 中的初始等待
以捍卫我的旧答案。来自数据表~~
旧答案:
如果这是在 FPGA 上进行的,并且您有其他时序限制(例如等待时间),您可以考虑使用这个
http://en.wikipedia.org/wiki/PicoBlaze
它是 8 位微控制器的 VHDL 实现,对于设置、写入和从 LCD 读取信息非常有用。该芯片组非常简单且易于使用。另外,您还可以编写自己的外围设备:)
它是免费软件,我想您可以在这里下载全部内容。它带有自己的 IDE 和调试器。
http://www.picoblaze.info/tools.html
如果只是为了一个小项目,您可能只是想自己完成所有编码以防止延迟。但如果它在一个更大的项目中这是非常有用的并且值得学习。我认为它运行在最大 50 MHz 时钟上,因此如果您使用更快的时钟,您可能需要进行一些数字时钟管理。
New Answer:
Following the datasheet provided in comments
http://www.xilinx.com/support/documentation/boards_and_kits/ug334.pdf
Worth noting that most of your comments claim that the interface timing is longer then the setup timing. This is Backwards. It takes longer to set up than to talk with the LCD.
To make this easier for me I'm going to make a pseudo function call called pulse LCD_E that you can replace in your head each time.
The timing diagram for the standard write command asks you to
The initialization is VERY similar although you have an initial wait time and are only writing the 4 bit commands with longer waits in between.
Do this for initialization
If you need to eak out faster write times for some reason you can set the next data input during the longer waits and remove the initial wait in pulse LCD_E
In defense of my old answer. From the datasheet~~
Old answer:
If this is going on an FPGA and you have other timing constraints (like wait times) you might consider using this
http://en.wikipedia.org/wiki/PicoBlaze
It is a VHDL implementation of an 8 bit micro controller, very useful for setting up, writing, and reading information from an LCD. The chip set is very simple and easy to pick up. Plus you get to code your own peripherals :)
Its free software and I think you can download it all here. It comes with its own IDE, and debugger.
http://www.picoblaze.info/tools.html
If its just for a small project you might just want to do all the coding yourself for delays. But if its going in a larger project this is pretty useful and its worth learning. I think it runs on a 50 MHz clock max so you might need to do some digital clock management if you are using a faster clock.