本帖最后由 chuandaoxy 于 2020-12-15 09:55 编辑
下面是包含的头文件CPU是12f683,在690的程序里没有见过这莫设计
#include <htc.h>
#include "lcd_i2c_lib.h"
#include "rs232.h"
#include <string.h>
void main(void)
{
unsigned int i;
OSCCON = 0x70; // 8MHz
GPIO = 0x3E; // GP0High
TRISIO = 0x1C; // GP2,3,4
ANSEL = 0x04; // AN2
CMCON0 = 0x07; //
Flag = 0; //
lcd_init(); //
lcd_clear(); //
lcd_str(Buffer); //
T2CON = 0x01; // 1/4,1/1
TMR2IF = 0;
TMR2IE = 1;
PEIE = 1;
GIE = 1;
|