. .

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Can you program a pic at all?
    What you actually want it to do is pretty trivial.

    However I'd change the circuit slightly. In my experience you don't generally want the holding current to fall too much - to about 25% is about right.

    So:
    The current voltage across the VR is about 1v. Get another resistor which will give you approximately 0.25v and wire that up to the top of the VR. You now have two resistors which if either is connected to the supply will either give you the desired current or 1/4 or it.

    Next take the two resistors and wire them to two of the output pins of the PIC (obviously the existing 3k9 will need disconnecting from the supply).

    What we've got now is the ability of the PIC to pull either resistor high (+5v) and thus select the current as either 1x or 0.25x.




    Some psuedo code for your pic.

    Code:
    start:
    
    loop:
     if (clock == valid)
       counter = 5Seconds;
    
     if (counter <> 0)
     {
        Line1x = high;
        Line0.25x = tri-state;
     }
     else 
     {
        Line0.25x = high;
        Line1x = tri-state;
     }
    
     if (counter > 0)
        counter = counter - 1;
    
      goto loop;
    As you can see, there's not a lot required...

    If you've got interrupt on port change - that would be best for the clock (although it'd be unlikely in sampling it over 5 seconds that you'd miss an event).
    counter can be done using a timer or in software - whatever your comfy with.

  2. #2
    Can you program a pic at all?
    No not at the moment. But tribbles has kindly offered to program one for me (and make the board ) but wasnt 100% sure on the best way to go with the code so thanks vmuch.

    Would it be ok to use 2 trim pots instead of resistors, so i can adjust for diferent motors/ applications? and is it feasable to to use a 1 sec or less timing?

    Thanks again, I'll have a go at another schematic to see if I've got the the right idea.

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Similar Threads

  1. Replies: 1
    Last Post: 16-03-2014, 07:29 PM
  2. Dc servo driver
    By Treemonkey in forum Motor Drivers & Controllers
    Replies: 11
    Last Post: 11-02-2013, 08:16 PM
  3. Driver suggestions
    By Shinobiwan in forum Motor Drivers & Controllers
    Replies: 0
    Last Post: 04-03-2012, 03:54 PM
  4. Driver wiring help...
    By mike in forum Motor Drivers & Controllers
    Replies: 12
    Last Post: 21-09-2010, 09:29 AM
  5. Driver box
    By John S in forum General Electronics
    Replies: 1
    Last Post: 21-06-2009, 12:46 PM

Tags for this Thread

Bookmarks

Posting Permissions

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