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

[复制链接]
627|6
手机看帖
扫描二维码
随时随地手机跟帖
hzocce|  楼主 | 2019-6-26 17:11 | 显示全部楼层 |阅读模式
1.STM8AF6226用STVP擦空后RST Pin一直未高电平;
2.但是用IAR编译以下程序后,程序一直没有运行,最简单的程序,连配置个GPIO反转都无法实现;
  也用STVP下载过,现象一样!
    个人可理解为要么程序没有配置对,要么芯片没有复位,压根就没有进入到Main函数;
    但是通过通断VCC电源的办法,用示波器探头钩住RST Pin测量,大部分时间是RST Pin一直输出一个7Khz左右的方波信号,也会出现几次高电平的情况。
   但是当出现高电平的时候,去测量已经配置的PB0,PB1 电平,依然是长期为低电平,没有按程序跑动。
   按照stsw-stm8069改来。
3.最小系统,把板子上面的其他电路都拿掉了,直接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****/

使用特权

评论回复

相关帖子

airwill| | 2019-6-26 21:21 | 显示全部楼层
可能不是软件问题,  内部的硬件复位状态, 存储器故障状态等

使用特权

评论回复
hzocce|  楼主 | 2019-6-27 09:32 | 显示全部楼层
airwill 发表于 2019-6-26 21:21
可能不是软件问题,  内部的硬件复位状态, 存储器故障状态等

换了几个芯片了!现象依旧
而且是给的免费样品,

使用特权

评论回复
hzocce|  楼主 | 2019-6-27 09:33 | 显示全部楼层
airwill 发表于 2019-6-26 21:21
可能不是软件问题,  内部的硬件复位状态, 存储器故障状态等

换了几个芯片了!现象依旧
而且是给的免费样品,(不是淘宝买的)

使用特权

评论回复
ayb_ice| | 2019-6-27 14:47 | 显示全部楼层
估计程序都没有下进去

使用特权

评论回复
hzocce|  楼主 | 2019-6-28 14:42 | 显示全部楼层
ayb_ice 发表于 2019-6-27 14:47
估计程序都没有下进去

那用STVP删除后,RST电平状态就变了哎~~

同样一个STLINK 烧录其他的型号都正常哎~~

使用特权

评论回复
hzocce|  楼主 | 2019-7-3 08:22 | 显示全部楼层
求关注~~

使用特权

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

本版积分规则

127

主题

561

帖子

4

粉丝