HOW to output Vrefint to PB0 or PB1 from stm32l100
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-10-31 8:07 PM
I wanted to output Vrefint to PB1 from stm32l100 in one of my project. I followed the procedure in RM0038 Reference manual Page 201
- Set the VREFOUTEN bit in COMP_CSR.
- Close the analog switch of I/Os in group 3 by setting CH8 or CH9 in RIASCR1.
So I did the configuration in my applicaiton as following
void VrefOutEnable(void)
{
GPIO_InitTypeDef GPIO_InitStruct;
__HAL_RCC_GPIOB_CLK_ENABLE();
GPIO_InitStruct.Pin = GPIO_PIN_0|GPIO_PIN_1;
GPIO_InitStruct.Mode = GPIO_MODE_ANALOG;
GPIO_InitStruct.Pull = GPIO_NOPULL;
HAL_GPIO_Init(GPIOB, &GPIO_InitStruct);
__HAL_RCC_COMP_CLK_ENABLE();
__HAL_SYSCFG_VREFINT_OUT_ENABLE();
// __HAL_RI_SWITCHCONTROLMODE_ENABLE();
// __HAL_RI_SWITCHCONTROLMODE_DISABLE();
__HAL_RI_IOSWITCH_CLOSE(RI_ASCR1_CH_8|RI_ASCR1_CH_9);
}
But I couldn't get the result .
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
2018-10-31 10:14 PM
__HAL_RI_IOSWITCH_CLOSE(RI_IOSWITCH_CH9);
