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

help needed

i am using keil for the first time
can anyone give me some quick knowledge abt hw to use keil i have to write programs for micromouse and have to complete my project in 2 days

tell me whether we need startup.a51

where should we write our code in the startup.a51 since i cant understand what is written in startup.a51

i am using at89c51ed2

Parents
  • "i am using keil for the first time ... have to complete my project in 2 days"

    That is a really tall order!

    If you were already an experienced developer, and it was just the Keil tools that were new, it wouldn't be unreasonable to budget a couple of days to familiarise yourself with the new tools...

Reply
  • "i am using keil for the first time ... have to complete my project in 2 days"

    That is a really tall order!

    If you were already an experienced developer, and it was just the Keil tools that were new, it wouldn't be unreasonable to budget a couple of days to familiarise yourself with the new tools...

Children
  • can anyone give me some quick knowledge abt hw to use keil
    the "getting started guide"
    It has been shown that reading it does not do it, you must work through the examples.

    Erik

  • You need startup.a51 if (a) your project in written in C; and (b) you don't know for certain that you don't need it.

    All startup.a51 does it to set up the C "run time environment", which for Keil C51 is pretty simple. startup.a51 zeroes out memory, and also initializes the "software stack" which is used if you have functions declared reentrant.

    In general, you do not need to add your own code to startup.a51. The exceptions would be similar boot time initialization. General init of the chip hardware I would do in other modules.

    If your program is in pure assembler, then you don't need startup.a51 at all. You might use it or copy the loops to init memory if you want to do that.

  • General init of the chip hardware I would do in other modules.
    some exceptions, to be done at the very beginning of startup
    1) if you have a watchdog, it is recommended to disable it in startup and reenable it in main, The code in startup and the 'secret' module it calls before main is entered can be quite lenghty
    2) if you have a XRAM cnfiguration register and the default does not match your hardware you need to set it here.
    3) DO NOT reset port pins to avoid them being high after reset here, the duration of reset can be disastrous if you rely on a port pin being reset as default.

    There are other exceptions, the above is what I can think of off the bat.

    Erik

  • Good points. Some initialization has to be done immediately, and is a good candidate for startup.a51.