B001-Atmega16-位域的汇编实现

B001-Atmega16-SPI Flash 主要内容: 第一步:SPI的结构 第二步:SPI的初始化 第三步:Atmega16的SPI自发自收 第四步:与SPI Flash连接(GD25Q32B) 第五步:读取SPI Flash的RDID(GD25Q32B) 第六步:SPI Flash操作接口(GD25Q32B) 第七步:SPI接口管理器 第八步:同时操作三个SPI Flash 阅读详情
0
0
-------------------------------------------------------------------------------------------------------------------------------------
开发环境:AVR Studio 4.19 + avr-toolchain-installer-3.4.1.1195-win32.win32.x86
芯片型号:ATmega16
芯片主频:8MHz


-------------------------------------------------------------------------------------------------------------------------------------

第一种实现方式

(2016.10.28)
今天临时起意、去看了位域部分的反汇编,看看汇编如何实现位域。
使用到的位域如下定义:
// 事件队列的结构(type[7bit],lock[1bit],data[32bit])
typedef struct 
{
    uint8_t  type :7 ;  // 消息类型、如数码管数据有更新:EVENT_SEG_UPDATE
    uint8_t  lock :1 ;  // 加锁标志
    uint32_t data;      // 消息参数、如数码管的数据:1265214
}T_EVENT_LIST, *pT_EVENT_LIST;
使用这个结构的代码如下:
        // --------------------------------------
        event_buffer_task01[0].type = EVENT_SEG_UPDATE;  // EVENT_SEG_UPDATE = 0x06
        event_buffer_task01[0]
B001-Atmega16-16位寄存器的读写步骤 Atmega16-16位寄存器的读写步骤 阅读详情

相关推荐

B001-Atmega16-汇编-地址空间分配

打开m16def.inc、可以看到如下面的定义,它和手册里面描述的ROM、RAM等的地址空间一一对应。 同时、可以在DEBUG模式下看到SP指针是放在RAM的末尾,从最后面开始向下生长。

Manon_des_source的博客 1376

【Quad FPV】BLDC:BLHeli_S从硬件PCB设计到Keil编译、下载

前言 大学接触到多旋翼无人机以来,飞行水平未见提高,倒是一直在关注遥控设计和机体设计方面。本文记录关于BLHeli电调设计开发过程中的一些坑。 参考文档: timegate 墨鸢,moyuan2000@163.com《无感无刷直流电机之电调设计全攻略 》 逗倪豌儿,联系方式现已失效,《编译 BLHeli_S 的正确方式》 BLHeli固件开源地址:https://github.com/bitdump/BLHeli.git BLHeli上位机:https://github.com/blheli-config

qq_41100189的博客 1万+

【信息科学与工程学】【控制科学】第十二篇 微型计算机控制技术01

更精确的经典模型:I1在第5周期WB结束,I2最早可在第6周期进入EX,但I2在ID阶段就需要R1,因此I2的ID需在第6周期,而I1的WB在第5周期,所以I2的ID可以紧接在第6周期,但中间仍有一个stall(因为I1的EX结果要等到MEM之后才能转发给ID?有优先级继承后,Task_L被提升优先级,不会被Task_M抢占,阻塞时间缩短为Task_L剩余执行时间(9ms),仍可能超过10ms,但可通过调整任务周期或使用中断处理缓解。电感L=10μH,输出电容C=100μF,ESR=5mΩ。

weixin_49199313的博客 8623

Splunk CVE-2018-11409认证绕过漏洞深度解析

Splunk作为主流企业级日志分析平台,其Web管理接口的认证机制直接关系到整个安全运营体系的可信边界。CVE-2018-11409本质上是REST API路由层会话校验缺失引发的未授权访问问题,根源在于`/en-US/splunkd/__raw/`路径绕过了splunkweb与splunkd之间的信任链验证,导致配置文件、用户哈希、App源码等敏感信息明文泄露。该漏洞凸显了Web接口权限模型设计失守的风险,尤其在默认配置未加固、HTTPS未启用、初始密码未修改的生产环境中危害急剧放大。结合vulfocus

weixin_30875157的博客 596

逆变器方案(工频全套)工频正弦波逆变器开发板全套设计资

逆变器方案(工频全套)工频正弦波逆变器开发板,24V-72V通用12只TO-247封装MOS管,额定输出功率6500W以下;配有触摸屏操作界面,运行数据一目了然,带市电互补UPS功能,可选择电池优先或市电有限工作,我们的开发板均从实战角度出发,让您的学习更便捷,包含全套设计资料,PCB.原理图.源代码,程序均有中文注释,MCU选用美国微芯公的PIC-8位单片机,民用数字电源首选单片机,抗干扰能力强,运行稳定。...

m0_73494033的博客 890

微信小程序音视频通话(for硬件)授权与设备注册实战指南

本文详细介绍了微信小程序音视频通话(for硬件)组件的开发实践,涵盖授权流程、设备注册与VoIP插件集成。重点解析了如何通过服务端获取snTicket实现用户授权,确保硬件设备与微信端的音视频通话安全可靠,适用于智能门禁、话机等物联网场景。

u6v7w8x的博客 945

混沌系统在图像加密中的应用(二维离散Hénon混沌映射)

Hénon映射是一种二维离散时间动力系统,由美国数学家Michel Hénon在1976年引入。它是混沌动力系统中的经典模型之一,具有简单的形式和复杂的行为。

weixin_42207434的博客 2488

TortoiseGit提示No supported authentication methods available错误

一、问题 在使用TortoiseGit与远程仓库进行同步代码的时候提示如下错误,即:没有支持认证的方法可用。而GitBash却可以正常使用,不受影响。 通过调查,发现应该是TortoiseGit远程仓库的公匙无法和本地的密匙进行匹配认证造成的(主要是TortoiseGit缺少本地密匙)。由于TortoiseGit的默认网络SSH client是TortoiseGitPlink.exe,如下图所示。因此主要有两种方式来解决该问题: 不修改TortoiseGit的默认网络SSH client,此时需要为To

Jeffxu_lib的博客 2万+

告别VMware Tools!用open-vm-tools在Ubuntu 22.04上搞定共享文件夹(附开机自动挂载)

本文详细介绍了在Ubuntu 22.04上使用open-vm-tools替代VMware Tools实现高效共享文件夹管理的方法。通过开源工具open-vm-tools,用户可避免传统方案的兼容性问题,享受自动适配内核、系统更新同步等优势。文章包含从安装配置到开机自动挂载的全流程指导,特别适合在VMware虚拟机中运行Ubuntu Desktop的开发者提升工作效率。

weixin_32520095的博客 583

硬件工程师提前批真题及答案解析2

我们需要考虑题目可能的简化假设,即输入电阻 Ri​ 可能是 rbe​ 和 βre​ 的组合,但题目可能简化为: Ri​≈rbe​+βre​。由于锗管的正向导通电压较小(0.2 V~0.3 V),而硅管的正向导通电压较大(0.6 V~0.7 V),因此-4.7 V的电压差不符合硅管的特性,而更接近锗管的特性。在三极管电路中,静态电位是指在无信号输入时,三极管各电极的直流电压。re​ 是动态发射极电阻,通常可以近似为 re​=IE​VT​​,但在题目中已经给出了 re​=300Ω,因此可以直接使用这个值。

XU157303764的博客 777

040、全志V853低功耗AI视觉平台的ISP调优——电池供电场景下的画质与功耗平衡

本文分享了全志V853 AI视觉平台在电池供电场景下的ISP调优经验。作者通过实际项目踩坑案例,揭示了V853 ISP的特殊性:不同于主流平台,其ISP与CPU共享时钟域,降噪能力有限,需特别注意功耗控制。关键优化策略包括:关闭无效ISP模块、优化Sensor联动时钟、采用场景自适应配置、开发快速启动模式等。特别指出V853个体差异大,量产需考虑高低温影响。文章强调V853的ISP功耗优化需从寄存器级别精打细算,不能简单套用其他平台经验,建议选型时单独评估ISP功耗,避免续航缩水。

zzfmlxs的博客 24

SIMATIC S7-1200, S7-1500 PID 控制[手册]

SIMATIC S7-1200, S7-1500 PID 控制[手册]

深度学习工具包 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")

温度PID控制PLC程序

温度PID稳定控制程序,适用于欧姆龙PLC,对其他PLC也具有很大参考价值

迈瑞BS系列全自动生化分析仪LIS协议接口手册(内含HL7和ASTM)

迈瑞BS系列全自动生化分析仪LIS协议接口手册,内含HL7和ASTM)

上一篇: A004-移位范围超过变量宽度-(ques=1)
下一篇: B001-Atmega16-SPI Flash
Manon_des_sources
博客等级 码龄11年 11粉丝 42原创
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

个

红包个数最小为10个

元

红包金额最低5元

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

抵扣说明:

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

余额充值