
STM8S003无法检测到引脚电平
STM8 @svlreg 问题
STM8AF62XX+L99PM62GXP LIN通讯的电路原理图有吗?官网提供了一套软件,没找到对应的原理图,请大家指教一下
求一个STM8S207例程
初次接触STM8,请问在STVD中,为什么这个Struct会报错
STMS005K6T6 如何采集内部参考电压。
stm8s003 adc中断和通道切换的问题
adc施密特触发器stm8
stm8l051f3 TSSOP20 封装,待机模式下,2天后,电流突然增加到140UA
STM8S用STVP烧录怎么加密?
没有复位脚
评分
查看全部评分
1.檢查板子上的電源是否正常。
2.再確認SWIM的腳PIN有無接錯。
3.重新Power Off 再 Power On板子上的電源。
4.ST Link重PC上先拔除再連接。
以上, FYI。
/* MAIN.C file */
#include "stm8l10x.h"
#include "stm8l101_eval.h"
#include "stm8l10x_gpio.h"
#ifdef _COSMIC_
#define ASM _asm
#endif
#ifdef _IAR_
#define ASM asm
#endif
/* This delay should be added just after reset to have access to SWIM pin
and to be able to reprogram the device after power on (otherwise the
device will be locked) */
#define STARTUP_SWIM_DELAY_5S \
{ \
ASM(" PUSHW X \n" \
" PUSH A \n" \
" LDW X, #0xFFFF \n" \
"loop1: LD A, #50 \n" \
\
"loop2: DEC A \n" \
" JRNE loop2 \n" \
\
" DECW X \n" \
" JRNE loop1 \n" \
\
" POP A \n" \
" POPW X " );\
}
/* not connected pins as output low state (the best EMC immunity)
(PA1, PA3, PA5, PB0, PB1, PB2, PB4, PC5, PC6, PD1, PD2, PD3, PD4, PD5,
PD6, PD7)*/
#define CONFIG_UNUSED_PINS_STM8L001 \
{ \
GPIOA->DDR |= GPIO_Pin_1 | GPIO_Pin_3 | GPIO_Pin_5; \
GPIOB->DDR |= GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_4; \
GPIOC->DDR |= GPIO_Pin_5 | GPIO_Pin_6; \
GPIOD->DDR |= GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | \
GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7; \
}
/* not connected pins as output low state (the best EMC immunity)
(PA1, PA3, PA5, PB0, PB1, PB2, PB4, PC5, PC6, PD1, PD2, PD3, PD4, PD5,
PD6, PD7)*/
#define CONFIG_UNUSED_PINS_STM8L001 \
{ \
GPIOA->DDR |= GPIO_Pin_1 | GPIO_Pin_3 | GPIO_Pin_5; \
GPIOB->DDR |= GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_4; \
GPIOC->DDR |= GPIO_Pin_5 | GPIO_Pin_6; \
GPIOD->DDR |= GPIO_Pin_1 | GPIO_Pin_2 | GPIO_Pin_3 | GPIO_Pin_4 | \
GPIO_Pin_5 | GPIO_Pin_6 | GPIO_Pin_7; \
}
main()
{
/* -------------STM8L001 startup-------------- */
/* configure unbonded pins */
CONFIG_UNUSED_PINS_STM8L001;
/* delay for SWIM connection: ~5seconds */
STARTUP_SWIM_DELAY_5S;
/* ------------------------------------------- */
/* configure all STM8L001 pins as input with pull up */
GPIO_Init(GPIOA, GPIO_Pin_0, GPIO_Mode_In_PU_No_IT); // pin 1
GPIO_Init(GPIOA, GPIO_Pin_2, GPIO_Mode_In_PU_No_IT); // pin 2
GPIO_Init(GPIOD, GPIO_Pin_0, GPIO_Mode_In_PU_No_IT); // pin 5
GPIO_Init(GPIOB, GPIO_Pin_6, GPIO_Mode_In_PU_No_IT); // pin 6
GPIO_Init(GPIOB, GPIO_Pin_7, GPIO_Mode_In_PU_No_IT); // pin 7
GPIO_Init(GPIOC, GPIO_Pin_2, GPIO_Mode_In_PU_No_IT); // pin 8
}