[sdiy] self-modifying code was: Re: My latest project
Jason Tribbeck
Jason.Tribbeck at ascom.com
Thu Feb 18 11:28:17 CET 2010
Hi,
> > Out of curiosity: how difficult is it to keep program data in RAM?
>
> Impossible. Most microcontrollers can only execute from flash rom.
> You could write to flash, but it takes time (milliseconds per block
> often) and the flash can only handle 10k - 100k write cycles typically.
You could have a Virtual CPU running on the microcontroller which reads its instructions from RAM...
> > And similarly.. how does SMC work with FPGA's and its family? Is it even
> > possible?
>
> It isn't. FPGAs load the configuration from flash/eeprom serially on
> startup.
I know that for Xilinx Spartan 3E you could do it, but it would be a bit of a pain.
You'd use a SPI interface on the FPGA for configuration; when the configuration is done, the pins used are available for IO.
So you could then theoretically wobble the pins in the necessary fashion to reprogram the configuration device. Finally, you'd use another pin connected to the PROGB to reset the FPGA itself.
I wouldn't like to lose power during it though.
Although you can program multiple Xilinx devices from the same SPI chip, so a parent one could overwrite child configuration data. There are some combinations which allow you to have multiple revisions in the same chip.
Note that the JTAG interface can be used to reprogram the configuration device through the FPGA itself (so you don't even need to worry about the SPI side of it - limited configuration device choice though).
--
Jason Tribbeck
More information about the Synth-diy
mailing list