查看: 532|回复: 2
打印 上一主题 下一主题

用LM3S8962点亮智林OLED

[复制链接] qrcode

13

主题

39

帖子

95

积分

注册会员

Rank: 2

积分
95
楼主
跳转到指定楼层
发表于 2015-12-24 09:00 AM | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
智林新出款LED显示屏,我用LM3S8962的SSI,点亮了,以下是这个屏我链接
http://item.taobao.com/item.htm?id=8866019885

上下程序:
int main(void)
{
unsigned int x;
unsigned int y;
//
// Set the clocking to run directly from the crystal.
//
GPIOCInit();
SysCtlClockSet(SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN |
SYSCTL_XTAL_8MHZ);
//
// Enable the SSI0 and GPIO port blocks as they are needed by this driver.
//
SysCtlPeripheralEnable(SYSCTL_PERIPH_SSI0);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOA);
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIO_OLEDDC);

//
// Configure the SSI0CLK and SSIOTX pins for SSI operation.
//
GPIOPinTypeSSI(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_5);
GPIOPinTypeGPIOOutput(GPIO_OLEDDC_BASE, GPIO_PIN_4);
GPIOPadConfigSet(GPIO_PORTA_BASE, GPIO_PIN_2 | GPIO_PIN_3 | GPIO_PIN_4|GPIO_PIN_5,
GPIO_STRENGTH_8MA, GPIO_PIN_TYPE_STD_WPU);


//
// Configure and enable the SSI0 port for master mode.
//

SSIConfigSetExpClk(SSI0_BASE,2400 , SSI_FRF_MOTO_MODE_3,
SSI_MODE_MASTER, 1200, 8); //SysCtlClockGet()


//
// Enable the SSI port.
//
SSIEnable(SSI0_BASE);
reset();

LCD_write_byte(0xAE,0);//display off

LCD_write_byte(0x02,0); //set lower column address ******* SSD1303 04
LCD_write_byte(0x10,0);//set higher column address******* SSD1303 12
LCD_write_byte(0x40,0);//set display start line

LCD_write_byte(0xB0,0);//set page address

LCD_write_byte(0x81,0);//contract control
LCD_write_byte(0x80,0);//128

LCD_write_byte(0xA1,0);//set segment remap
LCD_write_byte(0xA4,0);//normal display
LCD_write_byte(0xA6,0);//normal / reverse

LCD_write_byte(0xA8,0);//multiplex ratio
LCD_write_byte(0x3F,0);//duty = 1/64

LCD_write_byte(0xC8,0);//Com scan direction

LCD_write_byte(0xD3,0);//set display offset
LCD_write_byte(0x00,0);//SSD1303 ******** 0x60

LCD_write_byte(0xD5,0);//set osc division
LCD_write_byte(0x00,0);

LCD_write_byte(0xD8,0);//set area color mode off
LCD_write_byte(0x05,0);

LCD_write_byte(0xDA,0);// set COM pins
LCD_write_byte(0x12,0);

LCD_write_byte(0xDB,0);//
LCD_write_byte(0x40,0);

LCD_write_byte(0xAD,0);// DC/DC control mode: on
LCD_write_byte(0x8B,0);

LCD_write_byte(0xAF,0);//display ON

LCD_write_byte(0x02,0);/*set lower column address*/
LCD_write_byte(0x10,0);/*set higher column address*/

LCD_write_byte(0xB0,0);/*set page address*/

for(y=0;y<8;y++)
{
LCD_write_byte((0xB0+y),0);/*set page address*/
LCD_write_byte(0x02,0);/*set lower column address*/
LCD_write_byte(0x10,0);/*set higher column address*/
for(x=0;x<64;x++)
{
LCD_write_byte(0xff,1);
LCD_write_byte(0xff,1);
}
}

delay(60000);
delay(60000);


for(i=0;i<550;i++)
{
LCD_write_byte(0xFF,1);
}
delay(10000);

LCD_write_byte(0x02,0);
LCD_write_byte(0x12,0);
LCD_write_byte(0xB1,0);
LCD_PrintStr(" HELLO!");
LCD_write_byte(0x03,0);
LCD_write_byte(0x11,0);
LCD_write_byte(0xB5,0);
LCD_PrintStr("EEWORLD!!!");

}

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
回复

使用道具 举报

136

主题

868

帖子

1880

积分

金牌会员

Rank: 6Rank: 6

积分
1880
沙发
发表于 2015-4-29 08:09 AM | 只看该作者
我公司专业销售LM3S8962-IQC50-A2,有需求请联系张凯QQ371734047,直线0755-83752905,手机13076954092                                                                                                                                                                       
回复 支持 反对

使用道具 举报

136

主题

868

帖子

1880

积分

金牌会员

Rank: 6Rank: 6

积分
1880
板凳
发表于 2015-4-29 09:20 AM | 只看该作者
oled的色彩还不是很丰富啊。                                                                                                                                                                       
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

快速回复 返回顶部 返回列表