RT:使用NXP COG PCA8538显示:".EEBOARD.COM"
看了好几个小时的PCA8538资料,发现下边的点阵区域,其实就是点阵显示而已,找到规律,设置为1:8 MUX,直接一个竖线代表一个显示的RAM的字节。于是显示个字符串吧,当然选择的是:“。EEBOARD。COM“;
核心程序如下:
//w(0) w(1) w(2) .(3) e(4) e(5) b(6) o(7) a(8) r(9) d(10) .(11)
unsigned char eeb[100]=
{0xFF,0xFF,0xFF,0xFD,0xFD,0xFF,0xFF,0xFF,/*".",0*/
0xFF,0x81,0xAD,0xAD,0xAD,0xAD,0xAD,0xBD,/*"E",1*/
0xFF,0x81,0xAD,0xAD,0xAD,0xAD,0xAD,0xBD,/*"E",2*/
0xFF,0x81,0xAD,0xAD,0xAD,0xAD,0xD3,0xFF,/*"B",3*/
0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,/*"O",4*/
0xFD,0xF3,0xE7,0x97,0x97,0xE7,0xF3,0xFD,/*"A",5*/
0xFF,0x81,0xB7,0xB7,0xB7,0xB7,0xC1,0xFF,/*"R",6*/
0xFF,0x81,0xBD,0xBD,0xBD,0x99,0xC3,0xFF,/*"D",7*/
0xFF,0xFF,0xFF,0xFD,0xFD,0xFF,0xFF,0xFF,/*".",8*/
0xFF,0xC3,0x99,0xBD,0xBD,0xBD,0xD3,0xFF,/*"C",9*/
0xFF,0xC3,0x99,0xBD,0xBD,0x99,0xC3,0xFF,/*"O",10*/
0xFF,0x81,0x87,0xF9,0xF1,0xCF,0x81,0xFF};/*"M",11*/
while(1)
{
GPIO_ResetBits(GPIOA, GPIO_Pin_4);//选中 cs
temp = SPI1_RWByte(0x20);
temp = SPI1_RWByte(0x80);
temp = SPI1_RWByte(0x3a);
temp = SPI1_RWByte(0x80);
temp = SPI1_RWByte(0xd8);
temp = SPI1_RWByte(0x80);
temp = SPI1_RWByte(0x18);
temp = SPI1_RWByte(0x80);
temp = SPI1_RWByte(0xd4);
temp = SPI1_RWByte(0x80);
temp = SPI1_RWByte(0xc9);
temp = SPI1_RWByte(0x80);
temp = SPI1_RWByte(0x45);
temp = SPI1_RWByte(0x80);
temp = SPI1_RWByte(0x73);
temp = SPI1_RWByte(0x80);
temp = SPI1_RWByte(0x00);
temp = SPI1_RWByte(0x80);
temp = SPI1_RWByte(0xd3);//1:8 mux //d0
temp = SPI1_RWByte(0x80);
temp = SPI1_RWByte(0xb4);//b3
temp = SPI1_RWByte(0x80);
temp = SPI1_RWByte(0x39);
temp = SPI1_RWByte(0x80);
temp = SPI1_RWByte(0x80);
temp = SPI1_RWByte(0x80);
temp = SPI1_RWByte(0x90);
temp = SPI1_RWByte(0x80);
temp = SPI1_RWByte(0xa0);
temp = SPI1_RWByte(0x20);
for(i=0;i<96;i++)temp = SPI1_RWByte(eeb);
GPIO_SetBits(GPIOA, GPIO_Pin_4);//不选中 cs
delay(1);
delay(1);
break;
}
显示效果如下:
、
|