【雅特力AT32WB415系列蓝牙BLE 5.0 MCU】红外检测
<div class='showpostmsg'> 本帖最后由 常见泽1 于 2022-9-1 15:05 编辑<p><span style="font-family:Times;"><span style="font-size:16px;">雅特力AT32WB415外部中断(EXINT)与NVIC直接连接, EXINT包含23个边沿检测器,用于产生中断请求。每个中断线都可以独立地配置它的触发事件(上升沿、下降沿、或双边沿),</span></span></p>
<p><span style="font-family:Times;"><span style="font-size:16px;">并能够单独地被屏蔽;挂起寄存器维持所有中断请求的状态。外部中断其中最多有16根可从GPIO中选择连接。</span></span></p>
<p> </p>
<p> </p>
<p><span style="font-family:Times;"><span style="font-size:16px;">人体感应模块</span></span></p>
<p><span style="font-family:Times;"><span style="font-size:16px;">在通过放大器是BISS0001将脉冲信号转化为更直观的高低电平输出,有人输出高,无人输出低。并在放大电路上设置电位器,调节输出信号的灵敏度,调节高电平持续时间。</span></span></p>
<p> </p>
<p><span style="font-family:Times;"><span style="font-size:16px;"> </span></span></p>
<p> </p>
<p><span style="font-family:Times;"><span style="font-size:16px;">模块接口只有三个脚,地、电源、数据线;分别计为GND、VCC、OUT</span></span></p>
<p><span style="font-family:Times;"><span style="font-size:16px;">探头检测到有人移动时,OUT=1;没人移动时,OUT=0;</span></span></p>
<p><span style="font-family:Times;"><span style="font-size:16px;">因此我们可以把它当成一个独立按键,按下时(有人移动)为1,松开时(没人移动)为0。</span></span></p>
<p> </p>
<p><span style="font-family:Times;"><span style="font-size:16px;"> </span></span></p>
<p> </p>
<p><span style="font-family:Times;"><span style="font-size:16px;">这个模块是5V供电,又找了个板子供上了5V电源</span></span></p>
<p> </p>
<p><span style="font-family:Times;"><span style="font-size:16px;">很简单就是一个外部中断,</span></span></p>
<p> </p>
<p><span style="font-family:Times;"><span style="font-size:16px;">void exint_line0_config(void)</span></span></p>
<p><span style="font-family:Times;"><span style="font-size:16px;">{</span></span></p>
<p><span style="font-family:Times;"><span style="font-size:16px;"> exint_init_type exint_init_struct;</span></span></p>
<p> </p>
<p><span style="font-family:Times;"><span style="font-size:16px;"> crm_periph_clock_enable(CRM_IOMUX_PERIPH_CLOCK, TRUE);</span></span></p>
<p><span style="font-family:Times;"><span style="font-size:16px;"> crm_periph_clock_enable(CRM_GPIOA_PERIPH_CLOCK, TRUE);</span></span></p>
<p> </p>
<p><span style="font-family:Times;"><span style="font-size:16px;"> gpio_exint_line_config(GPIO_PORT_SOURCE_GPIOA, GPIO_PINS_SOURCE8);</span></span></p>
<p> </p>
<p><span style="font-family:Times;"><span style="font-size:16px;"> exint_default_para_init(&exint_init_struct);</span></span></p>
<p><span style="font-family:Times;"><span style="font-size:16px;"> exint_init_struct.line_enable = TRUE;</span></span></p>
<p><span style="font-family:Times;"><span style="font-size:16px;"> exint_init_struct.line_mode = EXINT_LINE_INTERRUPUT;</span></span></p>
<p><span style="font-family:Times;"><span style="font-size:16px;"> exint_init_struct.line_select = EXINT_LINE_8;</span></span></p>
<p><span style="font-family:Times;"><span style="font-size:16px;"> exint_init_struct.line_polarity = EXINT_TRIGGER_RISING_EDGE;</span></span></p>
<p><span style="font-family:Times;"><span style="font-size:16px;"> exint_init(&exint_init_struct);</span></span></p>
<p> </p>
<p><span style="font-family:Times;"><span style="font-size:16px;"> nvic_priority_group_config(NVIC_PRIORITY_GROUP_4);</span></span></p>
<p><span style="font-family:Times;"><span style="font-size:16px;"> nvic_irq_enable(EXINT9_5_IRQn, 1, 0);</span></span></p>
<p><span style="font-family:Times;"><span style="font-size:16px;">}</span></span></p>
</div><script> var loginstr = '<div class="locked">查看本帖全部内容,请<a href="javascript:;" style="color:#e60000" class="loginf">登录</a>或者<a href="https://bbs.eeworld.com.cn/member.php?mod=register_eeworld.php&action=wechat" style="color:#e60000" target="_blank">注册</a></div>';
if(parseInt(discuz_uid)==0){
(function($){
var postHeight = getTextHeight(400);
$(".showpostmsg").html($(".showpostmsg").html());
$(".showpostmsg").after(loginstr);
$(".showpostmsg").css({height:postHeight,overflow:"hidden"});
})(jQuery);
} </script><script type="text/javascript">(function(d,c){var a=d.createElement("script"),m=d.getElementsByTagName("script"),eewurl="//counter.eeworld.com.cn/pv/count/";a.src=eewurl+c;m.parentNode.insertBefore(a,m)})(document,523)</script> <p>注意IO口的耐压啊</p> <p>那个白色的就是传说中的菲涅尔红外透镜?</p>
秦天qintian0303 发表于 2022-9-1 08:43
注意IO口的耐压啊
<p>对 要接FT端口</p>
<p>这传感器是什么接口?是I2C吗</p>
bigbat 发表于 2022-9-1 22:48
这传感器是什么接口?是I2C吗
<p>就是IO口 类似按键产生高低电平而已</p>
页:
[1]