Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

DAC interface clock cannot be enabled in stm32

Status
Not open for further replies.

mina_a

Newbie level 4
Newbie level 4
Joined
Aug 14, 2013
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Visit site
Activity points
39
Hi everyone.
I'm trying to test DAC in stm32f103rbt6. I've written a simple program that writes a 12-bit value in DAC_DHR12R1 register. I set the "DACEN" bit in the "RCC_APB1ENR" register to enable DAC interface clock, but when i debugged the program and saw the RCC registers, i found that DAC interface clock was not enabled.
I've tried to set other bits in "RCC_APB1ENR" register, like "TIM2EN" or "PWREN" bits, and all of them were set after debugging. I don't know what the problem is.
Do i need to set another bit before setting "DACEN" to enable DAC interface clock?
I've attached my code.
Thanks for your help.View attachment DAC.txt
 

Hello there,

Just check that GPIOA clock is enabled as done for DAC using
RCC_APB1PeriphClockCmd(RCC_APB1Periph_DAC, ENABLE);

Best regards,
 

Try resetting the module clock(DAC) and release that from reset before enabling the module clock

APB1 peripheral reset register (RCC_APB1RSTR)

just give a try..
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top