【杰理AC696X】ADKEY复用指示灯不定时出现灯不亮或按键失灵的问题

ADKEY复用LED引脚致按键失灵?杰理AC696X软硬件排查与修复 在嵌入式系统设计中,ADKEY按键检测与LED指示复用同一GPIO是节省引脚资源的常见做法,但其背后涉及ADC分压采样原理与外部负载耦合干扰的复杂关系。当低成本蓝牙音箱等产品面临引脚紧张时,复用方案虽能降低成本,却可能因电气状态冲突引发不定时按键失灵或指示灯异常。本文通过杰理AC696X平台的实际案例,展示如何利用示波器抓取波形、串口打印原始ADC值等手段精准定位故障,并给出硬件隔离(如三极管驱动LED)与软件时序隔离(延时采样、丢弃首次值、状态快照)相结合的系统性解决方案,为AC692X、AC701N等类 阅读详情

ADKEY复用指示灯不定时出现灯不亮或按键失灵的问题

测试SDK版本:《ac696n_soundbox_sdk_v1.5.0-20211217》



前言

ADKEY复用指示灯的做法多用于蓝牙小音箱,IC引脚越来越少,复用也就用的越多了,不过,在使用前应评估好功能,因为复用的做法,肯定会牺牲点东西的,如果体验感啥的。

在这里插入图片描述
比如这个图,(V-)按键按下时,LED是会一直导通发光的,按不同阻值的按键还有亮度不一致的问题,这样的问题有的客户是不接受的,这就要另寻他法了。


一、问题描述与复现

某天调好案子,放在一边测试时,发现指示灯不亮了,按键也不起作用,想起之前AC692系列也有类似的问题,很快就定位到,可能是标准SDK复用的流程有问题了。

后续又测了几遍,发现这个问题不定时出现,有时很容易出现,有时又要等很久。

二、问题分析与解决

因为懒,不想重新写指示灯的流程,所以,还是通用方法,打印+看代码,看能不能找出问题。

最后问题定位在下图所示的这些变量:
在这里插入图片描述
看这部分的代码都把人绕晕了,最后发现是这些标志没有处理好,导致出现异常。

知道问题就好办了,直接用简单的方法解决,

写好的接口有问题,就不用了,直接注释掉:
在这里插入图片描述
然后直接在扫描AD通道的地方做复用功能的切换就好:

ADKEY与LED复用同一IO引发不定时故障:根因分析与根治方案 在嵌入式开发中,GPIO复用是节省引脚资源的常用手段,但当按键检测与指示灯驱动共用一个IO时,往往埋下隐患。ADKEY按键依赖ADC分压采样,对引脚状态极为敏感;LED驱动则需要稳定的输出电平。两者切换若缺乏原子化时序控制,容易引发方向寄存器错乱、采样值漂移,造成灯不亮或按键失灵的偶发故障。本文从复用原理出发,分析IO方向切换、内部上拉、中断抢占、低功耗唤醒等关键环节,给出硬件隔离(二极管/三极管)与软件状态机调度的完整解决方案,并提供实战排查清单。对于消费电子、蓝牙音箱等低引脚MCU项目,这套方法论可直接 阅读详情

相关推荐

ADKEY串联并联硬件设计电路参考

ADKEY串联并联硬件设计电路参考 方便常规的ADC电路做参考设计,提供串联及并联接法,最多提供8个按键

Windows10完美驱动Apple Studio Display全攻略:从雷电转接到亮度调节(附N卡兼容列表)

本文详细介绍了在Windows10系统下如何完美驱动Apple Studio Display显示器,包括雷电接口转接方案、BootCamp驱动安装及NVIDIA显卡兼容性测试。特别推荐GTX 1660 Super等显卡,提供5K@60Hz稳定输出,并分享色彩管理及日常使用技巧,帮助用户充分发挥这款苹果显示器的性能。

weixin_29284657的博客 1106

极验第四代滑块验证码破解(三):滑块轨迹构造

极验第四代滑块验证码破解(三):滑块轨迹构造声明 声明 原创文章,请勿转载! 本文内容仅限于安全研究,不公开具体源码。维护网络安全,人人有责。 本文关联文章超链接:

帯泪的鱼的博客 8633

扫地机器人:从仿真到决策,一个完整SLAM导航系统的自研之路

本文详细记录了从零开始自研扫地机器人SLAM导航系统的全过程,涵盖ROS-Gazebo仿真系统搭建、地图预处理优化、全覆盖规划算法迭代等关键技术。通过三次算法升级,最终实现92%的清洁效率,并分享DWA调参、状态机设计等实战经验,为开发者提供从仿真到落地的完整解决方案。

weixin_29053695的博客 354

R语言clusterProfiler实战:GO与KEGG富集分析从入门到精通

本文提供了一份详尽的R语言clusterProfiler实战指南,从环境配置、数据导入、基因ID转换到GO与KEGG富集分析及可视化,手把手教你解读生物学意义。文章重点介绍了如何利用clusterProfiler这一强大工具,将差异基因列表转化为清晰的生物学通路与功能故事,并分享了结果解读、可视化以及处理非模式生物等进阶技巧与避坑指南。

weixin_29044713的博客 167

中文翻译《ASPICE in practice》之“SUP.8 配置管理”

一般来说,自动化程度越低,负责 CM 的个人就必须花费越多的精力,例如,检查基线的正确性和完整性,或确保在归档系统上正确完成手动版本控制。必须防止未经许可的访问。为了唯一地标识基线,许多 CM 工具提供了一种“标记”基线的机制,即为受影响的 CM 项目的所有版本分配相同的标签,例如“第 3 次交付状态”。此选择必须允许绘制合格的基线(参见 BP5),即确保实际上所有描述特定开发阶段的元素(需求和设计文档、开发环境、变更请求、测试用例、测试文档,也可能是重要的中间工作产品等)都可以在 CM 系统中进行基线。

Smith_Chai的博客 1588

如何通过 Python 爬虫抓取并分析政府开放数据

通过本文的介绍,我们展示了如何使用Python 爬虫抓取并分析政府开放数据。通过requests获取政府开放数据的 API 接口数据。使用和pandas进行数据清洗与存储。使用matplotlib对数据进行可视化。你可以根据不同的政府开放平台和数据集进行调整,应用于不同领域的数据分析,如公共健康、交通、环保等。

专注于Python爬虫开发,分享爬虫技巧、项目实战与反爬经验,使用Scrapy、BeautifulSoup等工具,解决数据抓取难题。 1079

CAPL如何设置或修改CANoe TCP/IP协议栈的底层配置

MSS = MTU - tcpHeader - ipHeader,也就是MTU = MSS(1360) + tcpHeader(20) + ipHeader(20) = 1400,说明CAPL是可以动态设置网络底层配置参数的!然后在CAPL中设置此网卡MTU值为1400,然后创建UDP套接字,一次性发送2000个字节,在Trace窗口看看首帧报文二层Data的长度。所以我们还不能用UDP协议来验,应该用TCP协议来验,也就是在TCP三次握手时通过Tester的MSS值推导出自己的MTU值。

jasonj333 997

初探802.11协议(6)——Wi-Fi 6新特性简介

Wi-Fi 6新机制(特性)介绍

FanFF的博客 1524

pscad IEEE标准系统搭建说明

pscad IEEE标准系统搭建说明,包含典型的IEEE 9节点、14节点、30节点、39节点和118节点系统。内含标准测试系统的原始数据和潮流结果。

汉书HE8,好用的汇编代码编写工具

汉书HE8,好用的汇编代码编写工具早期编写汇编代码所用功能强大

深度学习工具包 DeepLearningToolbox

深度学习工具包Deprecation notice.-----This toolbox is outdated and no longer maintained.There are much better tools available for deep learning than this toolbox, e.g. [Theano](http://deeplearning.net/software/theano/), [torch](http://torch.ch/) or [tensorflow](http://www.tensorflow.org/)I would suggest you use one of the tools mentioned above rather than use this toolbox.Best, Rasmus.DeepLearnToolbox================A Matlab toolbox for Deep Learning.Deep Learning is a new subfield of machine learning that focuses on learning deep hierarchical models of data.It is inspired by the human brain's apparent deep (layered, hierarchical) architecture.A good overview of the theory of Deep Learning theory is[Learning Deep Architectures for AI](http://www.iro.umontreal.ca/~bengioy/papers/ftml_book.pdf)For a more informal introduction, see the following videos by Geoffrey Hinton and Andrew Ng.* [The Next Generation of Neural Networks](http://www.youtube.com/watch?v=AyzOUbkUf3M) (Hinton, 2007)* [Recent Developments in Deep Learning](http://www.youtube.com/watch?v=VdIURAu1-aU) (Hinton, 2010)* [Unsupervised Feature Learning and Deep Learning](http://www.youtube.com/watch?v=ZmNOAtZIgIk) (Ng, 2011)If you use this toolbox in your research please cite [Prediction as a candidate for learning deep hierarchical models of data](http://www2.imm.dtu.dk/pubdb/views/publication_details.php?id=6284)```@MASTERSTHESIS\{IMM2012-06284, author = "R. B. Palm", title = "Prediction as a candidate for learning deep hierarchical models of data", year = "2012",}```Contact: rasmusbergpalm at gmail dot comDirectories included in the toolbox-----------------------------------`NN/` - A library for Feedforward Backpropagation Neural Networks`CNN/` - A library for Convolutional Neural Networks`DBN/` - A library for Deep Belief Networks`SAE/` - A library for Stacked Auto-Encoders`CAE/` - A library for Convolutional Auto-Encoders`util/` - Utility functions used by the libraries`data/` - Data used by the examples`tests/` - unit tests to verify toolbox is workingFor references on each library check REFS.mdSetup-----1. Download.2. addpath(genpath('DeepLearnToolbox'));Example: Deep Belief Network---------------------```matlabfunction test_example_DBNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit RBM and visualize its weightsrand('state',0)dbn.sizes = [100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);figure; visualize(dbn.rbm{1}.W'); % Visualize the RBM weights%% ex2 train a 100-100 hidden unit DBN and use its weights to initialize a NNrand('state',0)%train dbndbn.sizes = [100 100];opts.numepochs = 1;opts.batchsize = 100;opts.momentum = 0;opts.alpha = 1;dbn = dbnsetup(dbn, train_x, opts);dbn = dbntrain(dbn, train_x, opts);%unfold dbn to nnnn = dbnunfoldtonn(dbn, 10);nn.activation_function = 'sigm';%train nnopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.10, 'Too big error');```Example: Stacked Auto-Encoders---------------------```matlabfunction test_example_SAEload mnist_uint8;train_x = double(train_x)/255;test_x = double(test_x)/255;train_y = double(train_y);test_y = double(test_y);%% ex1 train a 100 hidden unit SDAE and use it to initialize a FFNN% Setup and train a stacked denoising autoencoder (SDAE)rand('state',0)sae = saesetup([784 100]);sae.ae{1}.activation_function = 'sigm';sae.ae{1}.learningRate = 1;sae.ae{1}.inputZeroMaskedFraction = 0.5;opts.numepochs = 1;opts.batchsize = 100;sae = saetrain(sae, train_x, opts);visualize(sae.ae{1}.W{1}(:,2:end)')% Use the SDAE to initialize a FFNNnn = nnsetup([784 100 10]);nn.activation_function = 'sigm';nn.learningRate = 1;nn.W{1} = sae.ae{1}.W{1};% Train the FFNNopts.numepochs = 1;opts.batchsize = 100;nn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.16, 'Too big error');```Example: Convolutional Neural Nets---------------------```matlabfunction test_example_CNNload mnist_uint8;train_x = double(reshape(train_x',28,28,60000))/255;test_x = double(reshape(test_x',28,28,10000))/255;train_y = double(train_y');test_y = double(test_y');%% ex1 Train a 6c-2s-12c-2s Convolutional neural network %will run 1 epoch in about 200 second and get around 11% error. %With 100 epochs you'll get around 1.2% errorrand('state',0)cnn.layers = { struct('type', 'i') %input layer struct('type', 'c', 'outputmaps', 6, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %sub sampling layer struct('type', 'c', 'outputmaps', 12, 'kernelsize', 5) %convolution layer struct('type', 's', 'scale', 2) %subsampling layer};cnn = cnnsetup(cnn, train_x, train_y);opts.alpha = 1;opts.batchsize = 50;opts.numepochs = 1;cnn = cnntrain(cnn, train_x, train_y, opts);[er, bad] = cnntest(cnn, test_x, test_y);%plot mean squared errorfigure; plot(cnn.rL);assert(er<0.12, 'Too big error');```Example: Neural Networks---------------------```matlabfunction test_example_NNload mnist_uint8;train_x = double(train_x) / 255;test_x = double(test_x) / 255;train_y = double(train_y);test_y = double(test_y);% normalize[train_x, mu, sigma] = zscore(train_x);test_x = normalize(test_x, mu, sigma);%% ex1 vanilla neural netrand('state',0)nn = nnsetup([784 100 10]);opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samples[nn, L] = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.08, 'Too big error');%% ex2 neural net with L2 weight decayrand('state',0)nn = nnsetup([784 100 10]);nn.weightPenaltyL2 = 1e-4; % L2 weight decayopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex3 neural net with dropoutrand('state',0)nn = nnsetup([784 100 10]);nn.dropoutFraction = 0.5; % Dropout fraction opts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex4 neural net with sigmoid activation functionrand('state',0)nn = nnsetup([784 100 10]);nn.activation_function = 'sigm'; % Sigmoid activation functionnn.learningRate = 1; % Sigm require a lower learning rateopts.numepochs = 1; % Number of full sweeps through dataopts.batchsize = 100; % Take a mean gradient step over this many samplesnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex5 plotting functionalityrand('state',0)nn = nnsetup([784 20 10]);opts.numepochs = 5; % Number of full sweeps through datann.output = 'softmax'; % use softmax outputopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, train_x, train_y, opts);[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');%% ex6 neural net with sigmoid activation and plotting of validation and training error% split training data into training and validation datavx = train_x(1:10000,:);tx = train_x(10001:end,:);vy = train_y(1:10000,:);ty = train_y(10001:end,:);rand('state',0)nn = nnsetup([784 20 10]); nn.output = 'softmax'; % use softmax outputopts.numepochs = 5; % Number of full sweeps through dataopts.batchsize = 1000; % Take a mean gradient step over this many samplesopts.plot = 1; % enable plottingnn = nntrain(nn, tx, ty, opts, vx, vy); % nntrain takes validation set as last two arguments (optionally)[er, bad] = nntest(nn, test_x, test_y);assert(er < 0.1, 'Too big error');```[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/rasmusbergpalm/deeplearntoolbox/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

Devexpress16.2.6破解工具

Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具Devexpress16.2.6破解工具

上一篇: 【杰理AC696X】MIC能量采集的三种方式
下一篇: 【杰理AC696X】外挂收音IC RDA5807的频段设置
xx842678
博客等级 码龄11年 265粉丝 30原创
评论 2
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

当前余额3.43元 前往充值 >
需支付:10.00元
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付元
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值
⌂ 换网址