Connect with us

Programming languages and MC selection.

Discussion in 'Microcontrollers, Programming and IoT' started by HellasTechn, Oct 25, 2018.

  1. HellasTechn

    HellasTechn

    1,360
    190
    Apr 14, 2013
    Hello friends. I am new in the world of Microcontrollers. I want to learn a programming language and build a few projects i have in mind.
    I only know very little Picaxe BASIC language since i have used Picaxe chips 2-3 times. They are really nice and user friendly together with the software that Revolution Education provides for free. They need no Programmer and in general i thing they are very good to start with. They do have certain limitations though like for example a very limited memory for variables (only 27 byte variables or 13 word variables). Once i tried to use Greac Cow Basic but i never got it figured out :(
    Anyway... I think i want to learn C language and start working with Pic Microcontrollers. To be honest though it looks very very complicated and i have no clue where to start from. I have tried reading books about C language but it is hard for me to understand it. Even harder when it comes to Programming Pics with C.

    I welcome suggestions and thoughts !

    THANKYOU !
     
  2. Minder

    Minder

    2,706
    563
    Apr 24, 2015
    There is some online tutorials from Gooligum Australia, there is a fee for the full blown course, but there is a bundle that is free including both Assembly and C.
    Should be enough to get you started.
    The small 8 pin 12F versions have a few features to get you started,
    M.
     
    HellasTechn likes this.
  3. BobK

    BobK

    7,380
    1,559
    Jan 5, 2010
    It is probably better to learn C on a PC before trying to program PICs with it.


    Bob
     
    Hellmut1956 and HellasTechn like this.
  4. kellys_eye

    kellys_eye

    4,289
    1,143
    Jun 25, 2010
    I've used PIC Basic Pro in the past which I found to be very intuitive and very easy to learn. There is (or was.... might not be now) a free download version - limited capabilities of course - for you to get an idea of how it works and the full documentation is also available.

    It's been around for 15 years now and has an active forum where you can get assistance with programming problems and/or find routines ready-written for you.

    Website http://store.melabs.com/cat/pbp.html

    Documentation http://pbp3.com/downloads/PBP_Reference_Manual.pdf

    The reference manual itself is a self-teaching guide (to a basic extent) and once you've read through it you will appreciate the simplicity of PIC Basic Pro. You will need your own PIC programmer but these are easy to come by anyway.

    Control of (say) a multi-line LCD is straightforward using the LCDOUT function, there are single line functions for PWM, serial, I2C, USB communication etc. Very easy.....

    This way is nice and simple for those that only have a personal requirement for programming but isn't so good for carrying forward to industrial/commercial environments where an in-depth knowledge of C would be advantageous. Personally I've avoided going down the C route where ever I can purely for the complication!

    <edit> there is a free Student version available (for use with a limited range of PIC processors) but finding a full, unrestricted version is advertised on Google!
     
    Last edited: Oct 25, 2018
    HellasTechn likes this.
  5. HellasTechn

    HellasTechn

    1,360
    190
    Apr 14, 2013
    That is interesting.
    The truth is that i do not want goo deep into basic because i am interested in building custom automations.
    For example i once made a pet feeder with a Picaxe 14m2 and a simple code involving timer, high and low commands. there was no LCD or keyboard just a rotary switch...
    In order to build something a little better i think that C language is the only way.
    One other thing that drives me crazy is the programmer required by Pic's.
    I bought a chineese pickit3 and it is a nightmare to find drivers for and is pretty much useless.
    I have found MPLAB pickit3 programmers that only support a number of pic microcontrollers. And then i ask myself is it a good idea to pay for a programmer that will be useless for my next project if i dont get to use the same or a supported chip?

    On ebay today i found other Microchip Pickit3 programmers that are very expensive about 80-90 usd... Thats crazy.
     
  6. Bluejets

    Bluejets

    2,976
    578
    Oct 5, 2014
    Go for Arduino.
    Couple of clone boards to keep cost low and some sensor modules.
    You won't look back and if you want to advance with C later then great as Arduino is built around this.
    IDE is free as is most of any software you can access. Assistance is available through the home site forum with some very helpful, knowledgable people.
    Program via an onboard usb ttl converter as in the Arduino Uno or get your own usb/ttl unit and go small with the Arduino pro mini. Many add on unit modules and shields available for pretty much anything you can think of. Most small modules can be bought from Ebay for $2-$3 delivered. Clones are cheap and for the last 10 years, never had a dud yet.
    Picaxe use translators and an onboard bootloader which slows and restricts the micro. Arduino do not have these issues. A large amount of programming is simplified by #include library<whatever> where much of the hard work is done for you. Easy.
    I think you'll enjoy it.
    Start simple, do small projects first and try to avoid copy and pasting programs, rather write all the details in the editor yourself( learn much more and more quickly)
     
    HellasTechn likes this.
  7. kellys_eye

    kellys_eye

    4,289
    1,143
    Jun 25, 2010
    You can get generic PIC programmers for only a few $. They require no more than the ICSP connections and are easy to build yourself if you wish.
    My own PIC programmer uses the Velleman software but isn't actually a Velleman device. Works on every chip I've ever used.
    But Arduino is definitely another approach albeit not being a PIC device. There is a plethora of libraries and interface devices that connect 'straight up'.
     
    HellasTechn likes this.
  8. Hellmut1956

    Hellmut1956

    46
    3
    Aug 11, 2014
    An interesting, very successful and easy to understand is "Python 3.x". You can install it on your PC, if nots already there and besides the PC it also is extensively supported on any microcontroller, those systems called "embedded".
    Here the link to download Python for Windows. Do not choose Python 2.7 as it is not developed anymore. But the amount of libraries and tools for that version has not yet been reached by version 3.x.
    For excellent courses, all obviously available for free, register at Coursera in this course i.e.. The one giving the lessons is Charles Severance. He is excellent teacher and specially I like that he promotes free learning and free reading material. His book about Python programming that is a reading material for the course is for free available to download. Go to this link to download the book in many formats for free!.
     
    HellasTechn likes this.
  9. HellasTechn

    HellasTechn

    1,360
    190
    Apr 14, 2013
    Thank you all so much !

    The arduino are an excellent choice i think. There is only the thing that i want to build my own boards and that is why i would like to use PIC mc's.

    I found lessons on youtube about C language (in my language) that are extremely helpfull. The lessons are not about C and mc's but still are usefull.

    I must admitt that arduinos are very easy to use and program. Only if there was a way to use them as "standalone chips"...
     
  10. kellys_eye

    kellys_eye

    4,289
    1,143
    Jun 25, 2010
  11. HellasTechn

    HellasTechn

    1,360
    190
    Apr 14, 2013
    So i will need a platform on which i will insert the chip to load my code. Right ?
    And then just remove the chip and put it on my custom board and start working with it.
     
  12. HellasTechn

    HellasTechn

    1,360
    190
    Apr 14, 2013
  13. kellys_eye

    kellys_eye

    4,289
    1,143
    Jun 25, 2010
    The 'chip' version have bootloaders pre-installed and the datasheet will advise the pinout to use for programming purposes. I believe (citation needed) that you can do this in-circuit in the same way as ICSP on PICs.....

    <edit> you beat me to it!

    The device should have a data sheet available for it.

    <edit> here http://www.hobbytronics.co.uk/datasheets/Arduino-ATmega328-with-bootloader.pdf
     
  14. kellys_eye

    kellys_eye

    4,289
    1,143
    Jun 25, 2010
  15. HellasTechn

    HellasTechn

    1,360
    190
    Apr 14, 2013
    Ok the site you linked me states that i only need a pc with a hardware serial port (which i actually have) and a transistor level shifter circuit. That should be easy since i have used the same circuit in the past to feed serial from my pc to the picaxe. it should be the same...


    P.S.
    Does anyone know how many digital inputs/outputs does the atmega 328p-pu with the arduino r3 bootloader have ?

    because in the project i have in mind i will need 16 I/O pins (2 for serial comm and the rest for setting leds high and low).
     
    Last edited: Nov 16, 2018
  16. Bluejets

    Bluejets

    2,976
    578
    Oct 5, 2014
    Don't know why you don't just get a pre-made clone board with all the features, simply plug in to a usb port on your pc. If you want to play with aux gear, get a pro-mini with a usb/ttl adapror.
    Enough to learn and watch out for as it is without having to muck about with level shifters or whatever.
    (surprise) ....Spec sheet gives the i/o's
    https://au.mouser.com/ProductDetail...mel/ATMEGA328P-PU?qs=K8BHR703ZXguOQv3sKbWcg==
     
  17. HellasTechn

    HellasTechn

    1,360
    190
    Apr 14, 2013
    Because i want to be able to design my own PCB's. That is why i want to find out if/how i can have a board to download the codes on the chip and from there take the chip and put it on my hand made custom pcb.

    It may sound weird to you but i am used to making my own boards and i am not keen in useing project boards.
    It's just me...

    I am asking because i dont know if the bootloader is "re configuring" the ports and if it does, in what way.
     
  18. Bluejets

    Bluejets

    2,976
    578
    Oct 5, 2014
    You can still make your own boards and have a set of sockets with an Arduino promini plugged in and make life much simpler and get on with more important things in your project.
    Maybe it's me but I really can't see the point.
     
  19. Minder

    Minder

    2,706
    563
    Apr 24, 2015
    I wouldn't go to the trouble of etching my own boards when you can get them made professionally for a couple of $$'s.
    I have used a few of the Chinese suppliers such as PCBway etc.
    Qty 5 100mm x 100mm double sided boards, through via's and silk screen etc. $5.00
    Schematic capture such as Kicad is free.
    M.
     
  20. HellasTechn

    HellasTechn

    1,360
    190
    Apr 14, 2013
    I see your point but i still want to use the chip alone. Besides in simpleprojects like the led flasher after downloading the program on the MC, the rest of the board is not used (except the power supply section).

    What about shipping cost ? and then again i like eatching boards.
     
Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.