HELP GETTING STARTED WITH PROGRAMMING PIC or ARDUINO

Discussion in 'Embedded Systems and Microcontrollers' started by HighVoltage!, Sep 18, 2015.

  1. HighVoltage!

    Thread Starter Member

    Apr 28, 2014
    95
    0
    I finally talked myself into learning how to program. I need help how do I get started, what do I need/why, and the difference between PIC (just a mircocontroller chip?) and Arduino. I also heard about a programming software called LDmicro which will allow you to program similarly as if your programming a PLC. Is this true? Your help will highly be appreciated!!!!!
     
  2. shteii01

    AAC Fanatic!

    Feb 19, 2010
    3,398
    497
    Arduino is a board, not a chip, it has:
    - uC chip
    - voltage regulator chip
    - USB to Serial communication chip
    - a couple LEDs that you can blink or use in the program to monitor stuff

    And Arduino provides the software platform so you don't need to assemble the tool chain like:
    - editor
    - compiler
    - serial monitor

    In conclusion. Pick a board, follow software installation instructions on Arduino website, do a few tutorials on Arduino website, if you need specific function then check the list of available functions on Arduino website.
     
    JohnInTX likes this.
  3. ISB123

    Well-Known Member

    May 21, 2014
    1,239
    527
    There is no difference they are all MCUs and are programmed in C#.
     
  4. JohnInTX

    Moderator

    Jun 26, 2012
    2,348
    1,029
    I would start with Arduino as well. Buy a cheap one, read the documentation and try some examples. Then try some projects from Sparkfun, Adafruit or search here on AAC. Arduino is a canned, ready-built system that has all of the grunt-work done for you. It would be way simpler to start with than PIC. A lot of people (including me) have disparaged Arduino but you can't argue with its success and simplicity.

    Keep in mind that 'learning programming' involves the bringing together several skill sets:

    First, you have to be able to state a problem and solve it in a procedural way - for example, drawing out a flow chart on paper. Lots of beginning programmers want to skip this basic step but the reality is if you can't solve the problem on paper, you won't be able to program a computer to do it. (I've been at it for decades and pretty much whenever I get bogged down its usually because I haven't done this important step. Coding is easy, its the problem-solving that can be a challenge) Start with something simple and flow it out - maybe the notorious flashing LED.. As you draw out the sequence, you'll be surprised at how many things you have to know/decide to perform this simple task - how to turn it on and off, how to time the switching etc...

    Once you have a flow chart its time to put it on some hardware - Your flow chart will tell you what kind of things that the computer needs to do to perform your paper implementation of the solution to your problem. So now you have to learn the language of the computer (C, assembler etc) that it takes to describe your problem solution to the computer. To do that, you'll need to read up on the language and most importantly, read through examples of how it is used to implement the various things that your solution requires. As you do that, you'll begin to see things in the examples that apply to your solutions. Learn from those but avoid the temptation to try to find posted code that does exactly what you want. It probably doesn't.

    Finally, implement your solution (or attempts!) on some actual hardware. Here's where the Arduino shines - it has all of the hardware stuff figured out for you - just hook it up to power and a PC and you are ready to go. Try lots of simple stuff first - turn on an LED then halt. Turn on an LED, delay, turn it off and loop forever. These things will give you the feel of the programming process Edit-Build-Load-Run-Debug - Repeat.. forever :)

    Once you get that far, you'll have a nice base to build on. If you crash, go back to some saved success and run that. Proceed from there.

    As you get more comfortable, you can read up on more advanced programming techniques but that will get you started. Take things in small steps with an eye towards acquiring a set of tools i.e. 'how do I do math?' 'how can I organize this data better?' 'how can I write this so I can use it again?' etc.

    Just my .03
    Have fun!
     
    Last edited: Sep 19, 2015
  5. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,395
    1,607
    What device and language you start with really does not matter very much, because in not too long a time if you really get to know your stuff you will pick devices that work the best for you for your projects and your own knowledge and temperament.

    Do get a pre assembled board with a programmer and some sample programs and tutorials. Follow the samples and then try to adapt them to your own needs, but only after you learn the basics like reading a button, lighting a LED, sensing a voltage, etc.

    I strongly suggest also getting an in circuit debugger so you can watch the code as it runs in your device.

    I also strongly suggest NOT starting with assembly language. Learn it later if you want, do not start with it least you learn some horrible coding style.
     
    djsfantasi likes this.
  6. djsfantasi

    AAC Fanatic!

    Apr 11, 2010
    2,815
    834
    When selecting, keep in mind the extended capabilities.
    There is a market for the Arduino of modules or "shields", which easily add functionality to the Arduino platform. I don't know what the market for add-ons is for a PIC.
    You can get pre-built Ethernet, wireless, SD external storage, LCD display interfaces, real time clocks, MP3 players... (these are some that I've used). All are plugged into the main board, are typically stacked and have canned functions to use in your program.
    You probably not need them now if you are first learning how to code. But it's nice to know they are there.
     
    Last edited: Sep 19, 2015
  7. ISB123

    Well-Known Member

    May 21, 2014
    1,239
    527
    I'd say that he should build his own expansion shields otherwise he is going to be lost when time comes to design something functional using IC's,passives,relays,etc..
     
  8. RRITESH KAKKAR

    Senior Member

    Jun 29, 2010
    2,831
    89
    I have started with 8085 then PIC micro
     
Loading...