(bio)}:
STM32 ADCͨDMAxProteus ̖+SCݔADɼ
[ӡ]
:
liuchsxian
rg:
2020-11-21 11:08
(bio)}:
STM32 ADCͨDMAxProteus ̖+SCݔADɼ
x߶,ĴaL(fng)ܲe,ע
ADCͨDMAx+proteus8.7+stm32F103C6,ɷ̖̖+SCݔADɼ
ԭD£proteus湤ļɵd
51hei.png
(42.9 KB, dΔ(sh): 47)
d
2020-11-21 16:03 ς
51hei.png
(13.81 KB, dΔ(sh): 58)
d
2020-11-21 16:03 ς
ƬCԴ:
/*********************************************************************************************
ģ /
ADCxȡ
ˣ
rg 201846
Ӳ֧֣ STM32F103C8 ⲿ8MHz RCC(sh)O(sh)l72MHz
־
1-
f
# ģdSTM32F103(ni)RCCrO(sh)ãõδrӕr(sh)
# ɸ(j)ԼҪӻhp
*********************************************************************************************/
#include "stm32f10x.h" //STM32^ļ
#include "sys.h"
#include "delay.h"
#include "adc.h"
#include "usart.h"
extern vu16 ADC_DMA_IN5; //ⲿ׃
// ֲ׃ڱD(zhun)QӋ늉ֵ
float ADC_ConvertedValueLocal;
void Delay (uint32_t nCount)
{
for(; nCount != 0; nCount--);
}
int main (void){//
// delay_ms(500); //늕rȴ;w//
RCC_Configuration(); //ϵy(tng)r犳ʼ
Delay(0x2fff);//_r犺ӕr
USART1_Init(57600); //ڳʼ(sh)Dzʣ
USART1_printf ("\r\n ----ADCͨDMAxȡUSARTʼ ok----\r\n");
ADC_Configuration(); //ADCʼO(sh)
USART1_printf ("\r\n ----ADCͨDMAxȡADCʼ ok----\r\n");
while (1)
{
USART1_printf("\r\n The current AD value = %04d \r\n", ADC_DMA_IN5);
ADC_ConvertedValueLocal=(float)ADC_DMA_IN5*(3.32/4096);
USART1_printf("\r\n The current AD value = %f V \r\n",ADC_ConvertedValueLocal);
// Delay(0x2fff);
delay_ms(10);
}
}
׃x
u32 a; //x32λo̖׃a
u16 a; //x16λo̖׃a
u8 a; //x8λo̖׃a
vu32 a; //x׃32λo̖׃a
vu16 a; //x׃ 16λo̖׃a
vu8 a; //x׃ 8λo̖׃a
uc32 a; //xֻx32λo̖׃a
uc16 a; //xֻx 16λo̖׃a
uc8 a; //xֻx 8λo̖׃a
#define ONE 1 //궨x
delay_us(1); //ӕr1
delay_ms(1); //ӕr1
delay_s(1); //ӕr1
GPIO_WriteBit(LEDPORT,LED1,(BitAction)(1)); //LED
*/
(f)ƴa
Y51heiṩd:
6ADCͨDMAxȡ.7z
(1.22 MB, dΔ(sh): 187)
2020-11-21 11:07 ς
cļd
de: ڎ -5
gӭR (http://www.torrancerestoration.com/bbs/)
Powered by Discuz! X3.1