标题: FU68XX有感无感电机控制芯片 各模块程序分享 [打印本页]

作者: dyhrdy    时间: 2020-11-10 09:50
标题: FU68XX有感无感电机控制芯片 各模块程序分享
FU68XX 模块程序  BLDC


单片机源程序如下:
  1. #include <FU68xx.h>
  2. #include <FU68xx_GPIO.h>
  3. #include <FU68xx_SYSTEM.h>
  4. #include <FU68xx_ADC.h>
  5. #include <ADCInit.h>

  6. /* Private typedef ------------------------------------------------------------------------------*/
  7. /* Private define -------------------------------------------------------------------------------*/
  8. /* Private macro --------------------------------------------------------------------------------*/
  9. /* Private variables ----------------------------------------------------------------------------*/

  10. /* Private function prototypes ------------------------------------------------------------------*/
  11. /* Private functions ----------------------------------------------------------------------------*/

  12. /*-------------------------------------------------------------------------------------------------
  13.         Function Name :        void main(void)
  14.         Description   :        主函数主要功能是初始化,包括系统初始化,硬件初始化,主循环扫描。
  15.         Input         :        无
  16.   Output                                :        无
  17. -------------------------------------------------------------------------------------------------*/
  18. void main(void)
  19. {
  20.         /*System Init*/
  21. //         SystemInit();
  22.   float i;
  23.         /*Timer初始化*/
  24. //        TIM0_Init();
  25.         
  26.         /*ADC初始化*/
  27.   ADC_Init();        

  28.         while(1)
  29.         {               
  30.                 /*ADC数据转换计算*/
  31.     //ADCGetConversionValue();
  32.      i=i+1;
  33.                  /*软件启动ADC采样转换*/
  34.                  if(i>100)
  35.                  {
  36.                         i=0;
  37.                  SetBit(ADC_STA, ADCBSY, 1);        
  38.      }                        
  39.            
  40.                   
  41.                          if(GetBit(ADC_STA, ADCIF))
  42.            {                                
  43.                
  44.                   /*获取ADC转换数据*/
  45.                   ADCData.VoltageBUS = ADC2_DR << 3;                                                                            // Q12-->Q15
  46.                   ADCData.VoltageSREF = ADC7_DR << 3;                                                                           // Q12-->Q15                        
  47.             
  48.                         ADCGetConversionValue();
  49.             CLR(ADC_STA, ADCIF);
  50.            }        
  51.         }               
  52. }
  53.         
复制代码

所有资料51hei提供下载:
样例程序.7z (4.2 MB, 下载次数: 156)

作者: 51hei团团    时间: 2020-11-10 14:32
能分享一下原理图吗?缺少原理图啊
作者: dyhrdy    时间: 2020-11-25 15:46
51hei团团 发表于 2020-11-10 14:32
能分享一下原理图吗?缺少原理图啊

http://www.51hei.com/bbs/dpj-198654-1.html
作者: cdiyy    时间: 2020-12-30 16:42
能分享一下原理图吗
作者: meng13    时间: 2021-5-20 16:20
有用峰岹调过电动工具的老哥么
作者: wqy589    时间: 2021-10-14 10:53
峰岹芯片,公开资料少,不好上手




欢迎光临 (http://www.51hei.com/bbs/) Powered by Discuz! X3.1