(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


ƬCԴ:
  1. /*********************************************************************************************
  2. ģ  /
  3.         ADCxȡ
  4. ˣ                
  5. rg        201846
  6. Ӳ֧֣        STM32F103C8   ⲿ8MHz RCC(sh)O(sh)l72MHz  

  7. ޸־
  8. 1-        
  9.         
  10.                                                         
  11. f
  12. # ģdSTM32F103(ni)RCCrO(sh)ãõδ𶨕rӕr(sh)
  13. # ɸ(j)ԼҪӻhp

  14. *********************************************************************************************/
  15. #include "stm32f10x.h" //STM32^ļ
  16. #include "sys.h"
  17. #include "delay.h"
  18. #include "adc.h"
  19. #include "usart.h"

  20. extern vu16 ADC_DMA_IN5; //•ⲿ׃

  21. // ֲ׃ڱD(zhun)QӋ늉ֵ         
  22. float ADC_ConvertedValueLocal;        

  23. void  Delay (uint32_t nCount)
  24. {
  25.   for(; nCount != 0; nCount--);
  26. }

  27. int main (void){//
  28. //        delay_ms(500); //늕rȴ;w//
  29.         
  30.         RCC_Configuration(); //ϵy(tng)r犳ʼ
  31.         Delay(0x2fff);//_r犺ӕr
  32.             USART1_Init(57600); //ڳʼ(sh)Dzʣ
  33. USART1_printf ("\r\n ----ADCͨDMAxȡUSARTʼ ok----\r\n");
  34.         ADC_Configuration(); //ADCʼO(sh)
  35. USART1_printf ("\r\n ----ADCͨDMAxȡADCʼ  ok----\r\n");
  36.         while (1)
  37.         {
  38.                 USART1_printf("\r\n The current AD value = %04d \r\n", ADC_DMA_IN5);
  39.        ADC_ConvertedValueLocal=(float)ADC_DMA_IN5*(3.32/4096);
  40.                 USART1_printf("\r\n The current AD value = %f V \r\n",ADC_ConvertedValueLocal);
  41. //        Delay(0x2fff);
  42.                 delay_ms(10);
  43.         
  44. }
  45. }


  46. ׃x
  47. u32     a; //x32λo̖׃a
  48. u16     a; //x16λo̖׃a
  49. u8     a; //x8λo̖׃a
  50. vu32     a; //x׃32λo̖׃a
  51. vu16     a; //x׃ 16λo̖׃a
  52. vu8     a; //x׃ 8λo̖׃a
  53. uc32     a; //xֻx32λo̖׃a
  54. uc16     a; //xֻx 16λo̖׃a
  55. uc8     a; //xֻx 8λo̖׃a

  56. #define ONE  1   //궨x

  57. delay_us(1); //ӕr1΢
  58. delay_ms(1); //ӕr1
  59. delay_s(1); //ӕr1

  60. GPIO_WriteBit(LEDPORT,LED1,(BitAction)(1)); //LED

  61. */
(f)ƴa

Y51heiṩd:
6ADCͨDMAxȡ.7z (1.22 MB, dΔ(sh): 187)






gӭR (http://www.torrancerestoration.com/bbs/) Powered by Discuz! X3.1