打印

AD7689数据采集

[复制链接]
3028|2
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
bixiaochangbo|  楼主 | 2019-6-13 11:00 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
沙发
z309255843| | 2021-10-6 16:19 | 只看该作者
可以参考下代码吗,我用的模拟SPI,每次读出的值是0或者65535,不知道哪里的问题

使用特权

评论回复
板凳
bixiaochangbo|  楼主 | 2022-1-24 23:23 | 只看该作者
本帖最后由 bixiaochangbo 于 2022-1-24 23:29 编辑
z309255843 发表于 2021-10-6 16:19
可以参考下代码吗,我用的模拟SPI,每次读出的值是0或者65535,不知道哪里的问题 ...

https://bbs.21ic.com/icview-3013822-1-1.html

void GPIOAD_Configuration(void)
{
  GPIO_InitTypeDef GPIO_InitStructure;

  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOA,ENABLE);
  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_7|GPIO_Pin_5|GPIO_Pin_4;        
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
  GPIO_InitStructure.GPIO_OType=GPIO_OType_PP;
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
  GPIO_Init(GPIOA, &GPIO_InitStructure);        

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_6;//PA6
  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN;
  GPIO_InitStructure.GPIO_Speed=GPIO_Speed_50MHz;
  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;
  GPIO_Init(GPIOA, &GPIO_InitStructure);

  GPIO_SetBits(GPIOA,GPIO_Pin_5|GPIO_Pin_4|GPIO_Pin_7);        
  GPIO_Init(GPIOA, &GPIO_InitStructure);
}
在407我也遇到相同情况。GPIO之前配置的不合理。





使用特权

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

本版积分规则

8

主题

23

帖子

0

粉丝