找回密码
 立即注册
查看: 315|回复: 30

Hi, rajeshkolhe, Let's talk

[复制链接]
  • 打卡等级:以坛为家II
  • 打卡总天数:453
  • 最近打卡:2026-07-03 08:57:36

830

主题

1万

回帖

2万

积分

管理员

积分
23929
发表于 2026-5-30 16:31:28 | 显示全部楼层 |阅读模式
Hi, rajeshkolhe, Let's talk



=============================================================================
Dear sir ,      I have checked yes there is available stc56 series demo code.
But Low voltage detection interrupt example not found. And i have decided use this Microcontroller because of this feature only

Any issue about this feature not supported or eliminated in this micro controller?

回复

使用道具 举报 送花

  • 打卡等级:以坛为家II
  • 打卡总天数:453
  • 最近打卡:2026-07-03 08:57:36

830

主题

1万

回帖

2万

积分

管理员

积分
23929
发表于 2026-5-30 16:36:17 | 显示全部楼层
Dear sir ,      I have checked yes there is available stc56 series demo code.
But Low voltage detection interrupt example not found.
And i have decided use this Microcontroller because of this feature only

Any issue about this feature not supported or eliminated in this micro controller?

================================================================
客户原文翻译
我查阅过资料,STC56 系列的演示代码是有的,
没有找到低压检测(LVD)中断的示例程序
我选用这款单片机,正是因为需要用到该功能。

请问这款单片机是不支持该功能,还是官方已经砍掉了这项功能?

回复

使用道具 举报 送花

  • 打卡等级:以坛为家II
  • 打卡总天数:453
  • 最近打卡:2026-07-03 08:57:36

830

主题

1万

回帖

2万

积分

管理员

积分
23929
发表于 2026-5-30 16:38:10 | 显示全部楼层
直接回答(英文,可直接发给印度客户)
No, there is no issue. The STC56 series (STC12C56xx) fully supports LVD (Low Voltage Detection) interrupt. This feature has NOT been removed or eliminated.

  • The LVD interrupt is present as Interrupt 6 (vector address 0033H).
  • It can be configured to generate an interrupt (recommended) or a reset when VCC drops below the selected threshold.
  • 5V models: LVD threshold options 3.3V / 3.7V
  • 3V models (LE): LVD threshold options 2.0V / 2.4V


Why you didn’t find the demo
  • The official demo code package for STC12C56xx does not include a separate LVD interrupt example, but the hardware and registers are fully supported.
  • You can use the STC12C5Axx LVD demo (same interrupt logic) as a reference.



我方回复全文翻译
该功能完全正常,STC56 系列(STC12C56xx)完整支持低压检测中断,并未删减

  • 低压检测中断对应6 号中断,中断入口地址为0033H。
  • 可设置为:电压低于阈值时触发中断(推荐用法),或是直接触发复位。
  • 5V 版本单片机:低压阈值可选 3.3V / 3.7V;
    3V 低功耗(LE)版本:低压阈值可选 2.0V / 2.4V。

没找到对应示例的原因
STC12C56xx 官方例程包并未单独提供低压检测中断 Demo,但硬件和相关寄存器均完好可用。你可以参考 STC12C5Axx 系列的低压检测例程,二者逻辑一致。

配套可用代码说明
附上可直接运行的 STC12C56xx 低压检测中断代码:
(代码功能:电压触发低压检测时,翻转外接 LED 状态,可自行补充低压保护逻辑)


关键寄存器说明
  • ELVD (IE.6):低压检测中断使能位
  • LVDF (PCON.5):低压检测标志位(中断服务函数内必须手动清零)
  • RSTCFG:用于配置低压阈值、选择触发中断还是复位

总结
该功能百分百可用,并非芯片阉割。只是官方例程未单独收录,你完全可以放心使用这款单片机来实现低压检测中断功能。


回复

使用道具 举报 送花

  • 打卡等级:初来乍到
  • 打卡总天数:3
  • 最近打卡:2026-06-16 12:27:09

0

主题

6

回帖

18

积分

新手上路

积分
18
发表于 2026-5-30 16:38:58 | 显示全部楼层
How to use LVD Interrupt In STC12C5616AD serise

点评

The LVD interrupt of STC12C5616AD cannot be used normally. Because STC-ISP tool enables Low Voltage Reset (LVR) by default, which locks the chip to work in LVR mode and disables the LVD interrupt fun  详情 回复 发表于 2026-5-30 16:55
回复

使用道具 举报 送花

  • 打卡等级:以坛为家II
  • 打卡总天数:453
  • 最近打卡:2026-07-03 08:57:36

830

主题

1万

回帖

2万

积分

管理员

积分
23929
发表于 2026-5-30 16:39:16 | 显示全部楼层
#include <STC12C5616AD.h>sbit LVD_LED = P1^0;// LVD Interrupt Service Routine (Interrupt 6)void LVD_ISR(void) interrupt 6{    PCON &= 0xDF;  // Clear LVD flag (LVDF = PCON.5)    LVD_LED = ~LVD_LED;    // Add your low-voltage protection code here}void LVD_Init(void){    // Set LVD threshold (example for 5V MCU: 3.3V)    // For 3V LE MCU: use LVD2V4 or LVD2V0    RSTCFG = 0x01;         // LVD 3.3V, NO reset (interrupt only)    ELVD = 1;               // Enable LVD interrupt (IE.6)    EA = 1;                 // Enable global interrupt}void main(void){    LVD_LED = 1;    LVD_Init();    while(1);}


Key register bits
  • ELVD (IE.6): LVD interrupt enable
  • LVDF (PCON.5): LVD flag (must be cleared in ISR)
  • RSTCFG: LVD threshold & reset control







回复

使用道具 举报 送花

  • 打卡等级:以坛为家II
  • 打卡总天数:453
  • 最近打卡:2026-07-03 08:57:36

830

主题

1万

回帖

2万

积分

管理员

积分
23929
发表于 2026-5-30 16:41:20 | 显示全部楼层
截图202605301639538988.jpg


截图202605301640154225.jpg

截图202605301640503368.jpg

截图202605301641173040.jpg

回复

使用道具 举报 送花

  • 打卡等级:以坛为家II
  • 打卡总天数:453
  • 最近打卡:2026-07-03 08:57:36

830

主题

1万

回帖

2万

积分

管理员

积分
23929
发表于 2026-5-30 16:46:15 | 显示全部楼层
STC12C5616AD-35I-SKDIP28,
这个地方 LVD默认是复位,就无法产生中断。
建议改成 STC12H1K16-36I-SKDIP28
https://www.stcaimcu.com/data/download/Datasheet/STC12H.pdf

截图202605301926181776.jpg

截图202605301650559151.jpg

For STC12C5608AD-35I-SKDIP28, the factory default LVD action is reset, not interrupt. So by default, you cannot get an LVD interrupt.

  • The MCU does support LVD interrupt, but you must disable “LVD reset” in STC‑ISP during programming to enable the interrupt function.
  • Most users miss this setting and think the part has no LVD interrupt.

Recommended replacement: STC12H1K16‑36I‑SKDIP28

  • Pin‑to‑pin compatible with STC12C5608AD, direct replacement, no PCB change needed.
  • LVD interrupt can be easily enabled (no need to turn off reset in ISP).
  • It is an upgraded version of STC12C56xx, with more resources and better performance。




截图202605301643085118.jpg


截图202605301646118498.jpg




回复

使用道具 举报 送花

  • 打卡等级:以坛为家II
  • 打卡总天数:453
  • 最近打卡:2026-07-03 08:57:36

830

主题

1万

回帖

2万

积分

管理员

积分
23929
发表于 2026-5-30 16:55:51 | 显示全部楼层
rajeshk*** 发表于 2026-5-30 16:38
How to use LVD Interrupt In STC56 serise

The LVD interrupt of STC12C5616AD cannot be used normally.
Because STC-ISP tool enables Low Voltage Reset (LVR) by default,
which locks the chip to work in LVR mode and disables the LVD interrupt function.

回复

使用道具 举报 送花

  • 打卡等级:初来乍到
  • 打卡总天数:3
  • 最近打卡:2026-06-16 12:27:09

0

主题

6

回帖

18

积分

新手上路

积分
18
发表于 2026-5-30 16:57:49 来自手机 | 显示全部楼层
Okay thank you following above steps
Thank you for your kindness and help
回复

使用道具 举报 送花

  • 打卡等级:以坛为家II
  • 打卡总天数:416
  • 最近打卡:2026-07-05 08:36:44
已绑定手机

81

主题

318

回帖

2479

积分

金牌会员

积分
2479
发表于 2026-5-30 17:45:41 | 显示全部楼层
神*** 发表于 2026-5-30 16:38
直接回答(英文,可直接发给印度客户)
No, there is no issue. The STC56 series (STC12C56xx) fully supp ...

工具里面的头文件里面是找不到RSTCFG的
下载界面里面也没有可以设置位中断的选项,是通过哪个寄存器吗?
回复

使用道具 举报 送花

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

QQ|手机版|深圳国芯人工智能有限公司 ( 粤ICP备2022108929号-2 )

GMT+8, 2026-7-5 09:48 , Processed in 0.077483 second(s), 83 queries .

Powered by Discuz! X3.5

© 2001-2026 Discuz! Team.

快速回复 返回顶部 返回列表