Contact Us
Position:Home > News > IndustryNews

Wireless Charger Include LGT8F690A Microcontroller Source Program

2019-7-8      View:

Recommend a MCU with high cost performance for everyone to communicate and learn from each other.

The physical pictures produced are as follows

the-physical-picture-produced

The source file of PCB

the-source-file-of-PCB

LGT8F690A microcontroller source program is as follows:

#include "allinone.h"
#include "lgt8f690a_qiwc.h"
//Maximum current threshold during charging
#define        i_threshold        80
//Temperature Threshold During Operation
#define        t_threshold        500
//Threshold value of difference between output power and received power when foreign matter occurs during charging.
#define        fod_threshold        2800
//QI communication indicator
#define QLED_COM_ON()        CMOE = 1
#define QLED_COM_OFF()        CMOE = 0
// Import external definitions
extern void init_modules(void);
//The system power supply indicator is on
void qled_power_on()
{
        LATA6 = 0;
}
//The system power supply indicator is off
void qled_power_off()
{
        LATA6 = 1;
}
//Qi long pause request indicator on
void qled_lto_on()
{
        LATB5 = 0;
}
//Qi long pause request indicator off
void qled_lto_off()
{
        LATB5 = 1;
}
//Qi foreign matter detection indicator is on.
void qled_fod_on()
{
        LATC0 = 0;
}
//Qi Foreign Body Detection Indicator Off
void qled_fod_off()
{
        LATC0 = 1;
}
//Qi power down request indicator on
void qled_pdec_on()
{
        LATA1 = 0;
}
//Qi Power Down Request Indicator Off
void qled_pdec_off()
{
        LATA1 = 1;
}
//Qi power up request indicator on
void qled_pinc_on()
{
        LATA4 = 0;
}
//Qi power up request indicator off

void qled_pinc_off()
{
        LATA4 = 1;
}
// main program start
// ==========================================
int main(void)
{
        // Device initialization
        init_modules();
        wdtReset();
        wdtStop();        
        t2c1OutputEnable();
        t2c1nOutputEnable();
        t2c2OutputEnable();
        t2c2nOutputEnable();
        acEnable();
        dapEnable();
        //Qi related initialization
        qiwc_init();
        qiwc_set_ithreshold(i_threshold);
        qiwc_set_tthreshold(t_threshold);
        qiwc_set_fthreshold(fod_threshold);
        //Turn off Qi communication indicator
        // QLED_COM_OFF();
        while(1)
        {        
                //Qi protocol processing
                qiwc_loop();
        }
        return 0; 
}

We focus on the development and manufacture of wireless chargers, have rich experience in research, development and processing, and provide wireless charger products and wireless charging PCBA solution services to customers around the world. If you want to know more about wireless charging, please add to favorite and welcome to contact us.