Académique Documents
Professionnel Documents
Culture Documents
The pulse- width pw (0..999) can be set with the following command.
Test_dma_adc
• Configure ADC1 and ADC2 in simultaneous mode, Set
the DMA2 to transfer the ADC results to a mem. region
• Configure TIM2-> update at 50 KHz
• Configure the TIM2 output trigger so that it occurs on
update events:
TIM_SelectOutputTrigger(TIM2,TIM_TRGOSource_Update);
• Change the trigger in the ADC initialization code:
ADC_InitStructure.ADC_ExternalTrigConv=ADC_ExternalTrigConv_T2_TRGO;
• Configure the NVIC to enable interrupt channel
DMA_IRQn with the highest priority
• Write a suitable interrupt handler.
Test_dac
• Enable DAC_Channel_1
• Set TIM2 interrupt 150 KHz
• Configure the NVIC to enable interrupt
channel TIM2_IRQn with the highest priority
• Write a suitable interrupt handler.
Test_dac_speech
• Homework