Results 1 to 3 of 3

Thread: newb needs advice on pic project

  1. #1
    Registered
    Join Date
    Nov 2007
    Location
    SOUTH AFRICA
    Posts
    35
    Downloads
    0
    Uploads
    0

    newb needs advice on pic project

    I don't know much about programming pic's, but would like to learn & build a pic timer with battery back up for my pool pump and later add on a few extra's.

    I have a EASYPIC2 development board from MikroElectronika and would like some advice on choice of micro chips for such a project. Eventually I want to add things like temp sensors - rain sensor - day/night sensor - wind sensor etc.

    Advice on choice of programming language & chips (16f628A/16f877A)would be great

    thanks
    anilam


  2. #2
    Registered rdenis's Avatar
    Join Date
    Nov 2009
    Location
    Canada
    Posts
    21
    Downloads
    0
    Uploads
    0
    I was in the same boat as you a couple of years ago. I started with PIC Basic initially because I knew some Basic from the mid 80's (Commodore 64) and knew nothing about C let alone Assembly Language. I started with the 12F675 (6 pins) because they were cheap cheap cheap. My first project was a boost button for a battery powered rideon toy that would double the power output of the motors by switching from 12 volts to 24 volts on the fly.

    The 12F675 monitored 3 internal timers/counters and three inputs (gas, gear position, and boost button press) and if the conditions were met would drive the output pins for an RGB LED circuit to inform the driver whether Boost was available (flashing red - stopped, red - in low gear or reverse, yellow - 10 second timer for "boost charging", green - BOOST AVAILABLE for six seconds when button pressed and held.)

    PIC Basic is easy to learn and if your timers do not need to be accurate to clock cycle resolution, then this is an easy way to get introduced. In other words, if your timers only need to be accurate to say the second, minute, or hour, and you don't need to simultaneously monitor inputs via interrupt routines, PIC Basic is fantastic - especially on the 8 lane highway PICs (8 Bit).

    I still use PIC Basic today for a lot of projects which are quick and dirty - but there is nothing like using assembly language to really control the power of the PIC - once I started getting into complex timing projects which required the use of interrupt routines, I quickly learned PIC Assembly language. I had never programmed in Assembly before but there are lots of online tutorials to help - Assembly will also force you to become intimately involved with your PIC datasheet which is where you learn the true power of a PIC.

    If you understand basic electronic theory, basic binary math and basic boolean logic, you will master PIC based assembly in no time.

    Once you learn PIC assembly, you will inherently understand C programming from reading a particular C command's description. The structure of C will also make way more sense.

    The 8 Bit pics are extremely powerful for what they pack - the 12F675 may seem like an entry level PIC (and is) but it still has an onboard oscillator, 6 I/O pins, 128 Bytes of EEPROM, 2 timers, 1 comparator, and one A/D converter with 4 inputs. It will easily handle you project you describe.

    Higher up the 8 Bit food chain you can look at the 16F9xx PICS which have more inputs, more timers, more AD converters, more comparators, more memory, LCD drivers, serial port communications, etc. - all with the same instruction set as the lowly 12F675!

    If the 8 lane highway starts getting too crowded, jump over to the 16 or 32 lane PICS such as the 18F series or 24F series - want to start playing with High Speed BUSES like CAN, these are the PICS for you. The instruction sets add a few more cool commands which will make programming even easier.

    Anyway, PICS are like heroin - once you use them, withdrawal symptoms are killer!


  3. #3
    Registered
    Join Date
    Nov 2007
    Location
    SOUTH AFRICA
    Posts
    35
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by rdenis View Post
    I was in the same boat as you a couple of years ago. I started with PIC Basic initially because I knew some Basic from the mid 80's (Commodore 64) and knew nothing about C let alone Assembly Language. I started with the 12F675 (6 pins) because they were cheap cheap cheap. My first project was a boost button for a battery powered rideon toy that would double the power output of the motors by switching from 12 volts to 24 volts on the fly.

    The 12F675 monitored 3 internal timers/counters and three inputs (gas, gear position, and boost button press) and if the conditions were met would drive the output pins for an RGB LED circuit to inform the driver whether Boost was available (flashing red - stopped, red - in low gear or reverse, yellow - 10 second timer for "boost charging", green - BOOST AVAILABLE for six seconds when button pressed and held.)

    PIC Basic is easy to learn and if your timers do not need to be accurate to clock cycle resolution, then this is an easy way to get introduced. In other words, if your timers only need to be accurate to say the second, minute, or hour, and you don't need to simultaneously monitor inputs via interrupt routines, PIC Basic is fantastic - especially on the 8 lane highway PICs (8 Bit).

    I still use PIC Basic today for a lot of projects which are quick and dirty - but there is nothing like using assembly language to really control the power of the PIC - once I started getting into complex timing projects which required the use of interrupt routines, I quickly learned PIC Assembly language. I had never programmed in Assembly before but there are lots of online tutorials to help - Assembly will also force you to become intimately involved with your PIC datasheet which is where you learn the true power of a PIC.

    If you understand basic electronic theory, basic binary math and basic boolean logic, you will master PIC based assembly in no time.

    Once you learn PIC assembly, you will inherently understand C programming from reading a particular C command's description. The structure of C will also make way more sense.

    The 8 Bit pics are extremely powerful for what they pack - the 12F675 may seem like an entry level PIC (and is) but it still has an onboard oscillator, 6 I/O pins, 128 Bytes of EEPROM, 2 timers, 1 comparator, and one A/D converter with 4 inputs. It will easily handle you project you describe.

    Higher up the 8 Bit food chain you can look at the 16F9xx PICS which have more inputs, more timers, more AD converters, more comparators, more memory, LCD drivers, serial port communications, etc. - all with the same instruction set as the lowly 12F675!

    If the 8 lane highway starts getting too crowded, jump over to the 16 or 32 lane PICS such as the 18F series or 24F series - want to start playing with High Speed BUSES like CAN, these are the PICS for you. The instruction sets add a few more cool commands which will make programming even easier.

    Anyway, PICS are like heroin - once you use them, withdrawal symptoms are killer!
    wow ok some food for thought I think I'll stick with basic for now. I will have to source some of these 12f675's in the mean time I will just use my 16f628A to experiment with?

    great thanks
    till later
    anilam


Similar Threads

  1. Need advice in my project
    By elchip in forum UHU Servo Controllers
    Replies: 1
    Last Post: 10-31-2009, 07:15 PM
  2. Need motor advice for a project...
    By kentrob11 in forum General Electronics Discussion
    Replies: 0
    Last Post: 03-21-2008, 10:05 AM
  3. Need advice, newb question here.
    By DerHammer in forum Fanuc
    Replies: 6
    Last Post: 11-13-2007, 01:23 AM
  4. Need some advice on my project
    By sigipa in forum Mechanical Calculations/Engineering Design
    Replies: 9
    Last Post: 09-16-2007, 12:43 PM
  5. Advice for a Complete Newb on DIY CNC
    By waglo in forum DIY CNC Router Table Machines
    Replies: 2
    Last Post: 04-05-2005, 08:59 AM

Posting Permissions


 


About CNCzone.com

    We are the largest and most active discussion forum from DIY CNC Machines to the Cad/Cam software to run them. The site is 100% free to join and use, so join today!

Follow us on

Facebook Dribbble RSS Feed


Search Engine Friendly URLs by vBSEO ©2011, Crawlability, Inc.