×¢²á µÇ¼
µç×Ó¹¤³ÌÊÀ½ç-ÂÛ̳ ·µ»ØÊ×Ò³ EEWORLDÊ×Ò³ ƵµÀ EE´óѧÌà ÏÂÔØÖÐÐÄ Datasheet רÌâ
damiaaµÄ¸öÈË¿Õ¼ä https://home.eeworld.com.cn/space-uid-59433.html [ÊÕ²Ø] [¸´ÖÆ] [·ÖÏí] [RSS]
ÈÕÖ¾

¡¾NUCLEO H533RE¡¿Ö®ËÄ DAC¹¦ÄܲâÊÔ

ÒÑÓÐ 294 ´ÎÔĶÁ2024-7-20 17:34 |¸öÈË·ÖÀà:STM32

                        ¡¾NUCLEO H533RE¡¿Ö®ËÄ DAC¹¦ÄܲâÊÔ
 
 
½ÓÉÏÃæµÄ²âÊÔ³ÌÐò¼ÌÐø¼Ó¹¦ÄÜ£¬ÎÒÕâÀïÊǶ¨Ê±Æ÷ÀïÃæÊä³öDACÊý¾Ý¡£²»ÓÿªÆôÖжϡ£Ö»Òª²Ù×÷ÏÂÃæµÄ¼¸µã¾ÍOK¡£
´ÓÊÖ²áºÍ˵stm32cubeideÌáʾ¿´·¢ÏÖpa4 pa5ÊÇDACÊä³öµÄͨµÀ1ºÍͨµÀ2£¬µ«Ô­ÀíͼµÄPA4û½Ó³öÀ´£¬Òª½Ó³öÀ´±ØÐ붯ÀÓÌú£¬PA5½Óµ½ledÁË¡£
ÄǾÍÓÃPA5×öʵÑé°É¡£
 
ÅäÖãº
 
¶¨Ê±Æ÷ÖмÓÈëDACµÄ²Ù×÷¼ÓÈë´úÂ룺

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)
{
	if(htim == &htim3)
	{
		static int delay_led=0;
		delay_led++;
		if(delay_led ==2000)
		{
			//LD2_Write(1);
		}
		if(delay_led ==4000)
		{
			delay_led=0;
			//LD2_Write(0);
		}
		adc1_tim++;
		if(adc1_tim >10000) adc1_tim =0;
		static int dac_tim=0;

		dac_tim +=1;
		HAL_DAC_Start(&hdac1,DAC_CHANNEL_2);
		HAL_DAC_SetValue(&hdac1,DAC_CHANNEL_2,DAC_ALIGN_12B_R,dac_tim);
		if(dac_tim >= 4096) dac_tim=0;
	}
}

 

±àÒëÔËÐУ¬ÕâÑùledµÄµÆ¾ÍÖð½¥±äÁ¿£¬È»ºóϨÃð£¬Ò»Ö±Õâôѭ»·¡£Èç¹ûÓÃÍòÓñíÒ²¿ÉÒÔ¿´µ½PA5µçѹµÄ±ä»¯¡£
8

 
                                                                           лл

±¾ÎÄÀ´×ÔÂÛ̳£¬µã»÷²é¿´ÍêÕûÌû×ÓÄÚÈÝ¡£

ÆÀÂÛ (0 ¸öÆÀÂÛ)

facelist doodle Í¿Ñ»°å

ÄúÐèÒªµÇ¼ºó²Å¿ÉÒÔÆÀÂÛ µÇ¼ | ×¢²á

ÈÈÃÅÎÄÕÂ