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)

Curnelious
  • 1
  • 16
  • 76
  • 150

1 Answers1

0

A couple of options come to mind so hopefully this answers your question. It sounds like the simplest version of your question is "How do I change the behavior of the MCU without an actual MCU programmer?" A couple of options come to mind.

1) Depending on the MCU you can have a bootloader that is essentially a small piece of code programmed in the MCU by a programmer that has the ability to reprogram other parts of the MCU. This doesn't require a programmer but involves some other form of letting the bootloader know what the new code is (USB, Serial, SD Card, etc). This will only work if the MCU has the ability to self flash.

2) Again, depending on MCU and scenario you could program a generic set of rules that carry out functionality based on the inputs given to the MCU. This could be in the form of IO pins, EEPROM, or a domain-specific script on an SD card that the MCU can read and interpret at runtime.

Both options depend on the MCU you are using and what hardware capabilities you have at your disposal. But you certainly have options other than reprogramming the end hardware with an actual programmer every time you want to make a change. Hopefully that helps.

K-Sid
  • 376
  • 1
  • 6
  • Thanks a lot , i am not sure you got me.. this is not for my own ability to program it, but for industrial tool that can change the chip not by a little bit,but actually put a whole program into it. so using microchip,i can pick any chip i want , problem is, how using software only and with IO ,you can actually really set a series of commands to it . – Curnelious Oct 11 '13 at 07:30
  • I think we are saying the same thing. You could write code that acted as a rule processor in the MCU and then just send a new set of rules to the MCU via a serial interface. Hopefully that made sense. If that's confusing send me an email (see my bio) and I'd be happy to try to explain it differently. – K-Sid Oct 11 '13 at 13:20