1. OCAU Merchandise now available! Check out our 20th Anniversary Mugs, Classic Logo Shirts and much more! Discussion here.
    Dismiss Notice

Easiest beginner PLC/PIC programming

Discussion in 'Electronics & Electrics' started by bradrogers, Jul 16, 2006.

  1. bradrogers

    bradrogers Member

    Joined:
    Sep 19, 2003
    Messages:
    1,900
    Location:
    Canbizzle
    Hi again all.

    II am looking at mucking around with PIC's / PLC's, as I will be studying them soon enough in tafe.

    What is an easy / affordable format to learn?? (ie basicstamp, pic micro, etc)

    I'm after something that won't break the bank, and is easy to learn as a beginner.
     
  2. Elder

    Elder Member

    Joined:
    May 15, 2004
    Messages:
    1,212
    Location:
    Brisbane
    I'll say get into PICs, cause thats what i've done :p Theres plenty of examples and communities around you will not have problems (well you will, but there will be people/places to help you when you do :p). You get MPLAB free (software environment to program in) that has some basic software simulation ability. Getting a programmer is the only real step. So thats what i'll talk about....

    My recommendation is to get what is going to make your life easiest. Sure some extra steps can seem a minor issue but when your programming, testing, programming, testing etc it is so much better to have the easiest programming environment you can.

    So, with that in mind:
    - I'd get one that is MPLAB compatible (so you can code in MPLAB then press a button to program, rather than open a seperate software program to then program your PIC)
    - I'd get one that has a ZIF socket. (worth the little bit of extra money, makes it effortless to put the chip in and pull it out, and may save you breaking the pins of the chips aswell)
    - I'd get one that has ICSP. (most/all programmers with a zif socket will have this)
    - I'd be looking at getting a usb one that doesn't require an external power supply (less effort to set up, less mess, dont need to buy power supply)

    You should be able to get this for easily under $100 at many places. Your other option is to go cheap and get a ISCP only programmer, they can be very cheap ($20?). Steer clear of the ones inbetween this range, that either dont have MPLAB support or dont have a ZIF socket or need an external power supply. Theres no reason to get one of these inbetween models when a good full featured one is not much dearer. Theres also no need to get anything dearer than $80 or so (not for your purposes).
     
    Last edited: Jul 16, 2006
  3. newSpeak

    newSpeak Member

    Joined:
    Jun 9, 2005
    Messages:
    185
    The easiest way to get into microcontollers i reckon is to buy a demo board from somewhere like futurlec. They have everything you need to get up and running with the microcontroller. You can extend the ports out to your designs on breadboard from the headers. They are very neat.

    Here is a PIC board: http://www.futurlec.com.au/PICDevBoard.jsp

    I don't really have any experience with PICs. All of my projects have used Atmel AVRs. Some people prefer PIC, some prefer Atmel. The reason i have gone Atmel in the past is avr-gcc, a free c compiler that can save you a lot of time if you are doing something complicated.

    Here is an atmel board:
    http://www.futurlec.com.au/ATMegaDevBoard.jsp
     
  4. dohzer

    dohzer Member

    Joined:
    Jan 5, 2002
    Messages:
    5,452
    Location:
    Melbourne
    Also, if you want the easiest way and haven't dealt with assembly programming before, maybe start with the 18F series PICs so you can program in C using MPLAB.
    However, for a better understanding of how they work it's probably better using assembly anyway.

    Either way, I find the PIC18F452 is a good starter as it has a bit of everything onboard.
     
  5. OP
    OP
    bradrogers

    bradrogers Member

    Joined:
    Sep 19, 2003
    Messages:
    1,900
    Location:
    Canbizzle
    Thanks for the suggestions!

    Another good feature would be to be able to interface with my Visual basic programming via Rs232, as this is all part of something I'm designing.

    I know rs232 is used to upload programming, etc, I'm looking for something that will communicate to a pc via rs232 in runtime.

    EDIT: Those Atmel links look awesome, nice price too! I'm seriously considering getting a kit. Just gotta get rego out of the way! :p
     
    Last edited: Jul 16, 2006
  6. Loser

    Loser Member

    Joined:
    Aug 18, 2001
    Messages:
    204
  7. Dr feelgood

    Dr feelgood Member

    Joined:
    May 24, 2005
    Messages:
    1,727
    Location:
    Mornington peninsula
    I'm also interested in this sorta stuff, but what scares me off it is the programing, language, compliling and fixing bugs. How easy is it for someone with zero programing skills (i bearly even understanding html) but a good understanding of electronics? Is there free stuff/programs out there to make the experiences easier?
     
  8. dohzer

    dohzer Member

    Joined:
    Jan 5, 2002
    Messages:
    5,452
    Location:
    Melbourne
    Virtually all the microcontrollers I've worked with have a USART/UART port for serial communications.
    Simply connect the UART to a RS232 voltage converter (ie. a MAX232 chip) and plug the MAX232 into your computer's serial port.
     
  9. TRG.dOinK

    TRG.dOinK Member

    Joined:
    Jun 27, 2002
    Messages:
    4,510
    Location:
    Melb East
    I learnt a bit about PLCs at tafe :)

    We used ispLever (program) and used an ispLSI 1016E (chip)

    The board is in my room... connects to a pc via parallel port.

    I remember using ABEL & VHDL to program the IC (Drawing schematic & defining inputs/outputs, cant remember what else, lots of stuff). We made traffic lights with crossing buttons.

    Btw: i dont think the atmel mega 16 is a plc but a microcontroller? We used the atmel 8051 and wrote the code in assembly language. Did alot of stuff with it, including writing data to a lcd screen which was fun :)
     
    Last edited: Jul 16, 2006
  10. fref99

    fref99 Member

    Joined:
    Aug 11, 2002
    Messages:
    839
    Location:
    Switzerland
    Hi,

    Does it have to be PIC?

    If your just looking a programming microprocessors have a look at the Atmel range, also have a look at Bascom AVR. I've played about with PIC's, Atmel's and Siemens S5/S7 PLC's and for small projects that have to be finished yesterday the Atmel/Bascom combination can't be beaten.

    Before anyone makes a comment about basic you can write "bad/unreadable" code in any language, it's just simpler/harder in some languages.

    Also have a look at the SCL programming language. It's an IEC 61131-3 norm based programming language. My company uses both Siemens and Allen Bradley PLC's and with SCL we can use the same code (with small changes) on both. You can't say the same for AWL or FUP.

    Regards
    Ian Dobson
     
  11. Goth

    Goth Grumpy Member

    Joined:
    Jun 22, 2002
    Messages:
    9,228
    Location:
    /dev/null
    If you're programming a device with VHDL, ABEL or some HDL, then it is a PLC or FPGA or similar, as distinct from a microcontroller, which you program in Basic, Assembler or C, or whatever programming language.

    If you want to learn about microcontrollers, then i would suggest the cheapest way is simply to get a PIC or AVR chip, and muck around with it on a breadboard - start by driving LEDs, and work your way up to more exotic things. I don't know of any DIY PIC programmers which are compatible with Microchip's PICSTART, but compiling the hex file and loading it into IC-Prog to burn the chip isn't too much trouble.

    AVR's require minimal programming hardware, and for that matter, neither do PIC's.

    I use the 'JDM' RS232 PIC programmer circuit, which only uses about $10 worth of common components, and will happily program any PIC, works via serial programming / ICSP, and requires no external power supply.

    If PLD's / FPGAs are more your thing, then perhaps get an Altera development board - from my experience they're not bad.
     
  12. Elder

    Elder Member

    Joined:
    May 15, 2004
    Messages:
    1,212
    Location:
    Brisbane
  13. TRG.dOinK

    TRG.dOinK Member

    Joined:
    Jun 27, 2002
    Messages:
    4,510
    Location:
    Melb East
    Yep, imo programming an 8051 microcontroller in assembly was easier than programming an PLC :)

    As goth said, start by turning on a led, then multiple leds, then make them flash in a sequence, then try using the interrupt feature, and then go onto lcd displays :D
     
  14. dohzer

    dohzer Member

    Joined:
    Jan 5, 2002
    Messages:
    5,452
    Location:
    Melbourne
    Don't forget inputs either :).
     
  15. LHEFI

    LHEFI Member

    Joined:
    Sep 1, 2001
    Messages:
    88
    I am seeing a misuse of terms here which I need to fix up.

    PLC is a Programable Logic Controller

    PLD is a Programable Logic Device
    CPLD is a Complex Programable Logic Device
    FPGA is a Field Programable Gate Array

    The last three are similar in that they are semiconductors and in basic forms are used to replace descrete gates in a design. In comlpex form they can run softcore processors like Xilinx microblaze.

    The first is actually a piece of electronic equipment which is used in process control applications. As previously stated there is an industry standard for programming PLC's and it is know as 61131 and it consisits of 6 different languages

    SFC: Sequential Function Chart
    FBD: Function Block Diagram
    LD: Ladder Diagram
    ST: Structured text
    IL: Instruction List
    FC: Flow Chart

    and indivdual PLC manufactures can and do also implement their own programming language.

    Microcontrollers are generally programmed in either ASM or C and a few different architectures are 8051, PIC, AVR, ARM, MIPS, x86, ect. I started with AVR and 8051 never really got into pic but if I was starting out now I would definetly look at an ARM7 micro like the Atmel SAM7 series. This will put you in good stead as ARM is a fairly dominate architecture.

    Cheers
     
  16. daztay

    daztay Member

    Joined:
    Feb 17, 2006
    Messages:
    1,342
    Location:
    Melbourne
    If you really want to learn theses types of chips go straight to machine code, cause at the end of the day you can write tighter code that way. I learnt basic , then did machine code and then taugh myself C. Once you under stand machine code all lanuages are easy. Programming is like speaking, you need to know what to say as well as how to say it (lanuage).
    Take the step..............

    There are 10 types of people in the wolrd.
    Those who know binanary and those who dont.
     
  17. GOATMAN!!!

    GOATMAN!!! Member

    Joined:
    Apr 10, 2005
    Messages:
    677
    Location:
    Iowa, USA
    Yeah, I don't think you have the right idea of what a PLC is....

    If you really are going to start learning them and want to get ahead, start learning about ladder diagrams.
     
  18. GooSE

    GooSE New Member

    Joined:
    Jun 26, 2001
    Messages:
    6,679
    Location:
    Sydney
    Is this the one you mean?

    http://www.jdm.homepage.dk/newpic.htm
     
  19. dohzer

    dohzer Member

    Joined:
    Jan 5, 2002
    Messages:
    5,452
    Location:
    Melbourne
    I've actually been wanting to get into programming ARM processors.
    I might look into those.
     
  20. OP
    OP
    bradrogers

    bradrogers Member

    Joined:
    Sep 19, 2003
    Messages:
    1,900
    Location:
    Canbizzle
    Yeah there is a bit of confusion between the two. Which is another reason, I'm going to start learning them.
     

Share This Page

Advertisement: