打印

求助,STM32F103VC PB7奇怪问题,不能设置为输出

[复制链接]
1422|1
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
cwei85|  楼主 | 2010-6-12 09:01 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本帖最后由 cwei85 于 2010-6-12 12:01 编辑

昨天调试的时候发现,在把PB7设置为推挽输出的时候,会影响PORTA的ADC采集,导致ADC引脚上始终为0V(本身应该有1.5V);将其改为浮空输入时,adc正常。

具体配置如下:
//ADC  channel0-7
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 |
           GPIO_Pin_4 | GPIO_Pin_5 | GPIO_Pin_6 |GPIO_Pin_7;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AIN;
  GPIO_Init(GPIOA, &GPIO_InitStructure);

GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_7 ;
  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
  GPIO_Init(GPIOB, &GPIO_InitStructure);
看来下PB7口可以配置为I2C的SDA,不晓得是不是这样原因导致起不能够配置为推挽输出?
沙发
cwei85|  楼主 | 2010-6-12 11:49 | 只看该作者
没有人遇到到这个问题?

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

1

主题

12

帖子

0

粉丝