使用USART将avr atmega32连接到移位寄存器?
我想通过 TXD 引脚使用 USART 将 ATMEGA32 微控制器连接到移位寄存器,然后移位寄存器对接收到的数据执行串行到并行的转换。但如您所知,移位寄存器需要时钟,该时钟通过微控制器以波特率频率通过 XCK 引脚馈送(此处 USART 充当主同步时钟发生器)。 我的问题是我不知道如何从 XCK 中获取这些时钟信号,那么该怎么做呢???
谢谢
I want to connect ATMEGA32 microcontroller to a shift register using USART via TXD pin, the shift register then performs serial to parallel conversion on the received data. but as you know, the shift register needs clocking , this clocking is fed via the microcontroller at baud rate frequency via XCK pin (here the USART acts as master synchronous clock generator).
My problem is that i don't know how to get these clock signal out of XCK, so how to do that???
thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
RS-232 是自计时(固定波特率) - 它通常使用提供给 UART 的 x16 时钟,该 UART 与传入数据起始位边沿同步。与其使用裸露的移位寄存器,您可能最好使用简单的 UART 芯片作为串行到并行转换器 - 这会节省很多精力。
RS-232 is self-clocking (fix baud rate) - it typically uses x16 clock supplied to a UART which syncs to the incoming data start bit edge. Rather than use a bare shift register you would probably be better off just using a simple UART chip as your serial to parallel converter - it would save a lot of effort.
我认为使用 UART 作为移位寄存器不是一个好主意。最好使用 SPI 通信模式,因为它还提供移位寄存器所需的时钟。但如果你想使用 UART,那么你必须提供一个单独的时钟,与你为 UART 模式选择的波特率同步,我认为这会非常困难且不准确。
I don't think using the UART for the shift register would be a good idea. It would be better to use the SPI mode of communication as it also provide the clock you require for the shift register. But if you want to use UART then you would have to provide a separate clk in sync with the baud rate you've selected for the UART mode which I think would be very hard and inaccurate.