+ Post New Thread
Results 1 to 6 of 6
  1. #1
    Newbie level 4
    Points: 38, Level: 1

    Join Date
    Mar 2017
    Location
    Viginia
    Posts
    6
    Helped
    0 / 0
    Points
    38
    Level
    1

    68hc11 to the pic877a

    I am coming from the 68hc world into the pic world. One of my old tricks was to use a delay loop to operate a pin to drive an RC servo. Worked pretty good. I tried the same trick on the PIC877a and it is completely unstable. The wave form jitters and varies in duration. Power supply is a bench top supply (very clean). I am using an 8mhz crystal and I believe I have turned off the interrupts. I am clueless.
    BrianThor

    •   Alt13th March 2017, 20:22

      advertising

        
       

  2. #2
    Super Moderator
    Points: 39,883, Level: 48
    Awards:
    Most Frequent Poster

    Join Date
    Apr 2014
    Posts
    8,152
    Helped
    1971 / 1971
    Points
    39,883
    Level
    48

    Re: 68hc11 to the pic877a

    Hi,

    No schematic
    No code

    How can we help

    Klaus



    •   Alt13th March 2017, 21:44

      advertising

        
       

  3. #3
    Advanced Member level 4
    Points: 7,098, Level: 20
    Easyrider83's Avatar
    Join Date
    Oct 2011
    Location
    Tallinn, Estonia
    Posts
    1,267
    Helped
    296 / 296
    Points
    7,098
    Level
    20

    Re: 68hc11 to the pic877a

    No schematic
    No code
    No understanding
    No sense
    To drive servos you better use PWM module. And you better skip rotten pic and avr and start discover the power of ARM!)))
    It is cheaper and faster.
    Love me or hate me. All infractions will be ignored.



    •   Alt14th March 2017, 06:48

      advertising

        
       

  4. #4
    Super Moderator
    Points: 61,804, Level: 60
    Achievements:
    7 years registered
    Awards:
    2nd Helpful Member
    betwixt's Avatar
    Join Date
    Jul 2009
    Location
    Aberdyfi, West Wales, UK
    Posts
    10,246
    Helped
    3299 / 3299
    Points
    61,804
    Level
    60

    Re: 68hc11 to the pic877a

    And you better skip rotten pic and avr and start discover the power of ARM
    Treat that as an opinion, if it was true, Microchip wouldn't be one of the Worlds biggest MCU manufacturers.... and they use ARM cores in some PIC products anyway!

    In principle there is no reason why an 16F877A can not be used to replace a 68HC11 provided the code is re-written properly. The PIC already has a hardware PWM module which can generate the RC servo signal without using delay loops, it makes operation far easier because you just write new values to the PWM module to set the frequency and pulse width and the harware does the rest. It means your code can carry on doing something else while the RC signal is still being produced.

    Obviously we need to see your code to be sure but the description you give suggests you have the watchdog timer running and it is cyclically resetting the PIC as you try to produce the output waveform. If I'm right, you can either extend the watchdog period (assuming you reset it within the program) of disable it altogether. Disabling as a first step will confirm if my diagnosis is correct or not.


    Brian.
    PLEASE - no friends requests or private emails, I simply don't have time to reply to them all.
    It's better to share your questions and answers on Edaboard so we can all benefit from each others experiences.


    1 members found this post helpful.

  5. #5
    Super Moderator
    Points: 22,172, Level: 36
    andre_teprom's Avatar
    Join Date
    Nov 2006
    Location
    Portugal
    Posts
    6,773
    Helped
    827 / 827
    Points
    22,172
    Level
    36
    Blog Entries
    5

    Re: 68hc11 to the pic877a

    One of my old tricks was to use a delay loop to operate a pin to drive an RC servo.
    It is allways a bad idea, unless you're planning to do nothing else with your 40-pin 16F877 microcontroller than making this control. Even if you were working with a device without built-in PWM modules, you could do that without closed loop delays, but with timer interrupts.
    --------------------------------------------------------------------------------------------------
    Part of the world that you live in, You are the part that you're giving ( Renaissance )



    •   Alt14th March 2017, 22:50

      advertising

        
       

  6. #6
    Newbie level 4
    Points: 38, Level: 1

    Join Date
    Mar 2017
    Location
    Viginia
    Posts
    6
    Helped
    0 / 0
    Points
    38
    Level
    1

    Re: 68hc11 to the pic877a

    Thank you all , the PWM is a much better solution!.



+ Post New Thread
Please login
--[[ ]]--