STM32F429 GPIO DMA 读写
你好,
我正在做一个项目,我想对 JTAG 协议进行位操作。 根据ST提供的AN4666,DMA + GPIO可以在bit-banging同步协议中实现高速。
我想:
- 生成N 个 PWM 脉冲(CLK 信号)。
- 在每个脉冲的下降沿,我想用 DMA 设置一些 GPIO。
- 在上升沿,我想使用 DMA 从 GPIO 读取数据。
使用 HAL 实现这些规格的最佳方法是什么?
Hello,
I'm making a project where I want to bit-bang the JTAG protocol.
According to the AN4666 provided by ST, DMA + GPIO can achieve high speeds in bit-banging synchronous protocols.
I want to:
- Generate N PWM pulses (the CLK signal).
- With the falling edge of each pulses, I want to set some GPIO with DMA.
- With the rising edge, I want to read from the GPIO using DMA.
What is the best way to achieve these specs using HAL?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
即使没有 DMA,你也可以达到相当高的频率位冲击 I/O,我会说在 2 - 10MHz 范围内,假设 MCU 足够快,并且 GPIO 总线时钟足够高(48 96MHz)
时钟只是不太稳定,并且可能会遭受“停顿”,即当中断发生时与 DMA 的空闲时间。但对于 DMA 基础来说要简单得多
,如果您使用一个端口的 3 位,一位用于 clk,一位用于 TDI,一位用于 TDO,则使用 2 个 dma 一位用于 wr,另一位用于同一定时器源(如果可能)以双倍速率进行 rd TCK信号的
输入中的数据是通过读取 2 个以上数据中的第 i 位来重建的
索引如 0 2 4 或 1 3 5 ...取决于您想要的边缘以及您在 mem 中编写 clk 数组的编码方式。
最后,如果您的 jtag 链是 8 位多 SPI,则更加简单且 DMA 容易;)
even withtout dma you can reach quite high freq bit banged i/o i'll say in range 2 - 10MHz assuming fast enougth mcu and gpio bus clock high enough (48 96MHz)
Clock just wan't be as stable and may suffer "stall" say idle time when iterrupt occur vs dma. but is way simpler
for DMA base , if you use 3 bit of one port, one for clk and one for TDI and one for TDO then use 2 dma one to wr and one that rd on same timer source (if possible) at double rate of the TCK signal
the data in is rebuilt by taking teh i bit of one read data over 2
index like 0 2 4 or 1 3 5 ... depending on edge you want and how you wr clk array in mem is coded.
last if your jtag chain is 8 bit multiple SPI is even simpler and dma easy ;)