我使用的晶联讯的 172*104点阵液晶但是不小心,把连接GB2312的3个引脚连在了13、14、15上。
我的配置如下
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC | RCC_APB2Periph_AFIO,ENABLE);//¿aC¿úê±Ö󣬸′óÃê±Öó
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_13 | GPIO_Pin_14 | GPIO_Pin_15;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
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);
我添加了 #include "stm32f10x_pwr.h" 但是出现错误..OBJDC50-01-C1-1720180131.axf: Error: L6218E: Undefined symbol PWR_BackupAccessCmd (referred from jlx_lcd.o).
请各位大神帮忙解决一下,万分感谢。
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
已经解决配置如下 我是用的晶联讯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;
}
一周热门 更多>