Connect with us

Embedded Software Architecture

Discussion in 'Microcontrollers, Programming and IoT' started by electronicsLearner, Apr 25, 2015.

Scroll to continue with content
  1. electronicsLearner

    electronicsLearner

    11
    0
    Mar 25, 2015
    Hi,

    Can someone please suggest me embedded software architecture to be followed for programming any 16 bit or 32 Micro controller. Right now i am programming in a random manner as per requirements and the requirements keep changing and code is becoming complex and becoming difficult to debug in case of issues. I want to program as per some sequence like
    a. As soon as power on what actions i have to do. b. how to initialize the ports, interrupts. Can somebody please suggest me some methods or books so that coding becomes easy. I also want to know when to use critical sections. Please help.
     
  2. BobK

    BobK

    7,682
    1,686
    Jan 5, 2010
    It is not clear what you mean by this. Each project has it's own software architecture.

    You mention critical sections, so this implies that you will be running multiple threads, probably with pre-emptive scheduling. Are you using a specific RTOS for this?

    Bob
     
  3. electronicsLearner

    electronicsLearner

    11
    0
    Mar 25, 2015
    Just i wanted to know if there is a generic architecture or standard architecture which everyone follows. I am not using RTOS.
     
  4. BobK

    BobK

    7,682
    1,686
    Jan 5, 2010
    Explain what you mean by a "software architecture".

    Bob
     
  5. electronicsLearner

    electronicsLearner

    11
    0
    Mar 25, 2015
    Like as soon as i power on
    1. if some unused IO ports are available what i have to do with them? To what value should i initialize them.
    2. When should I do the EEPROM read or write either before enabling the interrupts or after
    3. As soon as power is applied what all activities i have to do?
    4. How many round robin tasks should be running and what is the minimum timing?
    i do not if all these fall in the software architecture.
     
  6. BobK

    BobK

    7,682
    1,686
    Jan 5, 2010
    1. All unused ports should be either:
    a) Set to output and left unconnected on the board.
    b) Set to input and pulled either high or low on the board.

    Never set to an input an leave floating.

    2. Generally, one would do all initialization before starting interrupts.

    3. That depends entirely on what you application is designed to do.

    4. See answer to 3. In order to have multitasking, however, you need an RTOS of some kind. That should be decided based on your requirements. If you don't really need concurrent tasks, but need to manage separate activities and keep it clean, a state machine is a simpler alternative.

    Bob
     
    electronicsLearner likes this.
  7. electronicsLearner

    electronicsLearner

    11
    0
    Mar 25, 2015
    Thank you very much.
     
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day

-