I want to be fluent at c programming to start Embedded sytem
I want to be fluent at c programming to start Embedded sytem
Try "Programming From the Ground Up", which teaches assembly without assuming prior programming knowledge. It should give you a good idea on how a processor actually functions and how programming languages actually work. From there, it should be easy to move to C.
Besides playing with theory, fundamentals and C good books on embedding, if it is possible get a reasonably complex yet easy to use board. I suggest not to start with Arduino, as it is so easy to keep you far from the real C-language Vs Embedded systems. Maybe better a TI MSP launchpad IMHO; are also easy to program, study and includes more stuff to experiment with. Cheap and with a very good wide range of boards in the same ecosystem.
Remain the fact that the most interesting "school" where you can learn by yourself is exploring challenges and projects on this community and start interacting with us. If you already have not yet a board check the features, roadtests and already done experiments on some embedded boards on Element14 community to see limits and possibilities:
(*) - Also available an Arduino IDE-like development environment but I suggest to try with the more consistent C WIndows visual development environment provided by the producer and downloadable for free
(**) - A bit more complex family of embedded devices as are Linux based machines but also a good workbench for C programming. The advantage is that the more complex hardware controls and experiments can integrate the base C development (mostly with Eclipse or NetBeans IDE derived environments) with higher level languages like Python.
(***) - These platforms have the advantage of the availability of a wide range of experiments and samples, well documented and well working. The Cypress development environment is also helpful for the better understanding of the relationship between the bare C coding for embedded micro controllers and hardware circuitry and design with almost inexpensive components add-ons
This is a reductive scenario but may give you an idea of the different flavours you can count on.
I'm glad for you.
What's a sytem?
This program will make your computer loopy!
void main(){for(;;);}
The best path to learn c is on a unix/linux console based platform (like BBB and RPi) and once you've become proficient at that then migrate to embedded systems.
C programming with embedded systems is more complex because you will need to deal with hardware specific details and be quite #pragma tic.
With MSP43x you'd be dealing with statements like;
SIMCO &= ~0x07;
With AVR programming;
#pragma interrupt_handler isr_t1:iv_TIMER1_COMPA
With PSOC programming;
saved->clkSelectReg & CY_SYS_CLK_SELECT_DIRECT_SEL_MASK) != CY_SYS_CLK_HFCLK_IMO
All of which are hardware specific and make no real sense to the learner.
If you plan to play with Arduinos then download and play with PROCESSING on your PC. It's where the Arduino IDE was spawned.
Processing was designed to make C programming easy for quick results for Arts Students.
Enjoy!
Sorry but I'm with Enrico with this - start on simple embedded boards.
I would recommend a ARM Cortex based part, probably one of the ST Nucleo boards but the TI Launchpads are good too.
If you want to learn C for embedded stuff then keep away from Linux targets for now.
Compact is being a bit naughty with his examples which are chosen to look obscure:
SIMCO &= ~0x07;
can be written like this:
foo_register = foo_register & 0xf8;
and what the line of code is doing is clearing bits 2 down to 0 in the register. (SIMCO or foo_register are just names for a variable which has been set up to be in the memory location of a control register in the processor).
The best book, not only about C, but the best programming language manual ever is "The C programming Language" (this is only an opinion ).
You'll still need some tutorial stuff to go with your chosen board but if you stick with TI or ST you'll be OK.
MK
There's nothing sinister at all.
NXP, Cypress, Zilog, MicroChip and Silicon Labs are also great microcontroller manufacturers.
Using mbed, you don't have to install any software at all!
What is SIMCO?
And why would one need to have __RESET_WATCHDOG(); included in their code to make something work with an MSP430?
Neither these are defined in C.
if (SIMCO=(4==0)) x=5; x=3;
There are far too many technical considerations (development potholes) for the learner to worry about trying to learn c on an embedded system IDE.
They'll have enough time deciphering standard statements like this.
while(a=b){switch(a){case 0:a++;continue;case '5':b=b/*a*/%b;continue;default:--a;break;}b+=a<<1;}
Hopefully the influent C is not F fluent
I think the definition of the embedded systems is changing. First, it was a system which has a dedicated job. However, chip prices go down dramatically and programming becomes easier so it is not really clear a system is embedded or not. I think there are two paths (there are more actually). One is using embedded Linux, you can use beagle bone black or raspberry pi. The other one is bare-metal programming which requires hardware knowledge.
If you want to use embedded Linux, it is pretty close to computer programming. You just need to know some basics of hardware and write your code. It is mainly programming. I am not the embedded Linux user so I can't advise on this option.
If you prefer to bare-metal, you need to learn the details of the underlying hardware. Some cases, you need to deal with registers but this will teach you how the things are working. You also need to know basics of computer architecture because you are controlling a tiny computer and understanding how it works makes things very easy. If you want to be an expert, I don't suggest using Arduino because it use a king of hardware abstraction and you will work more on software. I suggest using TI MSP, it is harder than Arduino but you will know how the things are working. TI is also good for providing the resources, there are many official documents you can find to learn each peripheral.
You don't need to be expert before you dive into embedded systems. If you know the basics, you can start and in a time you will become an expert.
Mehmet
Bare metal programming just requires something corrosive like Acids and Bases.
One mol and its gone!
itispossibletomakeenglishprettyincomprehensiblebyignoringtheusualconvetionsofpunctuationanduseofwhitespacedoinginresponsetoareasonablerequestforassitancefromabeginnerisntverynice
MK