Page 2 of 3 FirstFirst 123 LastLast
Results 13 to 24 of 28

Thread: any pic experts?

  1. #13
    Registered
    Join Date
    Apr 2005
    Location
    bih
    Posts
    462
    Downloads
    0
    Uploads
    0
    Did I forget to mention that I'm using an AT computer psu? Is that a bad thing<sup>tm</sup>?


  2. #14
    Registered
    Join Date
    Apr 2005
    Location
    bih
    Posts
    462
    Downloads
    0
    Uploads
    0
    Stupid LVP
    Set all outputs to 1 and it's showing 5.1 or thereabouts on all of them.
    Everything working fine now! thanks!


  3. #15
    Registered
    Join Date
    Apr 2004
    Location
    Michigan
    Posts
    79
    Downloads
    0
    Uploads
    0
    Metal cans with two leads are crystal oscillators. You will also need to hook up two small capacitors (around 20pf) to get the crystal to resonate. The datasheet shows a small drawing of how to hook one up correctly. I usually use a 3 lead ceramic resonator since they have built in capacitors. Just a little bit easier to use.

    I did a simple stepper controller using a 16f627 which is similiar to your 628. I used the external resister ER oscillator mode. Hooked up a 1K resister to OSC1 and ground gets the chip working around 10Mhz. I used the interrupt on change B4 and B5 for step input. At 10Mhz, it was plenty fast to control 2 stepper motors. I did have to set the pulse width output of TurboCNC to about 20us. This gave the chip enough time to service the interrupt, poll the direction pins and output next step sequence.

    The 12volt AT supply will limit your overall top end speed for your steppers which should be around 300RPM or so depending on the quality of your motors. 300RPM is about 2000steps/sec for half step mode. With careful coding, the internal 4Mhz oscillator speed should be able to handle atleast 300RPM using polled port A inputs. Just set Mach2 pulse width setting high enough so you don't miss the next step pulse.


    Jim


  4. #16
    Registered abasir's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    Posts
    361
    Downloads
    0
    Uploads
    0
    My driver is my own design using the 16F628 as well (with LMD18245). I've used PORTB for input because I needed the 'Interrupt on Port Change'. With internal OSC, I'm able to handle about 30kHz step signal. No issue with pulse width because it's 'bit-change' driven.
    Stupid questions make me smarter...
    See how smart I've become at www.9w2bsr.com ;-P


  • #17
    Registered
    Join Date
    Apr 2005
    Location
    bih
    Posts
    462
    Downloads
    0
    Uploads
    0
    abasir would you mind explaining the "decoupling capacitor near each pic" bit to me? where exactly do I put it? and what would be the purpose of it? also which diode should I use between e and c of transistors?


  • #18
    Registered abasir's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    Posts
    361
    Downloads
    0
    Uploads
    0
    Put 100nF capacitor between VCC and GND as close as possible to the PIC supply pins. Switching high current (your TIP...) will cause voltage spikes on the supply lines so the decoupling caps should take care of it. As for the diode, you need to pick based on the current and switching frequencies (both is unknown to me )
    Stupid questions make me smarter...
    See how smart I've become at www.9w2bsr.com ;-P


  • #19
    Registered
    Join Date
    Apr 2005
    Location
    bih
    Posts
    462
    Downloads
    0
    Uploads
    0
    URGENT!

    Problems with a PIC

    All of a sudden, everything having worked ok so far, my PIC is just sitting there doing nothing. Now, when I say nothing I mean, it sort of initialises itself (I can see voltage on some pins) and that's it. I am using a 20MHz crystal and two 27pF caps (on my other board I'm using 20pF but the spec sheet says between 15 and 30pF so I guess I'm ok with 27)

    So it's sitting there doing nothing. I put it into another board and it's working. In this, new, board it's just sitting there even if I reprogram it with the internal resonator at 4MHz. Any ideas? I don't seem to have any shorts on this board. What would make it halt? Anything particular I should look out for?

    Thanks!


  • #20
    Registered abasir's Avatar
    Join Date
    Apr 2003
    Location
    Malaysia
    Posts
    361
    Downloads
    0
    Uploads
    0
    Check voltages on VCC/GND & MCLR. Either a short or a break somewhere
    Stupid questions make me smarter...
    See how smart I've become at www.9w2bsr.com ;-P


  • #21
    Registered
    Join Date
    Mar 2005
    Location
    usa
    Posts
    509
    Downloads
    0
    Uploads
    0
    maybe disconnect your driver board and place leds on the controller output pins untill everything looks like it is working fine.
    then reconnect, OR lift the base limiting resistors ( one side ) from your drive board ( i think i saw leds on the driver board)
    ps: maybe remove the leds from the pic pins when you you are ready to go and put then on the transistor outputs, as they will un necessarily load down the pic's o/p's


  • #22
    Registered
    Join Date
    Apr 2005
    Location
    bih
    Posts
    462
    Downloads
    0
    Uploads
    0
    thanks for yor replies chaps. sambaraga I forgot to mention that I'm having trouble with my new incarnation of linistepper rather than my own driver.

    abasir - I'll do that but I'm quite sure that's the first thing I checked. would that be the only reason why the pic would sit there doing nothing?


  • #23
    Registered
    Join Date
    Apr 2005
    Location
    bih
    Posts
    462
    Downloads
    0
    Uploads
    0
    I forgot to mention that I'm getting around 6 volts from the PSU. It should be 5, I don't know, beats me.


  • #24
    Registered
    Join Date
    Apr 2005
    Location
    bih
    Posts
    462
    Downloads
    0
    Uploads
    0
    Quote Originally Posted by abasir
    Check voltages on VCC/GND & MCLR. Either a short or a break somewhere
    Everything checks out. VCC/MCLR are connected. GND is connected too. A small peculiarity, when I switch it on and measure resistance between VDD and GND it's around 0.5 ohm and when I switch it off and measure it's 0. I hope that's ok?

    So any other reasons why the processor would sit there doing nothing? I checked step and dir and they are all getting to RAs, no problem there. It can't be software or defective pic since I plug it into another board and it works there just fine. Untill someone responds I'll switch them on side-by-side and measure all voltages and resistances and see what's different.


  • Page 2 of 3 FirstFirst 123 LastLast

    Similar Threads

    1. CNC Controller PIC 16F877 - From Brasil
      By elizeu in forum PIC Programing / Design
      Replies: 13
      Last Post: 07-28-2012, 12:21 PM
    2. PIC Open source Servo Driver Schematics development?
      By Rossz in forum Open Source Controller Boards
      Replies: 90
      Last Post: 10-26-2011, 04:37 PM
    3. Need PIC programmed
      By randyf1965 in forum CNC Wood Router Project Log
      Replies: 0
      Last Post: 03-26-2005, 06:56 PM
    4. pic chip SERIAL to step/dir and controll
      By berin in forum Open Source Controller Boards
      Replies: 13
      Last Post: 02-18-2005, 06:23 PM
    5. Posting pic from the galley
      By CNCadmin in forum CNCzone Club House
      Replies: 1
      Last Post: 07-10-2003, 06:30 PM

    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.