你的浏览器版本过低,可能导致网站不能正常访问!
为了你能正常使用网站功能,请使用这些浏览器。
chrome
firefox
safari
ie8及以上
ST
意法半导体官网
STM32
中文官网
ST
全球论坛
登录/注册
首页
技术问答
话题
资源
创客秀
视频
标签
积分商城
每日签到
现有项目求大侠指点!有偿帮助!谢谢
[复制链接]
yonglai888
提问时间:2011-10-6 15:02 /
现做了一款电路板,用的芯片STM32F100R8,现以焊好电路板,用串口可以下载程序,现在问题是晶振没有启振,程序下载后也没反应,所用的程序都是实例程序编写的,现不知道该如何处理,如果有用过此IC且熟悉编程的大侠,请联系我QQ:27235729,视情况可以有偿请教!具体情况再细聊,情况紧急!非诚勿扰!
赞
0
收藏
0
评论
8
分享
发布时间:2011-10-6 15:02
举报
请先
登录
后回复
8个回答
废鱼
回答时间:2011-10-6 16:14:16
a0a.1 0b0c
RE:现有项目求大侠指点!有偿帮助!谢谢
1、请确认你的工程是100芯片的
2、外部晶振要用8Mhz的。
3、你可以选择内部时钟作为时钟源,看看能不能工作。
赞
0
评论
回复
支持
反对
yonglai888
回答时间:2011-10-6 16:38:45
a0a.1 0b0c
RE:现有项目求大侠指点!有偿帮助!谢谢
确认是STM32F100R8的,
外部用的是8M的,如果工作会有什么现象?
赞
0
评论
回复
支持
反对
废鱼
回答时间:2011-10-6 17:00:55
a0a.1 0b0c
RE:现有项目求大侠指点!有偿帮助!谢谢
看你烧的什么程序了,你可以自己写一个GPIO控制LED闪烁的实验程序。看看是不是能够正常工作。可以使用仿真器,这个是最直接有效的办法了。
赞
0
评论
回复
支持
反对
yonglai888
回答时间:2011-10-6 17:02:41
a0a.1 0b0c
RE:现有项目求大侠指点!有偿帮助!谢谢
void SystemInit (void)
{
/*!< RCC system reset(for debug purpose) */
/*!< Set HSION bit */
RCC->CR |= (uint32_t)0x00000001;
/*!< Reset SW[1:0], HPRE[3:0], PPRE1[2:0], PPRE2[2:0], ADCPRE[1:0] and MCO[2:0] bits */
RCC->CFGR &= (uint32_t)0xF8FF0000;
/*!< Reset HSEON, CSSON and PLLON bits */
RCC->CR &= (uint32_t)0xFEF6FFFF;
/*!< Reset HSEBYP bit */
RCC->CR &= (uint32_t)0xFFFBFFFF;
/*!< Reset PLLSRC, PLLXTPRE, PLLMUL[3:0] and USBPRE bits */
RCC->CFGR &= (uint32_t)0xFF80FFFF;
/*!< Disable all interrupts */
RCC->CIR = 0x00000000;
/*!< Configure the System clock frequency, HCLK, PCLK2 and PCLK1 prescalers */
/*!< Configure the Flash Latency cycles and enable prefetch buffer */
//SetSysClock(); //我屏蔽了这句晶振脚就有波形了,奇怪,但LED还是没亮
}大侠能否帮我看下原因,下面是LED的程序看是否正确,
int main(void)
{
u32 cnt = 0x000fffff;
/* System Clocks Configuration */
RCC_Configuration();
/* Configure the GPIO ports */
GPIO_Configuration();
led_status = LED1;
while (1){
switch (led_status){
case LED1:
//GPIOB->BSRR = 0x1000E000; /* turn on LD1 */
GPIOA->BSRR = 0x00000002; //PA1,输出高电平LED就亮,低电平就灭
led_status = LED2;
break;
case LED2:
//GPIOB->BSRR = 0x2000D000; /* turn on LD2 */
GPIOA->BSRR = 0x20000000;
led_status = LED3;
break;
case LED3:
//GPIOB->BSRR = 0x4000B000; /* turn on LD3 */
GPIOA->BSRR = 0x00000002;
led_status = LED4;
break;
case LED4:
//GPIOB->BSRR = 0x80007000; /* turn on LD4 */
GPIOA->BSRR = 0x20000000;
led_status = LED1;
break;
}
while(cnt--);
cnt = 0x000fffff;
}
}
void RCC_Configuration(void)
{
/* Setup the microcontroller system. Initialize the Embedded Flash Interface,
initialize the PLL and update the SystemFrequency variable. */
SystemInit();
/* GPIOA clock enable */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);
}
void GPIO_Configuration(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
/* GPIOB configuration: PB12 PB13 PB14 PB15 as led controller */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12|GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_Init(GPIOB, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;//GPIO_Mode_Out_PP,GPIO_Mode_Out_OD
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_Init(GPIOC, &GPIO_InitStructure);
}
赞
0
评论
回复
支持
反对
废鱼
回答时间:2011-10-7 09:28:12
a0a.1 0b0c
RE:现有项目求大侠指点!有偿帮助!谢谢
SetSysClock();不能屏蔽,100最大是24Mhz,你把下面这句放开。不要定义为72Mhz。
SYSCLK_FREQ_24MHz
赞
0
评论
回复
支持
反对
k10k10k10-19309
回答时间:2011-10-7 10:10:32
a0a.1 0b0c
RE:现有项目求大侠指点!有偿帮助!谢谢
建议把整个工程打包发上来!
赞
0
评论
回复
支持
反对
yonglai888
回答时间:2011-10-7 11:22:44
a0a.1 0b0c
RE:现有项目求大侠指点!有偿帮助!谢谢
SetSysClock();屏蔽了这个反而有波形,这是什么原因呢?,如果用的是内部的HSI,晶振脚上也有输波形吗?
赞
0
评论
回复
支持
反对
废鱼
回答时间:2011-10-7 11:43:32
a0a.1 0b0c
RE:现有项目求大侠指点!有偿帮助!谢谢
如果使用内部晶振,外部不供电,是没有波形显示的。
赞
0
评论
回复
支持
反对
所属标签
相似问题
关于
意法半导体
我们是谁
投资者关系
意法半导体可持续发展举措
创新与技术
意法半导体官网
联系我们
联系ST分支机构
寻找销售人员和分销渠道
社区
媒体中心
活动与培训
隐私策略
隐私策略
Cookies管理
行使您的权利
官方最新发布
STM32N6 AI生态系统
STM32MCU,MPU高性能GUI
ST ACEPACK电源模块
意法半导体生物传感器
STM32Cube扩展软件包
关注我们
微信公众号
手机版
快速回复
返回顶部
返回列表
RE:现有项目求大侠指点!有偿帮助!谢谢
2、外部晶振要用8Mhz的。
3、你可以选择内部时钟作为时钟源,看看能不能工作。
RE:现有项目求大侠指点!有偿帮助!谢谢
外部用的是8M的,如果工作会有什么现象?
RE:现有项目求大侠指点!有偿帮助!谢谢
RE:现有项目求大侠指点!有偿帮助!谢谢
{
/*!< RCC system reset(for debug purpose) */
/*!< Set HSION bit */
RCC->CR |= (uint32_t)0x00000001;
/*!< Reset SW[1:0], HPRE[3:0], PPRE1[2:0], PPRE2[2:0], ADCPRE[1:0] and MCO[2:0] bits */
RCC->CFGR &= (uint32_t)0xF8FF0000;
/*!< Reset HSEON, CSSON and PLLON bits */
RCC->CR &= (uint32_t)0xFEF6FFFF;
/*!< Reset HSEBYP bit */
RCC->CR &= (uint32_t)0xFFFBFFFF;
/*!< Reset PLLSRC, PLLXTPRE, PLLMUL[3:0] and USBPRE bits */
RCC->CFGR &= (uint32_t)0xFF80FFFF;
/*!< Disable all interrupts */
RCC->CIR = 0x00000000;
/*!< Configure the System clock frequency, HCLK, PCLK2 and PCLK1 prescalers */
/*!< Configure the Flash Latency cycles and enable prefetch buffer */
//SetSysClock(); //我屏蔽了这句晶振脚就有波形了,奇怪,但LED还是没亮
}大侠能否帮我看下原因,下面是LED的程序看是否正确,
int main(void)
{
u32 cnt = 0x000fffff;
/* System Clocks Configuration */
RCC_Configuration();
/* Configure the GPIO ports */
GPIO_Configuration();
led_status = LED1;
while (1){
switch (led_status){
case LED1:
//GPIOB->BSRR = 0x1000E000; /* turn on LD1 */
GPIOA->BSRR = 0x00000002; //PA1,输出高电平LED就亮,低电平就灭
led_status = LED2;
break;
case LED2:
//GPIOB->BSRR = 0x2000D000; /* turn on LD2 */
GPIOA->BSRR = 0x20000000;
led_status = LED3;
break;
case LED3:
//GPIOB->BSRR = 0x4000B000; /* turn on LD3 */
GPIOA->BSRR = 0x00000002;
led_status = LED4;
break;
case LED4:
//GPIOB->BSRR = 0x80007000; /* turn on LD4 */
GPIOA->BSRR = 0x20000000;
led_status = LED1;
break;
}
while(cnt--);
cnt = 0x000fffff;
}
}
void RCC_Configuration(void)
{
/* Setup the microcontroller system. Initialize the Embedded Flash Interface,
initialize the PLL and update the SystemFrequency variable. */
SystemInit();
/* GPIOA clock enable */
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOA, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOB, ENABLE);
RCC_APB2PeriphClockCmd(RCC_APB2Periph_GPIOC, ENABLE);
}
void GPIO_Configuration(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
/* GPIOB configuration: PB12 PB13 PB14 PB15 as led controller */
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12|GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_Init(GPIOB, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_1;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;//GPIO_Mode_Out_PP,GPIO_Mode_Out_OD
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_Init(GPIOA, &GPIO_InitStructure);
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_0|GPIO_Pin_1|GPIO_Pin_2|GPIO_Pin_3;
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_IN_FLOATING;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_2MHz;
GPIO_Init(GPIOC, &GPIO_InitStructure);
}
RE:现有项目求大侠指点!有偿帮助!谢谢
SYSCLK_FREQ_24MHz
RE:现有项目求大侠指点!有偿帮助!谢谢
RE:现有项目求大侠指点!有偿帮助!谢谢
RE:现有项目求大侠指点!有偿帮助!谢谢