0

We need to change a controller code from the out side as they do with industrial MCU . So that you have an mcu,with a program on it, and someone can program some "words" to it, that will determine how it works. So for example you can program an mcu -not with a programer but with some inputs from serial, to do some simple things such as:

if input A==1
b=1

I wonder if there is a smart way to do that with simple software on the mcu, that it has many #defines for various commands, and it perform them according to values it gets from the outside (and saved for the rest of the program).

I wonder if the industrial programers are using that method, or that every programing of a user is actually load a code(.hex) to the chip(with internal programer ) .

I prefer the simplest way(i wonder if its by pre defined software)

4

1 回答 1

0

我想到了几个选项,所以希望这能回答你的问题。听起来您问题的最简单版本是“如何在没有实际 MCU 程序员的情况下更改 MCU 的行为?” 我想到了几个选项。

1) 根据 MCU,您可以拥有一个引导加载程序,它本质上是由能够重新编程 MCU 其他部分的程序员在 MCU 中编写的一小段代码。这不需要程序员,但涉及让引导加载程序知道新代码是什么的其他形式(USB、串行、SD 卡等)。这仅在 MCU 具有自闪光能力时才有效。

2) 同样,根据 MCU 和场景,您可以编写一组通用规则,这些规则根据提供给 MCU 的输入执行功能。这可以是 IO 引脚、EEPROM 或 SD 卡上的特定域脚本的形式,MCU 可以在运行时读取和解释。

这两个选项都取决于您使用的 MCU 以及您可以使用的硬件功能。但是,除了每次您想要进行更改时,您肯定还有其他选择,而不是使用实际的程序员重新编程最终硬件。希望这会有所帮助。

于 2013-10-10T20:50:35.233 回答