HXD019 Driver Collection

Published 2017-02-18Views 2252views

Complete HXD019 infrared driver collection, C language, applicable for 51 MCU, STM8, STM32, 8266, MTK, Spreadtrum, RK, Allwinner, etc., complete drivers for all platforms.

Article

                   Complete Collection of Application Drivers for HXD019 Intelligent IR Universal Remote Control Chip on Various Platform Systems 

   HXD019 is an IR signal transceiving and processing chip that supports all IR devices. The main control chip needs to call the interface function to enter the data transmission or data learning state.,Communication mode:

ThreeGPIO communication or one pair of I2C + one GPIO communication

   (I) ThreeGPIO communication:

     0. Set three GPIOs and perform initialization,  hxd019D_V1.9.cFile:

       Disablethe internal pull-down of all IOs connecting the MCU and the remote control IC_HXD019. Configure the pins connecting all main control chips from Set_SDA_IO()   GetBUSYStatusto ()hxd019connectedpinpins.         After the functionis configured, there areSDA,SCL,BUSyseveral configuration functions respectively. All pins are at high level during power-on or standby, then add them to the compilation. The example is as follows;

 

       1. Transmit learning data or code library data:

        1.1 Retrieve data (Sizevariable length, 10 to 120 bytes, maximum 232 bytes for learning data)Example:

        unsigned char  data[]={0x30,0x00,0x01,0x1c,0xE3,0x00,0xFF,0x20,0x88,0xD7}

      1.2 Then call the write function: void writeI2C(char* data, UINT8 count); 

        2. Learn and transmit learning data: hxd019D_V1.9.c file:

      2.1  Enter learning mode: call the provided function once : Learn_start2();(External operation required at this time);

         2.2  Wait for learning to complete: When the IO port(busy port)changes from lowto high, call the function readI2C2(), example:

         Learn_start2(); //busy goes low at this time

         Delay(50ms);    //Delay 50mS  //Wait for hardware to stabilize)

          while(busy ==1)   //(Wait for learning, the main control can perform other tasks at this time, and read the data after busy goes high)

           {

            Delay(10us) //(busy goes high after learning)

            readI2C2(char* readtempbuf)

            };

         2.3 Learning data processing: Remove the first byte 00 from the read data, add 0x30 and 0x03 at the beginning, and add a checksum. Starting from 0x30,

           the lower 8 bits of the sum of all dataare placed in the 232nd byte, 0x30, 0x03 + (00  229 bytes) + checksum (lower 8 bits of the sum of the first 231

           bytes). When in use, send it back to the 019 chip, using the function writeI2C() (same as above);

      3. Hardware related:

          Connect the hardware properly (refer to the schematic diagram below) 

      4. Timing adjustment, in thehxd019D_V1.9.cfile,

         refer to theTiming Reference Diagram.JPG document: Adjust according to the different clocks of the MCU, test the communication clock SCL line to adjust the following parameters:For different clock adjustments of the MCU, adjust the following parameters when measuring the communication clock SCL line:

 

       #define  DELAY_TIME  550    

       #define  DELAY_ST  19 // 

      

  (II) One pair ofI2C + one GPIO communication:

       For I2C communication, write an FF data first before each read/write operation, and read/write the official data after a 20mS delay. The usage of the other GPIO, namely the busy communication port, is the same as that in the three GPIO communication mode. For I2C commands, refer to the data in the above code, and send all data from beginning to end. The data already includes the I2C address and I2C data.

 

 

Clarify the requirement before choosing a chip

Tell us the device type, interaction needs and volume plan; we will match a solution and arrange samples.

You are visitor No.7607   粤ICP备13027018号 Shenzhen Market Supervision Administration