打印
[STM8]

STM8AF6226 Pin/RST持续输出7Khz方波,程序不受控

[复制链接]
763|22
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
huangchui|  楼主 | 2021-5-9 22:16 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
1.STM8AF6226用STVP擦空后RST Pin一直未高电平;
2.但是用IAR编译以下程序后,程序一直没有运行,最简单的程序,连配置个GPIO反转都无法实现

使用特权

评论回复
沙发
llljh| | 2021-5-9 22:18 | 只看该作者
用STVP下载

使用特权

评论回复
板凳
huangchui|  楼主 | 2021-5-9 22:20 | 只看该作者
下载过,现象一样!

使用特权

评论回复
地板
dengdc| | 2021-5-9 22:22 | 只看该作者
程序没有配置对

使用特权

评论回复
5
xxrs| | 2021-5-9 22:25 | 只看该作者
芯片没有复位

使用特权

评论回复
6
yszong| | 2021-5-9 22:26 | 只看该作者
嗯,压根就没有进入到Main函数

使用特权

评论回复
7
huangchui|  楼主 | 2021-5-9 22:28 | 只看该作者
但是通过通断VCC电源的办法,用示波器探头钩住RST Pin测量,大部分时间是RST Pin一直输出一个7Khz左右的方波信号,也会出现几次高电平的情况。

使用特权

评论回复
8
huangchui|  楼主 | 2021-5-9 22:34 | 只看该作者
但是当出现高电平的时候,去测量已经配置的PB0,PB1 电平,依然是长期为低电平

使用特权

评论回复
9
wuhany| | 2021-5-9 22:36 | 只看该作者
没有按程序跑动

使用特权

评论回复
10
huangchui|  楼主 | 2021-5-9 22:39 | 只看该作者
最小系统,把板子上面的其他电路都拿掉了,直接3.3V供电,VCAP有放电容,复位是0.1uF,10K电阻。

/**
  ******************************************************************************
  * @file    Project/main.c
  * @author  MCD Application Team
  * @version V2.2.0
  * @date    30-September-2014
  * @brief   Main program body
   ******************************************************************************
  * @attention
  *
  * <h2><center>© COPYRIGHT 2014 STMicroelectronics</center></h2>
  *
  * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License");
  * You may not use this file except in compliance with the License.
  * You may obtain a copy of the License at:
  *
  *        http://www.st.com/software_license_agreement_liberty_v2
  *
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  *
  ******************************************************************************
  */


/* Includes ------------------------------------------------------------------*/
#include "stm8s.h"

/* Private defines -----------------------------------------------------------*/
/* Private function prototypes -----------------------------------------------*/
/* Private functions ---------------------------------------------------------*/
#define LED_GPIO_PORT  (GPIOB)
#define LED_GPIO_PINS  (GPIO_PIN_0 | GPIO_PIN_1 )


void Delay(uint16_t nCount)
{
  /* Decrement nCount value */
  while (nCount != 0)
  {
    nCount--;
  }
  
  
}



void main(void)
{

  /* Initialize I/Os in Output Mode */
  GPIO_Init(LED_GPIO_PORT, (GPIO_Pin_TypeDef)LED_GPIO_PINS, GPIO_MODE_OUT_PP_LOW_FAST);

  while (1)
  {
    /* Toggles LEDs */
    GPIO_WriteReverse(LED_GPIO_PORT, (GPIO_Pin_TypeDef)LED_GPIO_PINS);
    Delay(0xFFFF);
  }
  
}

#ifdef USE_FULL_ASSERT

/**
  * @brief  Reports the name of the source file and the source line number
  *   where the assert_param error has occurred.
  * @param file: pointer to the source file name
  * @param line: assert_param error line source number
  * @retval : None
  */
void assert_failed(u8* file, u32 line)
{
  /* User can add his own implementation to report the file name and line number,
     ex: printf("Wrong parameters value: file %s on line %d\r\n", file, line) */

  /* Infinite loop */
  while (1)
  {
  }
}
#endif


/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

使用特权

评论回复
11
午夜粪车| | 2021-5-9 22:41 | 只看该作者
建议用STVP讲默认的optionbyte 重新烧一遍试试看。

使用特权

评论回复
12
chuxh| | 2021-5-9 22:44 | 只看该作者
另外VCAP电容要保证1uf以上

使用特权

评论回复
13
huangchui|  楼主 | 2021-5-9 22:48 | 只看该作者
新建STM8AF6226  STVP工程的optionbyte 是全0; 烧录了,现象一样;

使用特权

评论回复
14
llljh| | 2021-5-9 22:50 | 只看该作者
VCAP并了3个1UF的电容,现象依然一样;

使用特权

评论回复
15
renyaq| | 2021-5-9 22:53 | 只看该作者
RST输出方波信号?不应该是输入端口么

使用特权

评论回复
16
huangchui|  楼主 | 2021-5-9 22:55 | 只看该作者
对,一直是方波,不管拿掉有没有拿掉外围的0.1uF电容和10K电阻。。。。。

使用特权

评论回复
17
huangchui|  楼主 | 2021-5-9 22:55 | 只看该作者
对,一直是方波,不管拿掉有没有拿掉WW的0.1uF电容和10K电阻。。。。。

使用特权

评论回复
18
huangchui|  楼主 | 2021-5-9 23:01 | 只看该作者

唉,还是没有什么结果,算了,多谢大家啦

使用特权

评论回复
19
renzheshengui| | 2021-6-3 10:20 | 只看该作者
能读到擦完之后都是什么内容吗

使用特权

评论回复
20
wakayi| | 2021-6-3 10:22 | 只看该作者
方波的占空比发生变化吗

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

918

主题

12323

帖子

4

粉丝