Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PWM using ECCP on 18F14K50

Status
Not open for further replies.

Yobortsa

Member
Reading the datasheet, it seems the PWM ports (4 of them) can be configured as single, half-bridge, or full-bridge mode. I want four independent frequencies sent to each channel to control servo motors at different positions. I'm guessing that's not possible using the hardware, or is that what the pulse steering mode is all about?

I've never used the ECCP features, in fact haven't used the 18 series microcontrollers, so sorry if this is a simple question.

David
 
If you want to do the servo control in hardware then a more specialized PIC, with a Power PWM (or?) module, would be required. I have used the 18f1330 to do both the servo pulses and servo updates using the hardware Power PWM module. The 18f1330 only has three separate PWM registers though.
 
You can use the pwm module in the "Special Event Trigger" mode to generate upto 10 servo signals. See this thread for a simple and an interrupt driven version of what you need. It's only for 1 servo but it's easy to extend the interrupt version to do more.

Mike.
P.S. where about in Brisbane are you? I'm at Kangaroo Point.
 
Last edited:
Reading the datasheet, it seems the PWM ports (4 of them) can be configured as single, half-bridge, or full-bridge mode. I want four independent frequencies sent to each channel to control servo motors at different positions. I'm guessing that's not possible using the hardware, or is that what the pulse steering mode is all about?

David, it depends on how many timers your chip has ... I'm working with an 18f27j53, and it has a bunch independent timers which can be assigned to PWMs... I know it has at least three, timer 2, 4 and 6. Check out the datasheet for your chip and see if the chip has a means to select which timer is used by the respective CCP modules.

I'm not an expert on servos, but I thought the position of the pulse width controlled the position of the servo, not the frequency.
 
There are 4 pwm outputs on the 18f4k50

that's funny when I looked at the main page for the 18f4k50 it said 5 but there only 4
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top