是否可以使用STM32F303片上I2C来连接STM32F3DISCOVERY板载陀螺仪(I3G4250D或L3GD20)?
STM32F3DISCOVERY 板具有 STM32F303VC 微控制器,该微控制器具有内置 SPI和 I2C 支持,以及同时支持 SPI 和 I2C 的陀螺仪。
根据董事会的用户手册< /a> 和 原理图,陀螺仪连接到微控制器的PA5/6 /7/PE3,(在“备用功能 5”下)连接到其 SPI1 总线(根据 STM32F303VC 数据表)。
这样就可以使用片上 SPI 支持来连接到该陀螺仪。
但通过保持 PE3 = CS_I2C/SPI 高电平,设备 (I3G4250D或 L3GD20)运行在 I2C 模式下,相同 PA5/7 引脚可用于 I2C SCL+SDA。
我的问题:是否可以使用STM32的片上I2C支持来驱动这些PA5/7引脚并通过I2C连接到该板载陀螺仪?
(我在微控制器的数据表或参考手册中找不到任何可以实现这一点的内容。因此唯一的替代方案似乎是使用 SPI,或者通过 PA5/7 上的“bitbanging”来执行 I2C。)
The STM32F3DISCOVERY board has an STM32F303VC microcontroller, which has built-in SPI and I2C support, and a gyroscope which supports both SPI and I2C.
Per the board's user manual and schematic, the gyroscope is connected to the microcontroller's PA5/6/7/PE3, which (under 'alternate function 5') are connected to its SPI1 bus (per the STM32F303VC datasheet).
So that makes it possible to use the on-chip SPI support to connect to this gyroscope.
But by keeping PE3 = CS_I2C/SPI high, the device (I3G4250D or L3GD20) runs in I2C mode, and the same PA5/7 pins can be used for I2C SCL+SDA.
My question: Is it possible to use the STM32's on-chip I2C support, to drive these PA5/7 pins and connect to this on-board gyroscope via I2C?
(I cannot find anything in the microcontroller's datasheet or reference manual, that would enable this. So the only alternatives seem to use SPI, or to do I2C by 'bitbanging' on PA5/7.)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
引脚 PA5 或 PA7 上没有 I2C。
将PA5和PA7置于高阻模式(输入或模拟模式),然后将其跳线分别连接到具有I2C功能且已安装上拉电阻的PB6和PB7。
There is no I2C on pins PA5 or PA7.
What you can do is put PA5 and PA7 into high impedance mode (input or analog mode) and then connect jumper wires from them to PB6 and PB7 respectively where the I2C function is available and pull-up resistors are already fitted.