STM32F10C8T6的iic是哪个
时间: 2024-02-29 09:54:06 浏览: 18
STM32F10C8T6的I2C总线是由两个外设I2C1和I2C2组成的。其中,I2C1可以使用GPIOB6和GPIOB7作为SCL和SDA引脚,I2C2可以使用GPIOB10和GPIOB11作为SCL和SDA引脚。
在使用I2C总线进行通信时,需要在代码中进行相应的配置,包括总线时钟的使能、SCL和SDA引脚的配置、I2C外设的初始化等。具体的配置方法可以参考STM32官方的相关文档和示例代码。
相关问题
stm32f103c8t6 iic
回答: 对于stm32f103c8t6 iic的问题,可以使用以下代码来初始化I2C和OLED显示屏:
在main.c文件中添加以下代码:
#include "stm32f10x.h"
#include "oled.h"
int main(void)
{
// 初始化I2C
oled_init();
// 在OLED上显示字符
oled_show_string(0, 0, "Hello World!", 16);
while(1)
{
// 主循环
}
}
在oled.h文件中添加以下代码:
#ifndef __OLED_H_
#define __OLED_H_
#include "main.h"
extern I2C_HandleTypeDef hi2c1;
void oled_full(uint8_t data);
void oled_init(void);
void oled_display_char(uint8_t x, uint8_t y, uint8_t chr, uint8_t Char_Size);
void oled_show_string(uint8_t x, uint8_t y, char ch[], uint8_t TextSize);
void oled_clear();
#endif
这样就可以使用stm32f103c8t6的I2C接口来控制OLED显示屏了。
stm32f10c8t6能不能识别1.8V的IIC
STM32F10C8T6的I2C接口是5V CMOS/TTL电平的,不能直接识别1.8V的I2C信号。如果要连接1.8V的I2C器件,需要通过电平转换器或者电平适配器将1.8V的信号转换为5V的信号,然后再接入STM32F10C8T6的I2C接口。另外,在使用电平转换器或电平适配器时,需要注意其转换速率是否符合应用需求。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)