2012-04-10 08:50 AM
Hi,
I am a university undergrad and I am designing a Digital storage oscilloscope. I need the micro controller's DAC output for DC voltage. I have seen the sample code and I know how to setup the timer, link the DMA to DAC. The code seems to be working fine on STM32VLdiscovery board, but when I run it on my STM32F103VET6 processor there is no output from DAC i.e. 0V. I would like to clarify:- I have made the board myself but I have made sure that all the connections are as per the datasheet.- I have given Vref+ as 3.3V , Vref- as GND as well. All the decaps are in place too.- All other peripheral are working fine, it is just the DAC which does not seem to be working.One problem could be with the DAC 12-bit right align config adddress i.e. &sharpdefine DAC_DHR12RD_Address 0x40007420.I reckon this should be different for STM32f103VExx than STM32f100RBxx. The code is exactly the same as ''DualModeDMA_SineWave''. Thankyou #dac-dma-tim22012-04-10 08:59 AM
Alright. I just saw clive1's solution in one of the previous discussions(
https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/cortex_mx_stm32/dac configuration&FolderCTID=0x01200200770978C69A1141439FE559EB459D7580009C4E14902C3CDE46A77F0FFD06506F5B¤tviews=517
). apparently there was a very easy solution which does not require any DMA or timers(I don't want them either). I tried that code and it seems to be working fine now. Kudos man.2012-04-10 09:15 AM
Are you sure it is EXACTLY the same?
The \STM32F10xFWLib\Examples\DAC\DualModeDMA_SineWave\main.c uses TIM8 not TIM2 The two DAC channels should come out of PA.4 and PA.5, and the addresses should be the same on all STM32F10X parts.2012-04-10 05:38 PM
No I am pretty sure it is TIM2, I just checked it. Thank you for you reply but anyway I am not changing the DAC output very frequently. So using DAC_SetChannelxData() works just fine, DMA is not necessary. And yeah I am aware of the DAC output pins.
-rajan