12864h.txt in 12864h2.rar


AVR chips used to control the 12864 LCD, containing procedures, ATMEGA8535 the K...Original Link
    Sponsored links

			
/*使用MCU: ATMEGA8535L
  LCD MODULE: 128*64
  IC Control:S6B0108 

*/
 #include <avr/io.h>
 #include <inttypes.h>
 //#include <stdlib.h>
 #include <avr/delay.h>
#include <avr/interrupt.h>
#include <avr/pgmspace.h>

#define pdout  PORTC
#define pdin   PINC
#define pcont  PORTB					
#define pcont1 PORTD

#define e   PB0
#define rw  PB1
#define rs  PB2
#define cs1 PB3
#define cs2 PB4
#define rst PD6

 #define set_Bit(val, bitn)    (val |=(1<<(bitn))) //设置某一位
 #define clr_Bit(val, bitn)    (val&=~(1<<(bitn))) //清除某一位
 #define get_Bit(val, bitn)    (val &(1<<(bitn)) ) //取某一位
#define nop()  asm("nop") 



#define TC2_EN TIMSK |= (<<1OCIE2)|(1<<TOIE2) //启动TC2定时比较和溢出
#define TC2_DIS TIMSK &=~ (1<<OCIE2)|(1<<TOIE2)//禁止TC2再定时比较和溢出
 
#define uchar unsigned char   //
#define uint  unsigned int    //

static uint g_aAdValue[8]; //A/D 转换缓冲

//static uchar g_datbuf[5];// 串口通讯数据缓冲区 接收存储空间
 static uchar datbuf1=0;
static uchar datbuf2=0;
static uchar datbuf3=0;
 static uchar datbuf4=0;

 // uchar datbuf[5]={0,0,0,0,0,};
 // static uchar g_aAdValue[5];
 static  uchar column;
 static uchar row;
 ///static uint example;
//static uchar columnbuf;
//static uchar rowbuf;
static uchar cursor=0x5f;
static uchar autoscroll=0;        //自动卷动标志
static uchar pwmbuf;

//=====================================================    
const prog_uchar leddat[]=     //
       {
        "0" /*0*/
        "1"/*1*/
        "2"/*2*/
        "3"/*3*/
        "4"/*4*/
        "5"/*5*/
        "6"/*6*/
        "7"/*7*/
        "8"/*8*/
        "9"/*9*/
        "A"/*A*/
        "B"/*B*/
        "C"/*C*/
        "D"/*D*/
        "E"/*E*/
        "F"/*F*/
        };

/////////////////8*8 dots/////////////////////////////////
const prog_uchar t5x8[]={
        0x00,0x00,0x00,0x00,0x00, //" "=00H
        0x00,0x00,0x4F,0x00,0x00, //"!"=01H
        0x00,0x07,0x00,0x07,0x			

			...
			...
			... to be continued.

  This is a preview. To get the complete source file, 
  please click here to download the whole source code package.

			
			


Project Files

    Sponsored links
NameSizeDate
 12864h2.aps2.85 kB04-03-08 10:32
 pgmspace.h21.60 kB22-04-06 01:30
 12864h2.aws231.00 B12-04-08 13:35
 12864h.txt19.96 kB04-03-08 16:59
 温度.xls22.50 kB04-03-08 22:52
 12864h2.c21.52 kB05-03-08 13:33
 Makefile1.74 kB05-03-08 13:33
 12864h2.o18.49 kB05-03-08 13:32
 12864h2.elf14.75 kB05-03-08 13:32
 12864h2.hex12.01 kB05-03-08 13:32
 12864h2.eep13.00 B05-03-08 13:32
 12864h2.o.d987.00 B05-03-08 13:32
 <dep>0.00 B05-03-08 16:51
 <default>0.00 B05-03-08 16:51
 <12864h2>0.00 B05-03-08 16:51
...

Related Items

    Sponsored links