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

Going Embedded

Hey, I've been programming higher level laguages writing windows apps in c++/c# for years now, but increasingly I am being put to work at a lower level with 8051 micro-controllers. Having a very minimal background in electronics I have found a lot of things difficult in understanding a data sheet.

In particular I am having trouble understanding when I should set a GPIO port to open-drain or push pull, or when to use weak pullups & high impedance.

Is there any simple explanation you guys can offer for this, or better yet is there a good resource for learning enough about the hardware (in particular this open-drain /push pull stuff), well enough in order to program it?

Thanks for your time!

Parents
  • The most important things here:
    - The 8051 has a lousy stack, so the Keil compiler will try to convert auto variables to global variables.

    - The automatic conversion of auto variables to global variables requires that you do not write recursive code.

    - Using function pointers will destroy the compiler/linker ability to build call trees to figure out which functions that may call other functions for the above optimization. So try to avoid function pointers.

    - The processor is 8-bit, so don't create int variables if an 8-bit variable is enough.

    - The strong point of the processor is one-bit variables, so try to use one-bit variables for your boolean conditions.

    - The processor has limited RAM, so make sure that constants are stored in the code space, i.e. in the flash.

Reply
  • The most important things here:
    - The 8051 has a lousy stack, so the Keil compiler will try to convert auto variables to global variables.

    - The automatic conversion of auto variables to global variables requires that you do not write recursive code.

    - Using function pointers will destroy the compiler/linker ability to build call trees to figure out which functions that may call other functions for the above optimization. So try to avoid function pointers.

    - The processor is 8-bit, so don't create int variables if an 8-bit variable is enough.

    - The strong point of the processor is one-bit variables, so try to use one-bit variables for your boolean conditions.

    - The processor has limited RAM, so make sure that constants are stored in the code space, i.e. in the flash.

Children
No data