问题标签 [atmega]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
timer - 16 MHz ATmega8535 上的 1 MHz 定时器
我似乎无法理解这一点,尽管对我来说这看起来很容易。我在我的 Atmel ATmega8535 中制作了很多计时器,但这个让我很受打击。另外,我看过很多计算等,但这并不是我想要的。
这很简单:
我的 ATmega8535 以 16 MHz 运行,而我想要的只是一个 1 MHz 的定时器,因此我可以在某些引脚上以 1 MHz 的频率输出一些数据。
那么我该如何进行呢?下面的计算听起来不错(在此处找到)。
那么这将导致
如何正确地进行这些计算?这会导致 1 MHz 定时器吗?
avr - 新的 ATMEGA1281 和 avrdude
我在编写新的 ATMEGA1281 时有时会遇到问题。它应该和我的旧的一样,我猜唯一的区别是序列号:
ATMEGA1281 16AU 1104与 ATMEGA1281 16AU 1304
我习惯使用 avrdude 命令对 ATMEGA1281 进行编程,但是使用新芯片时,有时会出现以下错误:
你知道我为什么会遇到这个问题吗?
提前致谢!
assembly - Issues with Timers in Assembly [ATmega8]
I've written a programm that Outputs 2 different sounds, taken from 2 Potientiometers.
The issue with that is, that a sound is generated by turning the beeper on and off with a delay in it, which is basicly the value of the potentiometer.
But the higher the frequency is, the lower is the time the sound is played and i want that the time the sound is played is unattached to its frequency.
So i decided to use a timer.
Planned is the following structure:
As you see, this should give a frequency over a specified time. The implementation so far looks as follows (PORTB is the beeper)(This is only for one Sound):
While the timer overflow functions are:
Timer initialization:
I've also set the interrupt vectors for T2OVF, T0OVF and enabled interrupts in general.
But it doenst work, the output seems like random. Whats wrong with it ?
embedded - Atmega 32, Program to drive motor , How to take input integer from user
I am trying to write a simple program to take input from user by hterm, when User enters "motor" & "25" the motor will rotate in 25 clockwise and 25 anticlockwise direction
Now, The problem is that when I will delete these lines from main()
& make items_read in move_clockwise(items_read);
as:
Then when user enters "motor" then motor is running move_clockwise(25);
but move_anticlockwise(25);
is not running, what I would like is to take both "motor", number for clockwise and number for anticlockwise....
I would really appreciate if anyone can help me with this! Thanks in advance!
c - 三个条件排列的最快算法是什么?
任何人都可以帮助我了解以最少步骤评估三个条件的最快方法吗?我有三个条件,如果两个条件中的任何一个为真,则整个表达式变为true
else false
。
我尝试了两种方法:
另一种方法是通过引入变量i
和
我想要任何其他比上述两种更好的有效方法。
我在内存受限的环境中工作(带有 8 KB 闪存的 Atmeta8)并且需要一个在 C 中工作的解决方案。
c - 在 C 中有效地访问 long 中的单个字节(在 8 位平台上)
我有一个应用程序,我在其中接收二进制串行数据流,我需要将此数据流拆分为不同长度的单独变量(uint16_t
和uint32_t
)。
现在,我正在做超简单的事情:
(数据以小端序发送。这OFFSET_iTOW
是数据包各个部分的大约三打偏移量之一(通常在头文件中定义)
但是,这会导致相当大的汇编输出(略微截断为感兴趣的部分):
这是运行在 16 Mhz 的 8 位微处理器上的中断服务例程中 GPS 数据解析器的一部分,我需要做很多这样的转换,所以上面的结果有点过分。
由于这是在 ISR 中,我可以确信在中断期间各种数据不会改变。基本上,我希望能够处理长字节中的各个字节。由于这是一个 8 位架构,因此编译器似乎应该能够优化到几个操作(可能每行 C 3-4 个,因为从汇编的角度来看,长字节中的字节是直接可寻址的)。
声明了变量,volatile
因此它们不会被优化为什么都不做的循环。在实际应用程序中,它们是extern
从 ISR 写入的结构,但从空闲循环中读取(使用适当的 ISR 保护以防止读取被中断)。不过,我不确定如何生成一个紧凑的片段来展示这种精确的行为。
at-command - 西门子手机的 GPRS AT 命令
我有一个任务 - 远程温度监测。硬件是atmega328单片机,简单的模拟温度传感器和旧手机西门子cx75(这个设备有GPRS模块)。所以,我正在寻找 AT 命令来通过 GPRS 从这部手机发送一些数据字节。有很多关于 GPRS 命令的文档,但我发现仅适用于调制解调器而不是手机。
也许有人可以帮助我?还是使用其他解决方案更容易?
更新:
我取得了一些进展:
首先我设置了 PDP 上下文:
然后
没关系,我已经附加到包域服务和 PDP 上下文中
了 那么,接下来我应该怎么做呢?我尝试了一些调制解调器命令,例如
但我有
assembly - 用汇编语言在屏幕上打印一个字符
我目前正在学习 AVR 汇编语言。我正在使用最新版本的 AVR Studio,并且正在使用 ATmega124。
无论如何要在屏幕/终端上打印一个字符吗?我一直试图只打印一封信,但没有成功。我看过很多关于 AVR/C 的例子,但没有关于汇编语言的例子。
microcontroller - 是否可以通过将 I/O 端口调高和调低来产生准确的高频波?
我想生成相位差为 100ns 的 3 个 1MHz 波!使用 OC 模式生成它们是否准确?我的意思是我可以通过增加 OC 来做到这一点,小步增加 3 次,大步增加 4 次,然后继续这个,在每个 ISR 中切换一个 I/O 端口(总共 3 个 I/O 端口正在切换) 但我的问题是这个过程是否准确?!或者在这个过程中有一些时钟丢失了?!
c - 在决定时发现错误
这是我的程序,我将数据从 PC 发送到微控制器(Docklight 的 Atmega 168PA)。我发送三个相同的字节。然后微控制器必须比较它们并向我发送一个布尔值,指示它们是否相等(like 00
)或不相等(like 01
)。
下一个任务是验证错误发生在哪里或哪个字节是错误的。
同样,当微控制器接收到一个数据时,它会将三个字节存储为一个数据(data[i]
),它只是重复三次。
因此,如果我以某种方式发送数据('18''19''18'),它必须告诉我错误发生在哪里......