您好,欢迎光临!   请登录 免费注册    
  您的位置:电子变压器资讯网 > 资讯中心 >  技术文章 > 正文
PSoC3的低电压中断及其实现
[发布时间]:2012年2月24日 [来源]:电子系统设计 [点击率]:5282
【导读】: 1 低电压监测概述 Cypress PSoC3使用基于单循环流水线的高性能8051内核 (67MHz33MIPS),提供业界广泛采用的5.5V至0.5V电压范围和低至200nA的休眠电流,可以满足...

while((* (reg8 *) CYREG_RESET_SR0) != 0);

// 6.) set the voltage monitor trip thresholds

// under "voltage monitors". 0x66 is 3.2 v, 0x55 is 2.95v

// RESET_CR0 (high nibble is LVI-A threshold, low nibble is LVI-D threshold)

(* (reg8 *) CYREG_RESET_CR0) = 0x55;

// 7.) select the Fixed Function Path for interrupt vector 0 (LVD-A/D interrupt)

(* (reg8 *) CYREG_IDMUX_IRQ_CTL0) &= ~0x03;

// 8.) register the previously defined ISR address in the interrupt vector table for vector 0

// blarf is a made up name to show how the process works

CY_SET_REG16(CYDEV_INTC_VECT_MBASE + 2*0, blarf);

// 9.) we can change the default priority setting if we desire.

(* (reg8 *) CYREG_INTC_PRIOR0) = 0x07 << 5;

// 10.) enable the interrupt (vector 0)

(* (reg8 *) CYREG_INTC_SET_EN0) |= 0x01;

// 11.) enable global interrupts

CYGlobalIntEnable;

while(1)

{

// Test is a pin connected to an LED

Test_Write(0);

}

}

经测试,该程序工作正常,当电源电压下降到指定阀值后将产生中断并运行中断服务子程序,即LED灯点亮。

作者: 田江学 主任应用工程师 赛普锐思半导体(上海)有限公司

[上一页] [1] [2] [3] [下一页]
投稿箱:
   电子变压器、电感器、磁性材料等磁电元件相关的行业、企业新闻稿件需要发表,或进行资讯合作,欢迎联系本网编辑部QQ: , 邮箱:info%ett-cn.com (%替换成@)。
第一时间获取电子变压器行业资讯,请在微信公众账号中搜索“电子变压器资讯”或者“dzbyqzx”,或用手机扫描左方二维码,即可获得电子变压器资讯网每日精华内容推送和最优搜索体验,并参与活动!
温馨提示:回复“1”获取最新资讯。