2017-05-09 05:39 AM
How use the analog port with the stm32l0538 disco using the hal library
#analog2017-05-09 07:20 AM
Hello Luiz
Do you mean how to use the ADC peripheral or does your question concern the configuration of GPIOs in analog mode ?
Have you looked at the ADC examples for the STM32L053C8-Discovery board in your STM32Cube directory?
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2017-05-09 12:00 PM
Hi Romain
My question is the comfiguration of GPIO in analog mode, and i not found examples for this
you can help me ?
2017-05-09 12:23 PM
STM32Cube_FW_L0_V1.8.0\Projects\STM32L053C8-Discovery\Examples\ADC\ADC_DMA_Transfer\Src\main.c
STM32Cube_FW_L0_V1.8.0\Projects\STM32L053R8-Nucleo\Examples\ADC\ADC_RegularConversion_Interrupt\Src\main.c
Bunch of examples, for DISCO and NUCLEO boards, review them
2017-05-09 12:45 PM
Ok i saw the examples, but i not found the analog output example
2017-05-09 01:31 PM
Your question wasn't that specific, look at the DAC examples then
STM32Cube_FW_L0_V1.8.0\Projects\STM32L053C8-Discovery\Examples\DAC\DAC_SimpleConversion\Src\main.c
2017-05-09 02:20 PM
i know the dac, but i want control a RGB led in different values established from the software
ex.
Led Red 127
Led Green 55
Led Blue 255
And the stm32l0538 Disco has only one channel DAC
understood ?
2017-05-09 04:56 PM
May be it is poor choice of part for your application? Also the DAC doesn't drive the amount current you'd need for an LED.
Could you use a timer in PWM mode? Many of the TIM have 4 channels which can share a common period, with different pulse widths.
2017-05-10 03:30 AM
Hi Luiz
The DAC is not suitable for this type of application.
I advise you to use 3 channels of a GP TIMER in PWM output mode with the HAL Library (as Clive One explains there are a multitude of examples)
Alternatively you can watch and try the MBed class below. Your STM32L053-Discovery is compatible with MBed Online.
https://developer.mbed.org/users/4180_1/notebook/rgb-leds/
Best regards
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.
2017-05-10 07:41 AM
Really i had forgotten the PWM Thanks