Dummy Questions About Embedded Programming

Embedded Systems Topics
Post Reply
User avatar
SemiconductorCat
Major
Major
Posts: 455
Joined: Mon Aug 22, 2011 8:42 pm
Location: currently in hyperspace

Dummy Questions About Embedded Programming

Post by SemiconductorCat » Wed May 09, 2012 2:27 pm

hi all, I have some dummy questions about embedded specially 16-bit micro controllers and microprocessors.
I'm don't have industry level experience in micros.And I do have write some kernels and firmware for x86 and
x86 based micro-controllers[8051 and 80188]. When it comes to PIC, My touch is very few, last time I had designed a feedback power regulator based on PWM theory.

I need to do complex things with disps , specially complex analog things. Like programming a filter.
BTW I have some questions to slove. Specially when it comes to reading the code.

Questions.
1. Isn't it a good thing to encourage reading the assembly listing/s? Then what is the purpose of
that functionality being there?

2. Is it a crime to do hex injections to my duplicate copy of library and change it as I need and go
with it? Need sound experience on this thing.

3. This habit comes from the desktop programming world. I used to keep manuals, API things in
books. [I'm programming for win32 since I was 1998,but still there are places that I refering the API's
and manuals]. Is this is not suitable in embedded world. [Not talking about WinCE,ELinux ,,,] ,I want to
know about PIC16-18...30.

4. Last question , what is the requirement of maths skills to understand the concepts of Digital filters ?
Can I proceed with knowing anything about Analog filters ?

Is that means I need to keep everything in my head? So it sound that if you experienced in x86 you
can't prove that your fit in the job where they use PIC's or Atmega? [ In the desktop world. this is
quite different].


-
User avatar
SevenZero
Major
Major
Posts: 263
Joined: Sun Nov 01, 2009 8:37 pm

Re: Dummy Questions About Embedded Programming

Post by SevenZero » Wed May 09, 2012 7:42 pm

1. Isn't it a good thing to encourage reading the assembly listing/s? Then what is the purpose of that functionality being there?
There is a theory in embedded called profile and optimise in the last stage of development. In simple terms it is about measuring time consumed for each functions and identify what functions needs to be optimised. It is possible to go to line level of profiling if required. For optimising, what happens is, usually the whole function (or the part which consume more time) is written in assembly. That's the purpose of using assembly in embedded development. Unless otherwise required to find a issue, it is not required to study the assembly listing. Machine generated assembly listing is mostly unreadable due to high level of optimisation. So this is not practiced. It is possible to read the assembly listing when the source is compiled without optimisation (some call this debug mode but it is about adding debug instructions for JTAG).
2. Is it a crime to do hex injections to my duplicate copy of library and change it as I need and go with it? Need sound experience on this thing.
Hex editing is mostly done for cracking by pirates. No programmer uses hex injection for embedded programming. They write their own code in 99% of the cases. So this in not practically required at all.
3. This habit comes from the desktop programming world. I used to keep manuals, API things in books. [I'm programming for win32 since I was 1998,but still there are places that I refering the API's and manuals]. Is this is not suitable in embedded world. [Not talking about WinCE,ELinux ,,,] ,I want to know about PIC16-18...30.
For PIC, Atmel type small micros, it is mostly about handling built-in peripherals & units such as ADC, PWM, Timers, Interrupts, etc... So other than the datasheet of the chip and C++ compiler manual for the compiler you use (such as HI-TECH C or AVR GCC), there isn't any special API or anything.
If you use Android on ARM, you have a set of APIs, etc... to refer.
4. Last question , what is the requirement of maths skills to understand the concepts of Digital filters ?
Can I proceed with knowing anything about Analog filters ?
An analogue filter handles analogue signals or continuous-time signals, whether electric potential, sound waves, or mechanical motion directly. While digital filter is a system that performs mathematical operations on a sampled, discrete-time signal to reduce or enhance certain aspects of that signal.
Is that means I need to keep everything in my head? So it sound that if you experienced in x86 you can't prove that your fit in the job where they use PIC's or Atmega? [ In the desktop world. this is quite different].
Exactly. Programming on General Purpose Processors and Embedded Processors. Low level programming is required for PICs, Atmels, FPGAs, ASICs, DSPs, etc... Mostly no OSs are used, just direct compilation to bootstrap. On ARM, mostly an embedded OS is involved such as Android. Since x86 programming is usually done with an OS it is close to those ARM + OS based development. Think if x86 gives you control even before BIOS routine, so you have to initialize VGA, Sound and other peripherals by yourself. Think that there is no OS so that you can do all by yourself. That's somewhat similar to the embedded environment.

Since you are familiar with C, I think you can directly start with microcontrollers. Think of automating a task at home and make it with a micro. TRONIC.LK guys have micros, programmers, development boards, etc... (One of our good friends is a partner there). They filled a huge gap on embedded electronic supplies in Sri Lanka.
Post Reply

Return to “Embedded Systems”