Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

68hc11 to the pic877a

Status
Not open for further replies.

BrianThor

Newbie level 4
Joined
Mar 13, 2017
Messages
6
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Location
Viginia
Activity points
50
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
 

Hi,

No schematic
No code

How can we help

Klaus
 

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.
 

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.
 
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.
 

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

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top