On 11/15/2011 4:50 AM, Michael Karas wrote:
> In article< >,
> says...
>>
>> "janii" wrote:
>>
>>> We have 68HCS12 based slave board. It is installed in machines.
>>> So far, we have One executable for Three machines.
>>> We are adding a small feature(turn on light) that is applicable to only One
>>> of the Three machines.
>>
>> Assuming the machines are identical, a few possibilities:
>>
>> (a) Do you have any non-volatile memory available? Make the code
>> depend on a configuration flag stored in NVM.
>>
>> (b) Can the code recognize which machine it is running on? (via a
>> serial number, MAC address, node address/ID if applicable, etc.)
>> Make the code depend on that.
>>
>> (c) Do you have any unused input? A single bit that could be jumpered
>> high or low, an unused AD converter? Make the code depend on the state
>> of that input. (Look for unused I/O pins in existing peripherals)
>>
>> The NVM for (a) or input for (c) could be added if you can use an
>> existing I2C or SPI bus.
>
> Several of these ideas that rely on a user to set the configuration
> are not any better than having separate executables due to the fact
> that sooner or later someone will set the jumper/switch/EEPROM
> incorrectly.
>
> It would be far better to key off something that makes one machine
> type unique over the others.
>
If you've got a spare input, you could have the board detect whether a
pin is pulled up or pulled down. Then you just solder the right
resistor for the right board. You could even use a pin that's already
committed as an output if you checked it first at power-up time.
--
Rob Gaddi, Highland Technology --
www.highlandtechnology.com
Email address domain is currently out of order. See above to fix.