dragonwww 发表于 2010-6-4 09:00:01

VC的FSMC接OLED的设置问题

我现在想用STM32F103VC的FSMC来驱动S6E63D6的OLED,
我的硬件连接如下:
/*
硬件连接:(STM32F103VC---S6E63D6)
FSMC         OLED
D15-D8      D17-D10
D7-D0         D8-D1
A16         RS
NWE      RW_NRD/WRB
NOE      E_NWR/RDB
PC12       RESET
NE1      NCS/CSB
*/

可现在总是不正确,请教一下各位该如何配置呢?
看到Readio代码里有这个配置:
/* LCD is connected to the FSMC_Bank1_NOR/SRAM2 and NE2 is used as ship select signal */
/* RS <==> A2 */
#define LCD_REG            (*((volatile unsigned short *) 0x64000000)) /* RS = 0 */
#define LCD_RAM            (*((volatile unsigned short *) 0x64000008)) /* RS = 1 */

可我老是觉得A2的地址应该是0x64000004啊?这个Ax对应的地址到底如何确定呢?
我现在用VC的A16接的RS,地址如下:
#define LCD_WR_REG(a)   {(*((volatile unsigned int *) 0x60000000)) = (a);}
#define LCD_WR_RAM(a)   {(*((volatile unsigned int *) 0x60010000)) = (a);}
这样正确吗?

aozima 发表于 2010-6-4 11:04:26

STM32在16位时,A0变A1.
有的芯片则是A0舍弃不用.

dragonwww 发表于 2010-6-4 11:57:58

你是说用VC的A16接的RS,地址如下:
#define LCD_WR_REG(a)   {(*((volatile unsigned int *) 0x60000000)) = (a);}
#define LCD_WR_RAM(a)   {(*((volatile unsigned int *) 0x60010000)) = (a);}
这样是不正确的,应该是:
#define LCD_WR_REG(a)   {(*((volatile unsigned int *) 0x60000000)) = (a);}
#define LCD_WR_RAM(a)   {(*((volatile unsigned int *) 0x60020000)) = (a);}
对吗?下午烧写一下看看,谢谢aozima指点:)

dragonwww 发表于 2010-6-9 14:14:10

搞定,硬件连接没有错误,软件设置错了两个地方:

1.是地址确实如aozima所说的,当配置成16bit时A16的地址如下:
///* LCD is connected to the FSMC_Bank1_NOR/SRAM1 and NE1 is used as ship select signal */
///* RS <==> A16      CMD:A16=0           DATA:A16=1 */
#define LCD_REG            (*((volatile unsigned short *) 0x60000000)) /* RS = 0 */
#define LCD_RAM            (*((volatile unsigned short *) 0x60020000)) /* RS = 1 */

2.是维信诺的OLED的S6E63D6配置寄存器错了一个,正确的如下:
   Write_Command(0x23); //0x23为8080-16bit,0x24为8080-8bit               

   Write_Command(0x02);       //开启系统总线,不使用RGB Interface
   Write_Data(0x0000);          //
                                               
   Write_Command(0x03);       
   Write_Data(0x0130);       //CLS=0:65K Color SS=1,AM=0,ID=11   此处开始设错了!

   Write_Command(0x10);
   Write_Data(0x0000);           //D0=1:Standby Mode

   Write_Command(0x0070);          //R
   Write_Data(0x2080);        //(0x2580);
   Write_Command(0x0071);          //G
   Write_Data(0x2200);        //(0x2780);
   Write_Command(0x0072);       //B
   Write_Data(0x2880);        //(0x3380);
   Write_Command(0x0073);          //R1 2
   Write_Data(0x2018);
   Write_Command(0x0074);          //R3 4
   Write_Data(0x1f19); //Write_Data(0x1f11);
   Write_Command(0x0075);          //G1 2
   Write_Data(0x2019);
   Write_Command(0x0076);          //G3 4
   Write_Data(0x1a18);
   Write_Command(0x0077);          //B1 2
   Write_Data(0x201a);
   Write_Command(0x0078);          //B3 4
   Write_Data(0x201a);

aureole 发表于 2010-6-29 08:45:01

马克

rocket432 发表于 2011-5-7 14:50:51

回复【4楼】aureole XiaomaGee
-----------------------------------------------------------------------

mark

zhaochuanyuAVR 发表于 2011-9-14 21:21:33

请问各位大侠! 谁用过维信诺的VGF160128B-S001
请教焊接方法和 驱动程序我的邮箱:zhaochuanyu1982@sina.com
我的QQ:149233310
页: [1]
查看完整版本: VC的FSMC接OLED的设置问题