一乐电子

一乐电子百科

 找回密码
 请使用微信账号登录和注册会员

QQ登录

只需一步,快速开始

快捷登录

手机号码,快捷登录

搜索
楼主: elcy
收起左侧

一乐买的新版光王12864点亮了,型号为fc51852。

  [复制链接]
发表于 2013-7-22 12:14 | 显示全部楼层
我想问一下,电阻用多大的呢
发表于 2013-7-23 19:00 | 显示全部楼层
不行啊,不知道是不是电路的问题,不知楼主可不可以发个电路图来看看
发表于 2013-8-17 13:20 | 显示全部楼层
lvyunzeng 发表于 2013-7-8 19:54
电容使用的是1uF的啊 。

不知道你的光王12864的屏,在调的过程中有没有遇到写命令时,会把命令当数据写进去?
发表于 2013-9-7 20:03 | 显示全部楼层
I had a devil of a time getting an Optrex F-51852 128x64 graphical display to initialize properly, so I'm posting the working code here in case anyone else runs into the same problems I did.

Optrex doesn't recommend using the internal charge pumps to create the LCD drive voltages for the NJU6676 controller. I am posting two different connections/methods of driving this display. The code is clearly commented as to which h/w layout each pertains to.

The 2.2 uF capacitors I used in the schematic are simply what I had on hand. Optrex recommends using these particular capacitors:
4.7uf, NACEW4R7M35V4X5.5TR13 MFG: NIC
1uf, UWX1H010MCR1GB MFG: NIC
For what it's worth, I've seen 'reference' designs that use 0.1 to 4.7 uF capacitors, so size doesn't seem to be an issue.

The connections are as follows:   


yy.jpg
To initialize the LCD, simply call:
Code:
glcd_init();


NOTE: Allow for a 100 millisecond delay after the PIC powers up before attempting the LCD init routine.

Here is the driver code, as tested using an 18F4680:

Code:
#define ON  1
#define OFF 0

#define YES 1
#define NO  0

struct lcd_pin_def
{
   int  data : 8;
};

#define LCD_WR       PIN_B2
#define LCD_RD       PIN_B3
#define LCD_RESET    PIN_B4
#define LCD_A0       PIN_B5

#define set_tris_lcd(x) set_tris_c(x);
struct lcd_pin_def  GLCD;
#byte GLCD = 0xf82   // port c on the 18f4680

void glcd_writeByte(int1 DI, int data);
void glcd_init(void);

void glcd_init(void) {
   output_low(LCD_RESET); // hard reset
   delay_us(20);
   output_high(LCD_RESET);
   delay_ms(100);
   
   // init code for h/w connection METHOD 1
   glcd_writeByte(0, 0xE2);
   glcd_writeByte(0, 0xb0);
   glcd_writeByte(0, 0x10);
   glcd_writeByte(0, 0x00);
   glcd_writeByte(0, 0xa1);
   glcd_writeByte(0, 0x81); // contrast set
   glcd_writeByte(0, 0x3f); // contrast set
   glcd_writeByte(0, 0xaf);
   glcd_writeByte(0, 0x2b);
   delay_ms(50);
   glcd_writeByte(0, 0xe7);
   // note that with this method, the contrast is s/w adjustable

   // init code for h/w connection METHOD 2
   /*glcd_writeByte(0, 0xE2);
   glcd_writeByte(0, 0xa2);
   glcd_writeByte(0, 0xa1);
   glcd_writeByte(0, 0xc0);
   glcd_writeByte(0, 0x40);
   glcd_writeByte(0, 0x28);
   glcd_writeByte(0, 0xa4);
   glcd_writeByte(0, 0xa6);
   glcd_writeByte(0, 0xe7);
   glcd_writeByte(0, 0xaf);*/

}

void glcd_writeByte(int1 DI, int data) {
   if (DI) {
      output_high(LCD_A0);
   }
   else {
      output_low(LCD_A0);
   }
   set_tris_lcd(0x00);  
   GLCD.data = data;
   delay_us(2);
   output_low(LCD_WR);
   delay_us(2);
   output_high(LCD_WR);
   set_tris_lcd(0xff);
}


转帖地址:http://www.ccsinfo.com/forum/viewtopic.php?t=30399
发表于 2014-11-30 20:31 | 显示全部楼层
你好  不知楼主手里还有没有51852的屏了  能不能忍痛转让几卖给老弟!

本版积分规则

QQ|一淘宝店|手机版|商店|电子DIY套件|一乐电子 ( 粤ICP备09076165号 ) 公安备案粤公网安备 44522102000183号

GMT+8, 2024-4-29 02:10 , Processed in 0.050142 second(s), 27 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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