How can i learn c for embedded system

Discussion in 'Embedded Systems and Microcontrollers' started by chris92, Mar 22, 2014.

  1. chris92

    Thread Starter New Member

    Nov 13, 2013
    7
    0
    Hi everyone i am a beginner in embedded system but quite experienced in high level programming languages. Am looking for the past 2 months how to get started with programming PICs with C language using mikroC. I have downladed a lot of their manual but it seems not to be helping. Thanks a lot
     
  2. Alec_t

    AAC Fanatic!

    Sep 17, 2013
    5,801
    1,105
    In what way is it not helping?
    Have you googled for online tutorials?
     
  3. chris92

    Thread Starter New Member

    Nov 13, 2013
    7
    0
    Yes I have but just keep getting different abstract solution. Can you at least help me with a link?
     
  4. ActivePower

    Member

    Mar 15, 2012
    155
    23
    Is this not good enough? MikroC is just a compiler. If you don't feel at home with it feel free to switch to a different one.
     
  5. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
    What exactly are you having trouble doing? Is it simply getting the MikroC programs to run, or is it starting a project, or writing code that the compiler will accept?
     
  6. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    Perhpaps then it would be better to ask more specific questions.
     
  7. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    You can not learn how to swim without getting wet. And the same goes for embedded C. You have to use it in order to learn and like evrything some learning curve must be anticipated . A way to learn may be to create projects that you find interesting and at the same time fits your learning curve. Start simple like lighting and blinking LEDs. Then move to reading buttons. After that maybe learn to use ASCII LCD displays. At this moment making a clock could be a cool project. Along the way you must learn to use all the diferent debugging methods at your disposal.
     
  8. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,392
    1,606
    I don't know of anything for the Mikro compilers but here's something:

    Check into the PICkit 3 Starter Kit. Here's some features:

    The PICkit 3 Low Pin Count Demo Board is an update to the PICkit™ 2 Demo Board. Modifications to the previous LPC board (DM164120-1) were made so that the full functionality of the code can be debugged without the need of a debug header. The software has also been rewritten to accommodate new technologies.

    The following is a list of new features:
    1. Software is in both the ‘C’ and assembler language
    2. Extension of the number of lessons and modules covered
    3. MPLAB® X support as well as the older MPLAB® 8
    4. New PIC16 enhanced mid-range and PIC18 routines
    5. Uses the universal XC8 compiler

    The board package contains one assembled board with area for prototyping circuits. The assembled board is populated with the PIC16F1829-I/P. It also ships with a sample of PIC18F14K22-I/P (20-pin) MCU.

    The board schematic is available in the PICkit™ 3 User’s Guide (DS41628), Appendix A.

    Even if you don't buy the kit you can follow the program lessons and run the code inside the simulator.
     
  9. chris92

    Thread Starter New Member

    Nov 13, 2013
    7
    0
    Thats what i actually want to start with but what would help me do that at least. I just need a guide and i will be good to go. is there a text book than can at least explain to me the codes involved in blinking a led or reading buttons. Thanks a lot to everyone contributing to help me "walk"!
     
  10. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
  11. John P

    AAC Fanatic!

    Oct 14, 2008
    1,634
    224
  12. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,810
    834
    What other high-level languages have you programmed in? Most recently, I was programming in FreeBasic. Then, last weekend, I had written my first program in C in a couple of hours, with one piece of assistance from a forum.

    I was programming on the Arduino. First, I started with their "blink" example, which taught me the basic template of a C program.

    Then, on their home page, is a quick reference link to the keywords it supports, each one being a link to a more complete description of the syntax.

    That was almost all I needed. My error was misconstruing/confusing the syntax between assignment operators and comparison operators.

    So it isn't a daunting task. Get that first demo program running, and start writing your code. Now, bad coding practices will make any language difficult. Start with a flowchart, other diagram or pseudo-code of what you want your program to do before actually coding it in the language of choice. A couple of other pieces of advice:
    • Note whether the language requires all variable or functions to be defined before use.
    • Note if the language requires strong typing (an integer is not a character is strong typing).
    • Note syntax requirements (use of semi-colons at the ends of statements, use of braces to signify blocks of code, use of parentheses to identify calculations and sequences...)
    • Note what libraries are available for any complex tasks you wish to do. I used a servo control library.
     
  13. cravenhaven

    Member

    Nov 17, 2011
    34
    2
Loading...