完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
嗨,
我需要你的帮助才能找出问题的根本原因, 请帮助检查问题,感谢您的支持, 谢谢。 问题, 在尝试启动新板时,我们无法控制任何与LED相关的端口。 芯片是STM8L051F3,与STVP,IAR嵌入式工作台IDE-stm8一起使用 我可以下载hex文件,但症状似乎是CPU根本没有响应..... 请参考我的代码,我使用了STM8L15x_StdPeriph_Driver SDK, void main(void) { char ans; / *高速内部时钟预分频器:1 * / CLK_SYSCLKDivConfig(CLK_SYSCLKDiv_1); GPIO_Init(LED_R_GPIO_PORT,LED_R_GPIO_PINS,GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(LED_B_GPIO_PORT,LED_B_GPIO_PINS,GPIO_Mode_Out_PP_Low_Slow); while(1) { / *切换LED_R LED_B * / GPIO_ToggleBits(LED_R_GPIO_PORT,LED_R_GPIO_PINS); // void GPIO_ToggleBits(GPIO_TypeDef * GPIOx,uint8_t GPIO_Pin) 延迟(100); GPIO_ToggleBits(LED_B_GPIO_PORT,LED_B_GPIO_PINS); 我按如下方式设置了IAR的环境, 选项 - > c / c ++编译器 - >预处理器 在“已定义的符号”项中,添加2选项, USE_STM8L1526_EVAL STM8L05X_LD_VL请帮忙告诉我它是什么问题,如果有必要,我可以上传电路, 感谢您的关注, 谢谢。 #stm8l051f3 以上来自于谷歌翻译 以下为原文 Hi, I need your help to find out the root cause of my issue, please help to check the issue, thankful for your support in advance, thanks. issue, when trying to do bring-up new board, we can't control any port related with LED. Chip is STM8L051F3, used with STVP, IAR embedded workbench IDE - stm8 I can download hex file, but the symptom seems to be that CPU is no responsive, at all..... please refer my code, I used STM8L15x_StdPeriph_Driver SDK, void main(void) { char ans; /*High speed internal clock prescaler: 1*/ CLK_SYSCLKDivConfig(CLK_SYSCLKDiv_1); GPIO_Init(LED_R_GPIO_PORT, LED_R_GPIO_PINS, GPIO_Mode_Out_PP_Low_Slow); GPIO_Init(LED_B_GPIO_PORT, LED_B_GPIO_PINS, GPIO_Mode_Out_PP_Low_Slow);while (1) { /* Toggle LED_R LED_B */ GPIO_ToggleBits(LED_R_GPIO_PORT, LED_R_GPIO_PINS);//void GPIO_ToggleBits(GPIO_TypeDef* GPIOx, uint8_t GPIO_Pin) Delay(100); GPIO_ToggleBits(LED_B_GPIO_PORT, LED_B_GPIO_PINS); }and I set up the environment of IAR as follows, Option -> c/c++ Compiler -> Preprocessor In Defined symbols item, add 2 option, USE_STM8L1526_EVAL STM8L05X_LD_VLplease help to let me know what it is problem, if necessary, I can upload the circuit, thankful for your concern in advance, thanks. #stm8l051f3 |
|
相关推荐
7个回答
|
|
你好,
您的定义背后是什么:LED_R_GPIO_PORT,LED_R_GPIO_PINS,LED_G_GPIO_PORT,LED_G_GPIO_PINS。 您使用的是内部默认时钟还是某些外部晶振。 我可以请你使用可见电源引脚,NRST,SWIM连接器来查看原理图的一部分吗? 先谢谢你 最好的祝福, 阿图尔 以上来自于谷歌翻译 以下为原文 Hello, What is behind your definitions: LED_R_GPIO_PORT, LED_R_GPIO_PINS,LED_G_GPIO_PORT, LED_G_GPIO_PINS. Are you using internal default clock or some external crystal. May I ask you for a part of the schematics with visible power pins, NRST, SWIM connector, please? Thank you in advance Best Regards, Artur |
|
|
|
“
但症状似乎是CPU根本没有响应...... 你能检查代码打算改变的端口寄存器吗?他们按预期改变价值吗? 以上来自于谷歌翻译 以下为原文 ' but the symptom seems to be that CPU is no responsive, at all.....' can you inspect the port registers your code intend to change? do they change value as expected? |
|
|
|
,
, 你好,阿图尔, 感谢您的关注, 我更新了原理图,并对您的问题进行了更多描述,请参考并告诉我您的指南, ♯定义LED_R_GPIO_PORT GPIOC , ♯defineLED_R_GPIO_PINSGPIO_Pin_0♯defineLED_B_GPIO_PORT GPIOC , ♯defineLED_B_GPIO_PINS GPIO_Pin_1我正在使用内部时钟并试图从2 Mhz更改为16 Mhz ...使用以下代码, 但在所有情况下我都看不到LED灯,LED的输出电压为零.... 对于2 Mhz情况(默认情况), CLK_SYSCLKDivConfig(CLK_SYSCLKDiv_1) 对于16 Mhz的情况, // CLK_SYSCLKSourceSwitchCmd(ENABLE), , //, // CLK_SYSCLKSourceConfig(CLK_SYSCLKSource_HSI),,, //, // CLK_SYSCLKDivConfig(CLK_SYSCLKDiv_1),,, //, // while(CLK_GetSYSCLKSource()!= CLK_SYSCLKSource_HSI), // {}谢谢。 以上来自于谷歌翻译 以下为原文 , , Hello, Artur, , Thankful for your concern, , I update the schematic, and more description for your questions, please refer it and give me your guide, ♯ define LED_R_GPIO_PORT GPIOC , ♯ define LED_R_GPIO_PINS GPIO_Pin_0 ♯ define LED_B_GPIO_PORT GPIOC , ♯ define LED_B_GPIO_PINS GPIO_Pin_1I am using internal clock and tried to change from 2 Mhz to 16 Mhz...with the following code, But I can't see LED light in all case, the output voltage of LEDs is zero.... For 2 Mhz case(default case), CLK_SYSCLKDivConfig(CLK_SYSCLKDiv_1), For 16 Mhz case, , // CLK_SYSCLKSourceSwitchCmd(ENABLE), , // , // CLK_SYSCLKSourceConfig(CLK_SYSCLKSource_HSI), , // , // CLK_SYSCLKDivConfig(CLK_SYSCLKDiv_1), , // , // while (CLK_GetSYSCLKSource() != CLK_SYSCLKSource_HSI) , // {}thanks. |
|
|
|
你好,
问题与PC0和PC1是真漏开的事实有关(输出配置中没有内部上拉电阻或高端晶体管)。要使其工作,您需要添加外部电阻。 有关详细信息,请查看数据表到引脚规范。 最好的祝福, 阿图尔 以上来自于谷歌翻译 以下为原文 Hello, The problem is related to the fact that PC0 and PC1 are true open drain (no internal pull-up nor high side transistor in output configuration). To make it working you need to add external resistors. Please have a look at datasheet into pins specification for more information. Best Regards, Artur |
|
|
|
你好,
今天我取得了一些进展,目前我们可以通过IAR(下载和调试功能)下载二进制映像, 但我不能用STVP下载相同的图像,它在编程步骤中显示红色条... 也许它似乎失败了所以在那之后,我可以看到相同的症状,为什么?这是第一个问题, 其次,我需要使用3个定时器,我知道stm8l01F3芯片有3个定时器,如2/3/4定时器, 和2/3定时器有16位计数器,4个定时器只有8位计数器, 所以我使用了3个定时器用于PWM(250 Khz),4个定时器用于1ms周期,然后我试图用5个定时器制作5个定时器, 但也许它无法实现,因为TIM2CLK只有8.192 KHz,因为它与LSE映射.......(32.768 Khz振荡器)..是不是? 如果是这样,我无法用这个芯片实现我想要的东西....请帮助告诉我我的信息是否正确,如果有其他解决方案,请通过示例帮助我。 最后(第三),至于Beep功能,我想知道以下代码对于蜂鸣器的使用是否正确, 我想知道用软或硬件增加音量的方法.....请帮帮我... 代码)代码可以发出蜂鸣声...... CFG-> GCR | = CFG_GCR_SWD; / *禁用SWIM接口* / CLK_PeripheralClockConfig(CLK_Peripheral_BEEP,ENABLE); CLK_BEEPClockConfig(CLK_BEEPCLKSource_LSI); BEEP_Init(BEEP_Frequency_2KHz);感谢你的支持, 谢谢。 以上来自于谷歌翻译 以下为原文 Hello, today I got some progress, currently we can download binary image with IAR(Download and Debug function), but I can't download the same image with STVP, it shows the red bar in programming step..... maybe it seems to be failed so after that, I can see the same symptom, why ? this is first question, secondly, I need to use 3 timer, I know that stm8l01F3 chip has 3 timers like 2/3/4 timers, and 2/3 timers have 16 bit counter, and 4 timer has only 8 bit counter, so I used 3 timer for PWM (250 Khz), and 4 timer for 1ms period, and then I am trying to make 5 us period with 2 timer, but maybe it can't be implemented because TIM2CLK is only 8.192 KHz owing to it is mapped with LSE.....(32.768 Khz oscillator).. is it right ? if so, I can't implement what I want with this chip.... Please help to let me know whether my information is correct or not,and if having another solution, please help me by giving it with example. finally(thirdly), as to Beep function, I wonder whether the following code is correct or not for the usage of beeper, and I would like to know the method to increase volume with soft or HW.....please help me... Code) the code can make the sound of beep currently.... CFG->GCR |= CFG_GCR_SWD; /*disable SWIM interface*/ CLK_PeripheralClockConfig(CLK_Peripheral_BEEP, ENABLE); CLK_BEEPClockConfig(CLK_BEEPCLKSource_LSI); BEEP_Init(BEEP_Frequency_2KHz);thankful for your support in advance, thanks. |
|
|
|
嗨,阿图尔,
能否请您帮助我查看我在下面更新的问题? 感谢您提前的善意, 谢谢。 以上来自于谷歌翻译 以下为原文 Hi, Artur, Could you please kindly help to review my issue that I updated below ? Thankful for your kindness in advance, thanks. |
|
|
|
嗨,Dhenry,
我找到了解决问题的方法, 首先,错误选择与LED相关的gpio引脚,我们改变了它, 其次,我们找到了另一种解决方案,使用与SWIM相同的端口使用蜂鸣功能.... 第三,关于计时器的优先级设置,我找不到设置优先级的方法, 但是当我尝试做一些我希望直接在中断服务程序中执行的操作时, 我可以正常控制gpio,....所以问题解决了, 但目前,我无法正常下载STVP图像,我们不知道原因, 能帮助我们知道原因吗? 我们担心我们的电路是否有问题,....需要你的帮助才能查看, 感谢你的支持, 谢谢,。 以上来自于谷歌翻译 以下为原文 Hi, Dhenry, I found something to solve issues, firstly, the gpio pins related with LED is wrongly selected, we changed it, secondly, we found another solution to use beep function with the same port as SWIM.... thirdly, as to priority setting of timer, I can't find the method to set up the priority, but when trying to do something that I hope to do in interrupt service routine function directly, I can control the gpio normally,....so the issue is solved, but currently, I can't normally download image with STVP, we don't know the reason, Could you please kindly help us to know the reason ? We worry whether our circuit is problem or not,....need your help to review it, thankful for your support in advance, thanks,. |
|
|
|
只有小组成员才能发言,加入小组>>
请教:在使用UDE STK时,单片机使用SPC560D30L1,在配置文件怎么设置或选择?里面只有SPC560D40的选项
2567 浏览 1 评论
3191 浏览 1 评论
请问是否有通过UART连接的两个微处理器之间实现双向值交换的方法?
1761 浏览 1 评论
3586 浏览 6 评论
5962 浏览 21 评论
920浏览 4评论
1296浏览 4评论
在Linux上安装Atollic TRUEStudio的步骤有哪些呢?
560浏览 3评论
使用DMA激活某些外设会以导致外设无法工作的方式生成代码是怎么回事
1284浏览 3评论
1334浏览 3评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-3 03:48 , Processed in 1.261827 second(s), Total 59, Slave 52 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号