你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。

st-img
chrome
st-img
firefox
st-img
safari
st-img
ie8及以上
shequ.stmicroelectronics.cn
  • ST意法半导体官网
  • STM32中文官网
  • ST全球论坛
登录/注册
  • 首页
  • 技术问答
  • 话题
  • 资源
  • 创客秀
  • 视频
  • 标签
  • 积分商城
  • 每日签到
回家库

回家库

 

回答数 0 关注数 0
关注 私信
  • 动态99
  • 提问
  • 回答0
  • 创客秀 0
  • 分享 0
  • 关注0
4 回答

请教大家关于STM32L151C8T6串口3只能收不能发问题.

STM32L1
小景在线 小景在线 回答时间: 2017-8-6 01:04

不知道楼之调试成功没有,下面是我自己的代码,调试是成功的,仅供参考! void MYUSART3_init(void) {     GPIO_InitTypeDef GPIO_InitStructure;   USART_InitTypeDef USART_InitStructure;   NVIC_InitTypeDef NVIC_InitStructure;   /* Enable GPIO clock */   RCC_AHBPeriphClockCmd(RCC_AHBPeriph_GPIOC, ENABLE);   //PC10-TX   C11-RX   /* Enable UART clock */   RCC_APB1PeriphClockCmd(RCC_APB1Periph_USART3, ENABLE);   /* Connect PXx to USARTx_Tx */   GPIO_PinAFConfig(GPIOC,GPIO_PinSource10,GPIO_AF_USART3);   /* Connect PXx to USARTx_Rx */   GPIO_PinAFConfig(GPIOC,GPIO_PinSource11,GPIO_AF_USART3);      /* Configure USART Tx as alternate function push-pull */   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_10;   GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_40MHz;   GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;   GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;   GPIO_Init(GPIOC, &GPIO_InitStructure);       /* Configure USART Rx as alternate function push-pull */   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_11;   GPIO_Init(GPIOC, &GPIO_InitStructure);      /* Enable the USARTx Interrupt */   NVIC_InitStructure.NVIC_IRQChannel = USART3_IRQn;   NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;   NVIC_InitStructure.NVIC_IRQChannelSubPriority = 2;   NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;   NVIC_Init(&NVIC_InitStructure);      USART_InitStructure.USART_BaudRate = 57600;   USART_InitStructure.USART_WordLength = USART_WordLength_8b;   USART_InitStructure.USART_StopBits = USART_StopBits_2;   USART_InitStructure.USART_Parity = USART_Parity_No;   USART_InitStructure.USART_HardwareFlowControl = USART_HardwareFlowControl_None;   USART_InitStructure.USART_Mode = USART_Mode_Rx | USART_Mode_Tx;   /* USART configuration */   USART_Init(USART3,&USART_InitStructure);      /* Enable USART */   USART_Cmd(USART3, ENABLE);       USART_ITConfig(USART3, USART_IT_RXNE, ENABLE);

赞0
回家库 回家库


阅读作者更多的帖子

所在话题

参与活动

  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    线下 2020-10-16
  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    网络 2020-10-16
  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    网络 2020-10-16
  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    网络 2020-10-16
  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    线下 2020-10-16
  • 滴滴押注社区团购,明确“投入不设上限,要做市场第一”

    线下 2020-10-16