newbe looking for PIC advice


Closed Thread
Results 1 to 4 of 4
  1. #1

    Default newbe looking for PIC advice

    Good Day All.

    I have been looking around the internet this morning for a PIC related forum and found this one.

    I do hope you might be able to help me.

    I am looking for help and advice with a current project.

    Upto now I have been using PicAxe PIC chips for my projects.

    As the picaxe has it's own bootloader and software built into the chip, it runs much slower then a standard pic chip.

    So I need to go down the route of using a true pic chip for my project.

    I am trying to build my own stepper motor driver board to use with the Mach3 cnc software.

    I am looking at using a pic chip something along the lines of PIC16F88 as I can pick thease up cheap atm.

    I need a total of 14/15 usable io ports.

    Input
    Enable Pin.
    Step Pin.
    Dir Pin.
    Mode Select Pin1.
    Mode Select Pin2.

    Output
    Coil A.
    Coil B.
    Coil C.
    Coil D.
    Fan Control.
    Enable LED.
    Step LED.
    Dir LED.

    I want to be able to select the step modes via two side switchs, Full Step Mode, Wave Step Mode, and Half Step Mode.

    The enable and dir pins are just switched high / low inputs no rapid changing.
    The step pin only has a very small pulse, the Mach3 default pulse lengh is just 1us, but this can be adjust upto a max of 15us.

    Here is the code that is used with the PicAxe chip.
    Code:
    #picaxe 28x2
    
    setfreq em40
    
    let dirsB = %11111111
    let adcsetup = 0
    
    let pinsB = %00000000
    
    Main:
    if pinA.0 = 0 then goto no_step
    if pinA.0 = 1 and pinA.2 = 0 and pinA.1 = 1 then goto Step_CW
    if pinA.0 = 1 and pinA.2 = 1 and pinA.1 = 1 then goto Step_CCW
    goto main
    
    no_step:
    let pinsB = %00000000
    goto main
    
    step_CW:
    let b1 = b1 + 1
    goto step2
    
    step_CCW:
    let b1 = b1 - 1
    goto step2
    
    step2:
    let b1 = b1 & %00000111
    Read b1,b2
    Eeprom 0, (%00000001,%00000011,%00000010,%00000110,%00000100,%00001100,%00001000,%00001001)
    let pinsB = b2
    do
    if pinA.1 = 0 then goto main
    loop
    I know that true pic code looks nothing like the picaxe coding, but it might give you a better idea what I am trying to do.

    Now that you might have some idea what I am trying to do here comes my questions.

    (1) Am in the right forum to ask this question.
    (2) What would be the best, cheapest, and smallest pin number chip that I can use.
    (3) I understand that there are meny types of coding for true pic chips, whats going to be the easyest for a newbe.
    (4) where do I start?

    Thanks for your time.

    Best Regards.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    "Best, Cheapest and Smallest" doesn't always come in the same package.

    There's a whole heap of PICs that will do what you want, probably starting with the 16F628 (which is real easy to work with for a beginner) working up with more RAM and more features. Bare PIC chips are only a couple of $ (or less).

    PICBasic Pro is easiest for a newbe - it's also the most expensive, but then again you pay for the integral features, it's stability and maturity.

    If you go with PICBasic Pro (or it's cut-down little brother PICBasic which is a little more difficult to use due to it's stripped-down spartan way of doing things) then you are in the right forum.

    Your existing PICAXE Basic isn't too distant from PICBasic Pro (looks like your learning curve should be about 30 Seconds), that, along with a suitable PIC programmer would probably your biggest investment. Go to the MeLabs website www.melabs.com or one of their distributors, set yourself up with what you need and we'll see you back here with either stories of success or requests for help. I'm sure if you're buying a complete outfit, any of them will throw in some PICs into the bundle to get you started for free if you asked.

  3. #3
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Mad Professor View Post
    Good Day All.

    I have been looking around the internet this morning for a PIC related forum and found this one.

    I do hope you might be able to help me.

    I am looking for help and advice with a current project.

    Upto now I have been using PicAxe PIC chips for my projects.

    As the picaxe has it's own bootloader and software built into the chip, it runs much slower then a standard pic chip.

    So I need to go down the route of using a true pic chip for my project.

    I am trying to build my own stepper motor driver board to use with the Mach3 cnc software.

    I am looking at using a pic chip something along the lines of PIC16F88 as I can pick thease up cheap atm.

    I need a total of 14/15 usable io ports.

    Input
    Enable Pin.
    Step Pin.
    Dir Pin.
    Mode Select Pin1.
    Mode Select Pin2.

    Output
    Coil A.
    Coil B.
    Coil C.
    Coil D.
    Fan Control.
    Enable LED.
    Step LED.
    Dir LED.

    I want to be able to select the step modes via two side switchs, Full Step Mode, Wave Step Mode, and Half Step Mode.

    The enable and dir pins are just switched high / low inputs no rapid changing.
    The step pin only has a very small pulse, the Mach3 default pulse lengh is just 1us, but this can be adjust upto a max of 15us.

    Here is the code that is used with the PicAxe chip.
    Code:
    #picaxe 28x2
    
    setfreq em40
    
    let dirsB = %11111111
    let adcsetup = 0
    
    let pinsB = %00000000
    
    Main:
    if pinA.0 = 0 then goto no_step
    if pinA.0 = 1 and pinA.2 = 0 and pinA.1 = 1 then goto Step_CW
    if pinA.0 = 1 and pinA.2 = 1 and pinA.1 = 1 then goto Step_CCW
    goto main
    
    no_step:
    let pinsB = %00000000
    goto main
    
    step_CW:
    let b1 = b1 + 1
    goto step2
    
    step_CCW:
    let b1 = b1 - 1
    goto step2
    
    step2:
    let b1 = b1 & %00000111
    Read b1,b2
    Eeprom 0, (%00000001,%00000011,%00000010,%00000110,%00000100,%00001100,%00001000,%00001001)
    let pinsB = b2
    do
    if pinA.1 = 0 then goto main
    loop
    I know that true pic code looks nothing like the picaxe coding, but it might give you a better idea what I am trying to do.

    Now that you might have some idea what I am trying to do here comes my questions.

    (1) Am in the right forum to ask this question.
    (2) What would be the best, cheapest, and smallest pin number chip that I can use.
    (3) I understand that there are meny types of coding for true pic chips, whats going to be the easyest for a newbe.
    (4) where do I start?

    Thanks for your time.

    Best Regards.
    For a stepper controller that is fairly easy and low cost do a google search for Linistepper. Roman Black developed it, the code is available or you can buy kits from James Newton either through eBay or directly. These were my first PIC project. A cheap JDM programmer will run about 12 bucks eBay. Better a PICKit2 will run about $60 us with a demo board from Microchip (cheaper in some countries, I think). PICs are faster because you are loading them with actual hex file so they run directly, no interpreter. Here is a link to get you that linistepper : http://www.piclist.com/tecHREF/io/st...p/lini_wks.htm
    http://www.piclist.com/tecHREF/io/st...step/index.htm
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  4. #4


    Did you find this post helpful? Yes | No

    Default

    Thanks for the info.

    I will save up and buy PICBasic Pro, and a suitable PIC programmer.

    I will also have a look at this linistepper you talk about.

    Thanks again for your time.

    Best Regards.

Similar Threads

  1. GPS module - advice needed
    By flotulopex in forum General
    Replies: 7
    Last Post: - 21st July 2009, 21:05
  2. Need "PIC16F84A" Controler schematic Advice...
    By Kyo_89 in forum Schematics
    Replies: 1
    Last Post: - 27th May 2009, 23:03
  3. Advice on frequency measurement to 30MHz
    By Andy Wood in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 27th March 2009, 04:23
  4. Your OTP advice?
    By truvahorse in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 28th June 2008, 16:37
  5. Advice needed on 'neat' Project!
    By vacpress in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th February 2007, 06:21

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts