<meter id="pryje"><nav id="pryje"><delect id="pryje"></delect></nav></meter>
          <label id="pryje"></label>

          新聞中心

          EEPW首頁 > 嵌入式系統(tǒng) > 設(shè)計(jì)應(yīng)用 > 基于單片機(jī)的紅外發(fā)送程序(Infineon--XC866)

          基于單片機(jī)的紅外發(fā)送程序(Infineon--XC866)

          作者: 時(shí)間:2016-11-29 來源:網(wǎng)絡(luò) 收藏
          本程序適用于Infineon--XC866的單片機(jī),載波為38KHZ,通過P3_0作為發(fā)送端口,其中:0由0.56m的高電平和0.56ms的低電平組成,1由0.56的高電平和1.68ms的電平組成。稍加修改可應(yīng)用于C51。

          發(fā)送程序如下:

          本文引用地址:http://www.ex-cimer.com/article/201611/323245.htm
          //****************************************************************************// @Module        Project Settings// @Filename      MAIN.C// @Project       20W.dav//----------------------------------------------------------------------------// @Controller    Infineon XC866-2FR//// @Compiler      Keil//// @Codegenerator 2.0//// @Description   This file contains the Project initialization function.////----------------------------------------------------------------------------// @Date          2010-11-4 15:54:56////****************************************************************************// USER CODE BEGIN (MAIN_General,1)// USER CODE END//****************************************************************************// @Project Includes// 完整代碼下載地址:點(diǎn)這里// 與本程序?qū)?yīng)的紅外接收程序代碼:http://www.51hei.com/mcu/1096.html//****************************************************************************#include "MAIN.H"http:// USER CODE BEGIN (MAIN_General,2)#include#define uint  unsigned int   //宏定義#define uchar unsigned char#define  HWTx  P3_0     //位聲明:紅外發(fā)射管腳 bit  HWTx_Out;      //紅外發(fā)射管腳的狀態(tài)bit  Key_Flag,Flag;     //分別是:按鍵按下的標(biāo)志位,定時(shí)器開始的標(biāo)志位uint Count,Set_Count;    //控制定時(shí)時(shí)間的變量uchar Table_Tx[4]={0x40,0,0,0};//待發(fā)送的緩沖區(qū)uchar HWTx_Code,HWTx_data;// USER CODE END//****************************************************************************// @Macros//****************************************************************************// USER CODE BEGIN (MAIN_General,3)// USER CODE END//****************************************************************************// @Defines//****************************************************************************// USER CODE BEGIN (MAIN_General,4)// USER CODE END//****************************************************************************// @Typedefs//****************************************************************************// USER CODE BEGIN (MAIN_General,5)// USER CODE END//****************************************************************************// @Imported Global Variables//****************************************************************************// USER CODE BEGIN (MAIN_General,6)// USER CODE END//****************************************************************************// @Global Variables//****************************************************************************// USER CODE BEGIN (MAIN_General,7)// USER CODE END//****************************************************************************// @External Prototypes//****************************************************************************// USER CODE BEGIN (MAIN_General,8)// USER CODE END//****************************************************************************// @Prototypes Of Local Functions//****************************************************************************// USER CODE BEGIN (MAIN_General,9)// USER CODE END//****************************************************************************// @Function      void MAIN_vInit(void) ////----------------------------------------------------------------------------// @Description   This function initializes the microcontroller. It is //                assumed that the SFRs are in their reset state.////----------------------------------------------------------------------------// @Returnvalue   None////----------------------------------------------------------------------------// @Parameters    None////----------------------------------------------------------------------------// @Date          2010-11-4////****************************************************************************// USER CODE BEGIN (MAIN_Init,1)// USER CODE ENDvoid MAIN_vInit(void){// USER CODE BEGIN (MAIN_Init,2)// USER CODE END///  -----------------------------------------------------------------------///  Configuration of the System Clock:///  -----------------------------------------------------------------------///  - On Chip Osc is Selected///  - PLL Mode, NDIV = 2///  - input frequency is 10 MHz///  *********************************************************************************///  Note : All peripheral related IO configurations are done in the ///  respective peripheral modules (alternate functions selection)///  *********************************************************************************///  Initialization of module GPIOIO_vInit();//   Interrupt PriorityIP            =  0x00;         // load Interrupt Priority RegisterIPH           =  0x00;         // load Interrupt Priority High RegisterIP1           =  0x00;         // load Interrupt Priority 1 RegisterIPH1          =  0x00;         // load Interrupt Priority 1 High Register// USER CODE BEGIN (MAIN_Init,3)// USER CODE END//   globally enable interruptsEA            =  1;           } //  End of function MAIN_vInit
          				
                      
                          
          			
          							
          上一頁 1 2 下一頁

          評(píng)論


          技術(shù)專區(qū)

          關(guān)閉
          看屁屁www成人影院,亚洲人妻成人图片,亚洲精品成人午夜在线,日韩在线 欧美成人 (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })();