This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Is this somehow possible?

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!

  • All I recommended was to select a processor with a general purpose architecture. A general-purpose processor maps well between C code and assembly instructions. It normally helps with the size of a normal processor register is the same as the size of a pointer.

    The 8051 instructions maps badly to C. It takes a lot of work-arounds for a 8051 to work with function and data pointers, and having separate memory spaces for code and data affects what - and how - you can implement things.

    The separation between a microprocessor and a microcontroller is hard to make. Is it enough to add a timer to get a microcontroller? Or is it when it has internal data and code memory? Or when it can toggle individual pins? In the end, should should not bother with such distinctios. You should make a list of needs, and then you can do the shopping, and decide if everything should be built in, or if some of the required features should be implemented by external solutions.

    Selecting a processor with every needed feature included can be very convenient, since you have less hardware to search errors in. It may be enough to supply power to get the processor up and running, making use of an internal RC oscillator until you let the software decide on an external crystal. Having flash an RAM internally, means you can't wire any such signals wrong or have too slow memory or happen to invert a signal. Having most of the high-speed signals hidden inside the processor will also reduce problems with noise sensitivity, or with radiation.

    With a traditional microcontroller, you can often decide in your software if individual processor pins should be digital inputs, digital outputs or have special-purpose functions such as UART, SPI, PWM, ... That means that you can implement a self-test function that slowly toggles the different pins while you look at the behaviour of external hardware.

    But all this is just a question of convenience, and total cost for required chips, required board space etc. And you can build a game with a processor having an internal LCD controller for directly interfacing with a graphical LCD. Or you can use a LCD with own controller that interfaces as a large external memory or as a few register addresses where you first write a memory address to the display and then write pixel data.

    A sw engineer has to make a lot of design decisions about the firmware. A hw engineer has to make a lot of design decisions about the hardware. Often the same person(s) has to work as both sw and hw engineer(s) and decide on trade offs between cost of hardware or time to implement in software.

    People on this forum can't know the level of your hardware skills or software skills or how much money you are ready to spend, or how much time or how advanced you want to make your project. That means that you and your friends will just have to make a lot of decisions.

    The only thing we can say is that you should stay away from a 8051 processor since a number of things you are thinking about does not map well to the 8051 architecture. Some other 8-bit processors can handle it way better. A 16-bit processor will be better. A 32-bit processor will most probably be even better. But the world has seen a large number of very advanced games designed around very old 8-bit processors, so in the end, the biggest deciding factors will be skills and creativity. A good developer can do wonders with little.

    Just notice that small and large are relative terms. A processor with a lot of memory and/or peripherials from one manufacturer can be cheaper than a processor with few features from another manufacturer. A 32-bit processor can be cheaper than an 8-bit processor. So in the end, it will come down to how well a specific processor fulfills your shopping list requirements. And while ARM chips are often a good starting point, the truth is that you must make that shopping list and then compare it to what is available out there.

    One thing I recommend that you add to your shopping list is the ability to perform easy In System Programming (ISP). Being able to use an RS232 port to reprogram the chip can be very convenient. You would also do well to select a processor with In Application Programming (IAP) to allow your application to write new contents to the code memory. This reduces the need for you to add external EEPROM memory for storing byte code or maybe plugin modules that may need to be copied into RAM to be usable.

    A processor selection list for chips supported by Keil development tools can be found at:
    http://www.keil.com/dd/search_parm.asp

    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.

  • 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.

    Erik

  • That was a complete answer :)

    But, as I dont have any experience with another chip rather the 8051, what do you recommend? Is there any cheap, good and easy microcontroller that Keil supports?

  • Thank you again!

    I noticed that there are 2 downloads in the evaluation area:

    Keil evaluation tools
    GNU development tools

    Which I should choose?

  • The Keil evaluation tools are good but size-limited. If you go for the Keil tools (they are quite good) you will need to buy the (quite expensive) commercial license.

    gcc does not have a size limitation. But Keil dropped support for gcc long time ago. And to my knowledge, you will still not be able to debug larger code.

    I use the commercial version of Keil tools, so you will have to wait and see if there is any gcc user here who can jump in and give better feedback about that alternative.

    The two choices are not fully compatible. The biggest difference will be in the startup code, which is written in assembler. Depending on what target processor you use, there may also be code differences when you implement interrupt handlers.

    There are other vendors who have products based around the gcc. But same thing there - you will have to find some user to get some feedback about the offerings.

  • An alternative when looking for development tools is to select a development board with uClinux already ported. Then you can get all software tools you need for free.

    On the other hand, this may not match your intended problem.

  • Hi Mike,
    I start with pawn and i want to use it in µc infenion XC116.
    Please, can you send to me an example of source where you use pawn in µc?

    Ayed