NerdKits - electronics education for a digital generation

You are not logged in. [log in]

NEW: Learning electronics? Ask your questions on the new Electronics Questions & Answers site hosted by CircuitLab.

Project Help and Ideas » Assembly

November 16, 2010
by Master_Programmer
Master_Programmer's Avatar

Hey, i read in the atmega168 datasheet, and noticed the "Direct Program adressing".... i'm still trying to figure out what that does....would it allow me to rwrite a program that rewrites itself? and if so,wouldn't i be able to use eeprom as kind of a cartrage for my game system i made?

November 16, 2010
by mrobbins
(NerdKits Staff)

mrobbins's Avatar

Hi Master_Programmer,

I don't believe that there's any way to load instructions directly from memory other than the Flash Program Memory space.

I think you have two options:

  1. You can build an interpreter of sorts that would read pseudo-instructions from the EEPROM and follow their directions.
  2. You could use the self-programming capabilities of the microcontroller, where it's able to write over its own flash memory space (as the bootloader does).

Mike

November 18, 2010
by Master_Programmer
Master_Programmer's Avatar

i know, i just need some way of loading a program onto an EEPROM chip, and then loading the program from that, onto the chip itself somehow....and even then, i'll probably need help with the programming part too.....

but thanks for the answer Mister Mike. :)

November 18, 2010
by mrobbins
(NerdKits Staff)

mrobbins's Avatar

Just a thought:

Another approach might be to have one microcontroller that's part of the "cartridge" which contains the game, which communicates over the SPI bus (pretty fast!) to a second microcontroller that's responsible for handling all of the I/O with the rest of the "game system". The "cartridge" microcontroller would actually be running the game and maintaining the state of the game world, while the "game system" microcontroller might maintain the state of a display, etc.

Mike

February 22, 2011
by Master_Programmer
Master_Programmer's Avatar

I know....i just thought of that design. XD

Post a Reply

Please log in to post a reply.

Did you know that you can connect a pushbutton to a microcontroller with only one wire? Learn more...