OpenEdv-开源电子网

 找回密码
 立即注册
正点原子全套STM32/Linux/FPGA开发资料,上千讲STM32视频教程免费下载...
查看: 2543|回复: 2

STM32 pc13 pc14 pc15 100引脚封装 IO配置

[复制链接]

5

主题

14

帖子

0

精华

新手入门

积分
17
金钱
17
注册时间
2018-12-27
在线时间
10 小时
发表于 2018-12-27 10:29:22 | 显示全部楼层 |阅读模式
2金钱
我使用的晶联讯的  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"   但是出现错误..\OBJ\DC50-01-C1-1720180131.axf: Error: L6218E: Undefined symbol PWR_BackupAccessCmd (referred from jlx_lcd.o).
请各位大神帮忙解决一下,万分感谢。
1545875284(1).jpg

最佳答案

查看完整内容[请看2#楼]

已经解决配置如下 我是用的晶联讯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.G ...
正点原子逻辑分析仪DL16劲爆上市
回复

使用道具 举报

5

主题

14

帖子

0

精华

新手入门

积分
17
金钱
17
注册时间
2018-12-27
在线时间
10 小时
 楼主| 发表于 2018-12-27 10:29:23 | 显示全部楼层
已经解决配置如下    我是用的晶联讯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ó£&#172C13/PC14/PC152Å¿éòÔμ±ÆÕí¨IOê1óÃ
        //        PWR_BackupAccessCmd(DISABLE);//½ûÖ1DT¸Äo󱸼Ä′æÆ÷
        //        BKP_TamperPinCmd(DISABLE);//1رÕèëÇÖ¼ì2a1|Äü£¬ò2¾íê&#199C13£¬ò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;
}
回复

使用道具 举报

5

主题

14

帖子

0

精华

新手入门

积分
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;
}
回复

使用道具 举报

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

本版积分规则



关闭

原子哥极力推荐上一条 /2 下一条

正点原子公众号

QQ|手机版|OpenEdv-开源电子网 ( 粤ICP备12000418号-1 )

GMT+8, 2025-6-22 23:31

Powered by OpenEdv-开源电子网

© 2001-2030 OpenEdv-开源电子网

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