PC to EUART on pic 16F688


Closed Thread
Results 1 to 11 of 11

Hybrid View

  1. #1
    Join Date
    Sep 2008
    Posts
    6


    Did you find this post helpful? Yes | No

    Default

    I don't understand what:
    Pauseus (pw>>2)
    Pauseus (pw>>2)
    does? I can't find anything like this in the manual. Also why is it in there twice for each servo? Do the disable and enable commands negate this anyway if this code is somehow allowing interrupts to happen?

    To Joe S.:
    In other words, my netburner card isn't pulling high properly so I should make it open collector output and put a pull up resistor on the data line and that should correct some problems?

  2. #2
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default

    pw is a variable
    >>2 shifts right two places

    Look at the Math Operators section.
    Dave
    Always wear safety glasses while programming.

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by docaberle View Post
    I don't understand what:
    Pauseus (pw>>2)
    Pauseus (pw>>2)
    does? I can't find anything like this in the manual. Also why is it in there twice for each servo? Do the disable and enable commands negate this anyway if this code is somehow allowing interrupts to happen?
    I screwed up anyways. They're supposed to be Pauseus (pw >> 1 )
    >> is right-shift, same as divide-by a power of two (>>1=/2, >>2=/4, >>3=/8 and so on). If you right-shift a number by one bit, it's the same as divide-by-2. Same thing for a left-shift, << , multiplies a value by a power of 2.
    I put that in there to split-up the long pause to give the serial port interrupt a chance to kick in.
    At 2400 baud, a byte takes about 4.16ms to arrive. While that is a longer time frame than the pause for the servo, it was just an off-the-head change I thought might help. Might help to split the servo pause into more 'chunks', might not, might help to totally rewrite the code, then again, maybe what you've got is sufficient.

    And DISABLE and ENABLE only disable and enable the PBP interrupt trapping and jumping to the PBP interrupt routine. The interrupts still happen, the bits still get set, but PBP doesn't do anything about them. For instance, if you DISABLE the interrupts, but manually check the individual interrupt flag bits in your code, you can still figure out if an interrupt hit or not.

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


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by docaberle View Post

    To Joe S.:
    In other words, my netburner card isn't pulling high properly so I should make it open collector output and put a pull up resistor on the data line and that should correct some problems?
    I do not know what your netburner is doing. In my use, herserin works better if held high with a resistor and hooked up to ??? which idles high and sends data Open True. Here is a really quick test, pull the serial line from the netburner and hook it to +, boot and after boot hook it back to netburner (quickly), if that solves the problem then my suggestion should work.
    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.

Similar Threads

  1. Replies: 24
    Last Post: - 2nd October 2017, 11:35
  2. Send data PIC to PC
    By konter in forum Off Topic
    Replies: 6
    Last Post: - 25th December 2009, 22:04
  3. Replies: 67
    Last Post: - 8th December 2009, 02:27
  4. HSERIN & Interupts (aka controlling PIC programs from a remote PC)
    By HankMcSpank in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 17th June 2009, 14:46
  5. Replies: 11
    Last Post: - 12th July 2008, 02:36

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