新手入门
- 积分
- 17
- 金钱
- 17
- 注册时间
- 2018-12-27
- 在线时间
- 10 小时
|

楼主 |
发表于 2018-12-27 15:51:24
|
显示全部楼层
已经解决配置如下 我是用的晶联讯172*104点阵液晶,需要把ROM_OUT引脚设置为输入其他推完输出即可,速度2MHZ。
void LCD_IO_Init(void)
{
//2018Äê12ÔÂ25èÕ
//ROM_IN/ROM_OUT/ROM_SCK/
GPIO_InitTypeDef GPIO_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC,ENABLE);//¿aC¿úê±Ö󣬸′óÃê±Öó
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13 | GPIO_Pin_15;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOC,&GPIO_InitStructure);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC,ENABLE);//¿a
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_14;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_Init(GPIOC,&GPIO_InitStructure);
//PWR_BackupAccessCmd(ENABLE);//ÔêDíDT¸ÄRTCoíoó±3¼Ä′æÆ÷
RCC_LSEConfig(RCC_LSE_OFF);//1رÕía2¿μíËùía2¿ê±ÖóDÅoÅ1|Äüoó£¬C13/PC14/PC152Å¿éòÔμ±ÆÕí¨IOê1óÃ
// PWR_BackupAccessCmd(DISABLE);//½ûÖ1DT¸Äo󱸼Ä′æÆ÷
// BKP_TamperPinCmd(DISABLE);//1رÕèëÇÖ¼ì2a1|Äü£¬ò2¾íêÇC13£¬ò2¿éòÔμ±×öÆÕí¨IOê1óÃ
// BKP_ITconfig(DISABLE);//±¸·YÇøD′±£»¤
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC,ENABLE); //ROM_CS ƬѡDÅoÅ
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOC,&GPIO_InitStructure);
PCout(0) = 1;
PCout(13) = 1;
PCout(14) = 1;
PCout(15) = 1;
//SCK_LCD/SDA_LCD/RS_LCD/RST_LCD/CS_LCD
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOD,ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_3 | GPIO_Pin_4 | GPIO_Pin_5;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
GPIO_Init(GPIOD,&GPIO_InitStructure);
PDout(0) = 1;
PDout(1) = 1;
PDout(3) = 1;
PDout(4) = 1;
PDout(5) = 1;
//¿ØÖÆ
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB,ENABLE);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IPU;
GPIO_Init(GPIOB,&GPIO_InitStructure);
PBout(12) = 1;
PBout(13) = 1;
PBout(14) = 1;
PBout(15) = 1;
} |
|