Maker Pro
Maker Pro

Embedded Software Architecture

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