OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 4435|回复: 0

关于IO复用中IOMUX寄存器的bit4 SION位的作用

[复制链接]

7

主题

200

帖子

0

精华

金牌会员

Rank: 6Rank: 6

积分
1279
金钱
1279
注册时间
2017-7-18
在线时间
257 小时
发表于 2020-5-2 13:36:49 | 显示全部楼层 |阅读模式
学习IIC裸机实验时发现程序中配置SCL和SDA时,将其对应的IOMUX寄存器的BIT4 SION位设置为了1,这个位的具体含义视频中没有细讲。

这个位如果直接看寄存器中的描述,我是看的一头雾水,如下:
Software Input On Field.
Force the selected mux mode Input path no matter of MUX_MODE functionality.
1 ENABLED — Force input path of pad JTAG_TDI
0 DISABLED — Input Path is determined by functionality
强制设置输入,不管MUX_MODE 值。看不懂,然后就是找具体的解释,手册中的p1473
32.3.2SW Loopback through SION bit
A limited option exists to override the default pad functionality and force the input path
to be active (ipp_ibe==1'b1) regardless of the value driven by the corresponding module.
This can be done by setting the SION (Software Input On) bit in the
IOMUXC_SW_MUX_CTL register (when available) to "1".
Uses include:
• LoopBack - Module x drives the pad and also receives pad value as an input.
• GPIO Capture - Module x drives the pad and the value is captured by GPIO.
这里就很清楚了,就是设置了这个位之后无论这个IO是什么功能,都会有input的功能,可以进行io上值的查看。还列举了两个应用场景LoopBack和GPIO Capture。

我还找到了NXP论坛上有个关于这个SION位的说明,里面说的也很详细,如下:
Typically, an I/O pad is configured as either an Input or an Output pin but some pads are dynamically switched the functions in time such as the SD_CMD pad. This pad is used to send SD commands to the card and then immediately used to read the card's response back.

In this situation, it is better to have the IOMUX connects the pad to both command and response of the SD/MMC block then the software does not have to switch the MUX_MODE of that pad. In this case the SION bit field is set so the SD Commands can go out on the pad and the Responses from the card can be simultaneously read back.

Another use for this SION field is to set this bit to have a feedback on a GPIO pad. The software can read the state of the output pad to see whether there is an abnormal behavior on the pad. You can set this SION bit on any pad that has it to have a feedback of the pad independent of the MUX_MODE bits. The purpose of this bit is to force connection of the pad to the read the state of the pad.
说的就是有的IO是会同时作为输入或输出引脚使用,这里举例了SD_CMD引脚,上面说的SCL和SDA,这些引脚有时作为输出有时作为输入引脚,这时就需要设置这个SION位,
这样就不需要在软件中进行切换了。如果一个IO的状态有时候需要设置为输出,有时候需要设置为输入的话那么就需要设置这个SION位了。


正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2024-11-25 12:35

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

快速回复 返回顶部 返回列表