We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello :)
I am new to 8051 family programming and I have a question. I would like to know if there is anyway, somehow, to put another software in a memory and load it from 8051 to run on it. It would work similar to plugins :)
Speaking in C language, it would be like a function inside the memory that do something. That function receives a pointer to a structure that has many other functions that the main software inside the microcontroller has, like display things on a screen. Well, is very similar to plugins :)
Is this possible? With other microcontroller maybe?
If I said something wrong or confuse please, let me know! Thank you!
Just a quick note here. If you are going to do something with a graphics display, the amount of work will quickly explode. And the amount of load on the processor will also increase. Please look at an ARM chip. It is a way more general processor, reducing the amount of time you will have to fight with the processor.
But an even more important thing. Don't start too ambitios. Start with something simple. Get it to work. Then spend time thinking about how to extend it. Better to end up with a solution that only plays one game - such as tetris or some board game - than to have spent a lot of hours and end up with an unfinished product. The important thing is to do something that regularly gives you positive feedback. Progress is very important.
If you decide to continue, after having a working platform, quite a lot of simpler games can be implemented as byte-coded applets.
The general concept of a library is quite advanced. A real library requires linking. Either dynamic or static. But that linking step requires you to know how to update references inside the code, to make a call or variable reference from one module end up reaching the correct function or variable in another module. It is a very complex concept, unless you not only are very good with C (and possibly assembler) and are good at extracting information from the compiler output files. The C51 compiler is totally unsuitable for this, because of how the C51 compiler interacts with the linker.
And switching to a solution with function pointers requires a processor that is comfortable with pointers which means that you want a general-purpose processor with good I/O abilities. The 8051 chip is not general-purpose. It is very good at bit-access I/O, but falls short when it comes to general pointer and memory manipulation.
Whatever route you decide to do - implement a single game, try a byte-coded virtual machine or implementing a BIOS-style solution with function pointer arrays or similar - do not (!) select a 8051 chip. Just about any other chip would be better. I like ARM chips, but there are several other architectures that will all be way better than a 8051 chip for this kind of project.
So select a GP processor, start small and then see where you end up.
So, should I use a microcontroller or a microprocessor for this kind of stuff?
I'm sorry, but this sounds like a completely wrong question to ask. Are you sure you understand what you are going to do?
Yes, microcontrollers are a small computer, a CPU combined with timers, watchdog, serial and analog I/O, RAM, etc, all in one chip. Microprocessors are the CPU, something like that.
So, should I use a general purpose microcontroller or create my own system with a microprocessor?
I'm sorry, but this is a completely wrong statement. Are you sure you understand what you are going to do? (slightly infringing on Mikes copyright)
microcontroller/microprocessor are just names applied by salesmen.
The answers you have gotten have NOTHING WHATSOEVER to do with that. They relate to ARCHIECTURE
Erik
So, what I should conclude?
But may just as well use a Microchip PIC processor, any AVR chip from Atmel, a PPC, some of the Texas offerings, ... You can spend months looking for processors and still regularly find new processors that are suitable for the task. But you must decide what is good enough.
for loaded program ... a Harvard chip is not a good choice, why wrestle when you do not need to, ude a vonNeumann chip.