/*****************pms150g电笔**********************/
/*****************qq:774145445*********************/
/*****************ID:共同学习stm8******************/
/*****************ide:0.98A4_20230708**************/
/**************************************************/
// pms150g
// ______ ______
// 5v-|1-vdd \_/ gnd-8|-gnd ________
// led_g-|2-pa7 pa0-7|-jiance--|__10M___|----| ________
// led_r-|3-pa6 pa4-6|-bijiao--|__15M___|----|---|__4.7M__|--------220v
// gnd-|4-pa5_____pa3-5|-feng----|__10R___|--------------------------蜂鸣器
#include "extern.h"
led_g bit pa.7;
led_r bit pa.6;
feng bit pa.3;
jiance bit pa.0;
bijiao bit pa.4;
void chushihua(); //初始化
void shanshuo1(); //慢闪绿灯+蜂鸣器
void shanshuo2(); //快闪红灯+蜂鸣器
void jiance_gao(); //高电位检测3伏
void jiance_di(); //低电位检测0.5伏
/**************************************************/
void FPPA0 (void)
{
//.ADJUST_IC SYSCLK=IHRC/16 // SYSCLK=1M
//.ADJUST_IC SYSCLK=ILRC;
.ADJUST_IC DISABLE; // No adjust IHRCR, WatchDog Enable
clkmd =0xf4; //系统时钟ilrc
clkmd.4 =0; //关闭ihrc
chushihua();
|