Sure, you could just write the PORTD value to flash on power-up (if it changed). Then when the device connects to the PC ... it will have the new S/N.
But yes ... writing the string to flash IS the hard part, and that would limit you to 256 devices (globally).
Some programmers will allow you to save an incrementing S/N to flash on each program cycle. The meLabs programmer let's you do that. But finding the correct location in flash to put the data is the hard part there. If the program changes, the string location will too.
It's a tough one.
<br>




Bookmarks