STM32F100 STM32VLD TO FLASH BOARD DAC

Any other STM32 based boards
Post Reply
KHODIDAS11
Posts: 15
Joined: Sun Aug 20, 2017 4:35 pm

STM32F100 STM32VLD TO FLASH BOARD DAC

Post by KHODIDAS11 » Sat Jan 27, 2018 9:40 am

hi

I am using STM32F100 valueline discovery board. I have selected STM32VLD TO FLASH CORE in arduino.

As Stm32f100 has DAC output on PA4 annd PA5 PIns, How to write DAC program. I have done, adc, pwm, uart, digital read, digital write etcc..

fpiSTM
Posts: 316
Joined: Fri Sep 16, 2016 12:33 pm
Location: Le Mans, France

Re: STM32F100 STM32VLD TO FLASH BOARD DAC

Post by fpiSTM » Sat Jan 27, 2018 10:30 am

With the STM core, doing analogWrite() on the DAC pin will use the DAC instead of the PWM.

KHODIDAS11
Posts: 15
Joined: Sun Aug 20, 2017 4:35 pm

Re: STM32F100 STM32VLD TO FLASH BOARD DAC

Post by KHODIDAS11 » Tue Jan 30, 2018 5:27 am

Code: Select all

void setup() {
   Serial.begin(9600);
  // put your setup code here, to run once:
pinMode(PA4,PWM);

}

void loop() {
 
  // put your main code here, to run repeatedly:
int i;
for(i=0;i<=65535;i+=500)
{
  pwmWrite(PA4,i);
  Serial.write(i);
  delay(20);
}

}
i am trying this , here , istead of PWM i have used DAC, but it gives error in compliation

Post Reply