微波EDA网,见证研发工程师的成长!
首页 > 硬件设计 > 嵌入式设计 > C8051F330 16*16点阵(SPI 、SMBus、I2C)PCF8563

C8051F330 16*16点阵(SPI 、SMBus、I2C)PCF8563

时间:11-30 来源:互联网 点击:



#include
#include
#include
#include
#include

#define SPEED 2000
#define TIME 1800
#define uint unsigned int
#define uchar unsigned char

#define BLKN 2 //用于点阵列扫描的595的个数
#define TOTAL 26 //待显示的字数
#define CONIO P1

uchar number;//d=0,
uchar control=0,choose,send;
uchar receive_number=3,send_number=0;

bit BUSY;
bit SMB_RW;

uchar hou=0;
uchar min=0;
uchar sec=0;

uchar sg;//时高位
uchar sd;//时低位

uchar fg;//分高位
uchar fd;//分低位

uchar mg;//秒高位
uchar md;//秒低位

sbit CLK=P1^7; //输出脉冲
sbit scyx=P1^6; //复位
sbit led=P0^7;
sbit pcf8563_scl=P0^5;//时钟频率
sbit pcf8563_sda=P0^4;//串行数据传输脚

uchar idata dispram[(BLKN/2)*32]={0};

uchar receive1[3]={0x00,0x00,0x00};//时、分、秒
uchar send1[4]={0x02,0x33,0x25,0x03};//时、分、秒、器件地址
/*********************************字模表***************************************/
uchar code Bmp[][32]={
{0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xF0,0x1C,0x18,0x38,0x1C,0x38,0x0E,0x38,0x0E,
0x78,0x0E,0x38,0x0E,0x38,0x0E,0x38,0x1C,0x1C,0x18,0x07,0xF0,0x00,0x00,0x00,0x00},
/***数字0***/
{0x00,0x00,0x00,0x00,0x00,0x00,0x01,0xC0,0x0F,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,
0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x01,0xC0,0x0F,0xFC,0x00,0x00,0x00,0x00},
/***数字1***/
{0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF8,0x18,0x1C,0x38,0x1C,0x18,0x1C,0x00,0x38,
0x00,0x70,0x01,0xC0,0x07,0x00,0x0C,0x06,0x3F,0xFC,0x3F,0xFC,0x00,0x00,0x00,0x00},
/***数字2***/
{0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF0,0x38,0x38,0x38,0x1C,0x00,0x38,0x03,0xF0,
0x03,0xF0,0x00,0x1C,0x00,0x0E,0x38,0x1C,0x38,0x1C,0x0F,0xF0,0x00,0x00,0x00,0x00},
/***数字3***/
{0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0xF0,0x01,0xF0,0x03,0x70,0x0C,0x70,
0x18,0x70,0x30,0x70,0x3F,0xFE,0x00,0x70,0x00,0x70,0x03,0xFE,0x00,0x00,0x00,0x00},
/***数字4***/
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFC,0x18,0x00,0x18,0x00,0x18,0xC0,0x1F,0xF8,
0x18,0x1C,0x00,0x1E,0x10,0x0E,0x38,0x1C,0x38,0x18,0x0F,0xF0,0x00,0x00,0x00,0x00},
/***数字5***/
{0x00,0x00,0x00,0x00,0x00,0x00,0x07,0xF8,0x0C,0x3C,0x18,0x08,0x38,0x00,0x3F,0xF8,
0x7C,0x1C,0x78,0x0E,0x38,0x0E,0x38,0x0E,0x1C,0x1C,0x07,0xF0,0x00,0x00,0x00,0x00},
/***数字6***/
{0x00,0x00,0x00,0x00,0x00,0x00,0x1F,0xFE,0x3C,0x0C,0x30,0x18,0x00,0x30,0x00,0x60,
0x00,0xC0,0x01,0xC0,0x03,0x80,0x03,0x80,0x03,0x80,0x03,0x80,0x00,0x00,0x00,0x00},
/***数字7***/
{0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF8,0x38,0x0C,0x30,0x0E,0x3C,0x0C,0x1F,0xF8,
0x0F,0xF0,0x38,0x3C,0x30,0x0E,0x70,0x0E,0x38,0x0C,0x0F,0xF0,0x00,0x00,0x00,0x00},
/***数字8***/
{0x00,0x00,0x00,0x00,0x00,0x00,0x0F,0xF0,0x38,0x18,0x30,0x0C,0x70,0x0E,0x30,0x0E,
0x38,0x3E,0x1F,0xEE,0x00,0x1C,0x18,0x18,0x3C,0x30,0x1F,0xE0,0x00,0x00,0x00,0x00},
/***数字9***/

{0x00,0x40,0x40,0x40,0x30,0x40,0x10,0x40,0x00,0x48,0x00,0x7C,0xF0,0x40,0x10,0x40,
0x10,0x40,0x10,0x40,0x10,0x40,0x12,0x40,0x14,0x40,0x18,0x44,0x17,0xFE,0x00,0x00},//让

{0x00,0x08,0x3F,0xFC,0x21,0x08,0x21,0x08,0x21,0x08,0x3F,0xF8,0x21,0x08,0x21,0x08,
0x21,0x08,0x3F,0xF8,0x20,0x08,0x02,0x00,0x51,0x88,0x50,0x96,0x90,0x12,0x0F,0xF0},//思

{0x10,0x80,0x10,0xA0,0x20,0x94,0x21,0xFE,0x49,0x10,0xFB,0x10,0x15,0xFC,0x21,0x10,
0x41,0x10,0xFD,0xFC,0x01,0x10,0x01,0x10,0x1D,0x14,0xE1,0xFE,0x41,0x00,0x01,0x00},//维

{0x01,0x20,0x41,0x24,0x2F,0xFE,0x21,0x24,0x01,0x24,0x8F,0xFC,0x49,0x24,0x09,0x20,
0x1F,0xFE,0x29,0x22,0xE1,0x22,0x21,0x2A,0x22,0x24,0x22,0x20,0x24,0x20,0x28,0x20},//沸

{0x00,0x40,0x7A,0x48,0x49,0x50,0x4B,0xFC,0x48,0x80,0x7F,0xFE,0x49,0x10,0x4A,0x0E,
0x4D,0xF4,0x78,0x10,0x49,0x14,0x49,0xFE,0x48,0x04,0x4F,0xE4,0x88,0x14,0x18,0x08},//腾

{0x08,0x00,0x08,0x08,0x08,0xFC,0x7E,0x08,0x08,0x08,0x08,0x08,0xFE,0xF8,0x08,0x88,
0x28,0x80,0x2E,0x84,0x28,0x84,0x28,0x7C,0x28,0x00,0x58,0x06,0x8F,0xFC,0x00,0x00},//起

{0x01,

Copyright © 2017-2020 微波EDA网 版权所有

网站地图

Top