找回密碼
 立即注冊

QQ登錄

只需一步,快速開始

搜索
查看: 7350|回復(fù): 9
收起左側(cè)

新唐單片機(jī)N76E003例程源碼下載

  [復(fù)制鏈接]
ID:386606 發(fā)表于 2018-8-15 16:34 | 顯示全部樓層 |閱讀模式
0.png 0.png

全部資料51hei下載地址:
Sample_Code.rar (10.72 MB, 下載次數(shù): 220)

部分源碼預(yù)覽:
  1. #if 0
  2. //#define Enable_ADC_AIN0                        ADCCON0&=0xF0;P17_Input_Mode;AINDIDS=0x00;AINDIDS|=SET_BIT0;ADCCON1|=SET_BIT0                                                                        //P17
  3. //#define Enable_ADC_AIN1                        ADCCON0&=0xF0;ADCCON0|=0x01;P30_Input_Mode;AINDIDS=0x00;AINDIDS|=SET_BIT1;ADCCON1|=SET_BIT0                //P30
  4. //#define Enable_ADC_AIN2                        ADCCON0&=0xF0;ADCCON0|=0x02;P07_Input_Mode;AINDIDS=0x00;AINDIDS|=SET_BIT2;ADCCON1|=SET_BIT0                //P07
  5. //#define Enable_ADC_AIN3                        ADCCON0&=0xF0;ADCCON0|=0x03;P06_Input_Mode;AINDIDS=0x00;AINDIDS|=SET_BIT3;ADCCON1|=SET_BIT0                //P06
  6. //#define Enable_ADC_AIN4                        ADCCON0&=0xF0;ADCCON0|=0x04;P05_Input_Mode;AINDIDS=0x00;AINDIDS|=SET_BIT4;ADCCON1|=SET_BIT0                //P05
  7. //#define Enable_ADC_AIN5                        ADCCON0&=0xF0;ADCCON0|=0x05;P04_Input_Mode;AINDIDS=0x00;AINDIDS|=SET_BIT5;ADCCON1|=SET_BIT0                //P04
  8. //#define Enable_ADC_AIN6                        ADCCON0&=0xF0;ADCCON0|=0x06;P03_Input_Mode;AINDIDS=0x00;AINDIDS|=SET_BIT6;ADCCON1|=SET_BIT0                //P03
  9. //#define Enable_ADC_AIN7                        ADCCON0&=0xF0;ADCCON0|=0x07;P11_Input_Mode;AINDIDS=0x00;AINDIDS|=SET_BIT7;ADCCON1|=SET_BIT0                //P11
  10. //#define Enable_ADC_BandGap        ADCCON0|=SET_BIT3;ADCCON0&=0xF8;                                                                                                                                                                                                                                                        //Band-gap 1.22V

  11. //#define PWM0_FALLINGEDGE_TRIG_ADC                ADCCON0&=~SET_BIT5;ADCCON0&=~SET_BIT4;ADCCON1&=~SET_BIT3;ADCCON1&=~SET_BIT2;ADCCON1|=SET_BIT1
  12. //#define PWM2_FALLINGEDGE_TRIG_ADC                ADCCON0&=~SET_BIT5;ADCCON0|=SET_BIT4;ADCCON1&=~SET_BIT3;ADCCON1&=~SET_BIT2;ADCCON1|=SET_BIT1
  13. //#define PWM4_FALLINGEDGE_TRIG_ADC                ADCCON0|=SET_BIT5;ADCCON0&=~SET_BIT4;ADCCON1&=~SET_BIT3;ADCCON1&=~SET_BIT2;ADCCON1|=SET_BIT1
  14. //#define PWM0_RISINGEDGE_TRIG_ADC                ADCCON0&=~SET_BIT5;ADCCON0&=~SET_BIT4;ADCCON1&=~SET_BIT3;ADCCON1|=SET_BIT2;ADCCON1|=SET_BIT1
  15. //#define PWM2_RISINGEDGE_TRIG_ADC                ADCCON0&=~SET_BIT5;ADCCON0|=SET_BIT4;ADCCON1&=~SET_BIT3;ADCCON1|=SET_BIT2;ADCCON1|=SET_BIT1
  16. //#define PWM4_RISINGEDGE_TRIG_ADC                ADCCON0|=SET_BIT5;ADCCON0&=~SET_BIT4;ADCCON1&=~SET_BIT3;ADCCON1|=SET_BIT2;ADCCON1|=SET_BIT1

  17. //#define P04_FALLINGEDGE_TRIG_ADC                ADCCON0|=0x30;ADCCON1&=0xF3;ADCCON1|=SET_BIT1;ADCCON1&=~SET_BIT6
  18. //#define P13_FALLINGEDGE_TRIG_ADC                ADCCON0|=0x30;ADCCON1&=0xF3;ADCCON1|=SET_BIT1;ADCCON1|=SET_BIT6
  19. //#define P04_RISINGEDGE_TRIG_ADC                        ADCCON0|=0x30;ADCCON1&=~SET_BIT3;ADCCON1|=SET_BIT2;ADCCON1|=SET_BIT1;ADCCON1&=~SET_BIT6
  20. //#define P13_RISINGEDGE_TRIG_ADC                        ADCCON0|=0x30;ADCCON1&=~SET_BIT3;ADCCON1|=SET_BIT2;ADCCON1|=SET_BIT1;ADCCON1|=SET_BIT6
  21. #endif

  22. /******************************************************************************
  23. The main C function.  Program execution starts
  24. here after stack initialization.
  25. ******************************************************************************/
  26. void main (void)
  27. {
  28.                 P12_Quasi_Mode;                                                                //For GPIO1 output, Find in "Function_define.h" - "GPIO INIT"
  29.                 InitialUART0_Timer1(115200);
  30.                 Enable_ADC_BandGap;                                                //Find in "Function_define.h" - "ADC INIT"

  31.                 while(1)
  32.     {
  33.                         clr_ADCF;
  34.                         set_ADCS;                                                                                                                                        // Each time ADC start trig signal
  35.       while(ADCF == 0);
  36.                         printf ("\n Value = 0x%bx",ADCRH);
  37.                         printf ("\n Value = 0x%bx",ADCRL);
  38.                         clr_GPIO1;
  39. //                        Timer0_Delay1ms(100);
  40.                         set_GPIO1;
  41.     }
  42. }


復(fù)制代碼


回復(fù)

使用道具 舉報

ID:396198 發(fā)表于 2018-9-10 20:13 | 顯示全部樓層
Thank you for your code
回復(fù)

使用道具 舉報

ID:400671 發(fā)表于 2018-9-27 15:35 | 顯示全部樓層
Thank you for your code
回復(fù)

使用道具 舉報

ID:76891 發(fā)表于 2019-5-20 15:18 | 顯示全部樓層
謝謝樓主,下載學(xué)習(xí)一下串口1 的配置
回復(fù)

使用道具 舉報

ID:46167 發(fā)表于 2019-7-2 22:33 | 顯示全部樓層
謝謝分享。。。
回復(fù)

使用道具 舉報

ID:348772 發(fā)表于 2019-7-30 11:19 | 顯示全部樓層
下載失敗怎么辦
回復(fù)

使用道具 舉報

ID:254268 發(fā)表于 2019-8-7 11:22 | 顯示全部樓層
謝謝樓主
回復(fù)

使用道具 舉報

ID:24486 發(fā)表于 2019-10-18 08:52 | 顯示全部樓層
謝謝樓主,謝謝分享。
回復(fù)

使用道具 舉報

ID:432799 發(fā)表于 2020-11-7 14:58 | 顯示全部樓層
TKS!!!!
回復(fù)

使用道具 舉報

ID:584808 發(fā)表于 2021-2-5 09:36 | 顯示全部樓層
thank you for your code
回復(fù)

使用道具 舉報

您需要登錄后才可以回帖 登錄 | 立即注冊

本版積分規(guī)則

手機(jī)版|小黑屋|51黑電子論壇 |51黑電子論壇6群 QQ 管理員QQ:125739409;技術(shù)交流QQ群281945664

Powered by 單片機(jī)教程網(wǎng)

快速回復(fù) 返回頂部 返回列表