Code check and refinement suggestions?


Closed Thread
Results 1 to 24 of 24

Hybrid View

  1. #1
    Join Date
    Dec 2005
    Location
    Salt Lake City, Ut, USA
    Posts
    108


    Did you find this post helpful? Yes | No

    Default Re: Code check and refinement suggestions?

    Hello Henrik.

    If you don't see a large problem with me wiping the individual characters, than I'll give that a run. As far as "live" testing, not as of yet. I designed and etched a board some time ago that I just plop different code on when it hits me. As far as the purpose of this code, I have dreams of hooking it to a dc brushed gearhead motor that I fitted with an encoder (not a true servo motor ) that will be mounted to a rock tumbler. The board will monitor, as I'm sure you can tell, voltage, current, temp and rpm (through the index pulse of the encoder). The power supplies are 2 HP ESP120 (51.4V, 57A) 3KW server supplies wired in series. Right now, you're probably thinking WTF! Why would he run those? Well, all I can say is, they're the cheapest power you'll ever find . I've juiced 'em in series, and they haven't missed a beat. The only tricky part is isolating the high-side supply from earth as well as humans. I have them both in a fully insulated 1/4" polycarbonate enclosure. As far as wanting the code for the pic finalized (or almost) before the first run is nothing more than it's kinda a pain in the butt doing the remove, burn, reinsert routine (the LCD is mounted on stand-offs above the chip carrier as well as no ICSP on my board). If you think I've got workable code, I'll go for it. Do you have any slicker ways to get finer RPM from my encoder scheme? I have to admit that I have brain fried over that part!

    Thanks again Henrik,
    Chris

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,605


    Did you find this post helpful? Yes | No

    Default Re: Code check and refinement suggestions?

    Hi Chris,
    As long as it works I have no problems and, like I said, "erasing" the individual characthers sounds like the best solution.

    Sounds like a fun project! Be careful, lots of power there!

    Since your chip has a USART and you're laready using it to communicate with a PC (by the looks of it) I'm assuming the board has a MAX232 or similar device so why not use a bootloader to get the code into the PIC? (And next time, put a ICSP header on there...)

    As for the RPM, since you apparently aren't interested in direction and/or position why not run one of the A/B channels of the encoder to a timer/counter input and configure the appropriate timer in the PIC as a counter. Read it at every TMR1 interrupt and you have motor speed.

    /Henrik.

Similar Threads

  1. Replies: 3
    Last Post: - 13th September 2008, 17:40
  2. Your Suggestions: Assembly code material?
    By dw_picbasic in forum General
    Replies: 1
    Last Post: - 2nd February 2007, 17:33
  3. Can some one please check my code out thanks
    By Jhdgkss in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 10th February 2006, 08:19
  4. Pushbutton code routine suggestions?
    By jessey in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd September 2005, 01:02
  5. Code check (sorry)
    By barkerben in forum General
    Replies: 5
    Last Post: - 30th November 2004, 15:54

Members who have read this thread : 0

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