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.

Hardware ESC 8xSERVO CONTROL on PIC (Oshonsoft BASIC)

jjw

Member
Hi M,
Ok, accepted!

I looked at the suggested shift register, and note that it maybe a to high voltage, this PCB is mostly 3.3v.
If this is the best way then i'll look for lower voltage types.

The QEI is conetected to an incremental encoder (360°) for aiming. There is also a GPS which has an INTERRUPT too.
C.
Supply voltage for 74HC164 is 2.0-6.0V
 

camerart

Active Member
Hi,
I've been exploring a few choices!

The other PIC is an 18F46K20, which has PWM outputs, although I'm not sure how many and if they are suitable, so 4x SERVOs on each PIC.

The 74HC164 to control the 18F4431.

The 18F4431 has 8x SINGLE PWMs, but has probably been mentioned I think these are ruled out.

There are a lots of LED drivers and I wonder if they could drive SERVO escs?

There's a number of SERVO drivers, but to get 8x seems rare.

What do we think?
C
 

Pommie

Well-Known Member
Most Helpful Member
C,
The 8 PWMs are simply that PWM only and no good for servos. The 4431 has 2 CCP modules that can run servos so only 2 possible without jitter. Using a 74HC164 clocked by RC1 (CCP1 output) will be able to drive 8 servos.

When you say "the other chip has the bigger brain", what do you mean? The 4431 has 8k (words) program memory and runs at 64MHz. How much bigger do you need?

Mike.
 

camerart

Active Member
C,
The 8 PWMs are simply that PWM only and no good for servos. The 4431 has 2 CCP modules that can run servos so only 2 possible without jitter. Using a 74HC164 clocked by RC1 (CCP1 output) will be able to drive 8 servos.

When you say "the other chip has the bigger brain", what do you mean? The 4431 has 8k (words) program memory and runs at 64MHz. How much bigger do you need?

Mike.
Hi M,
I think 'the other chip has a bigger brain' was an answer to a previous question, so ignore it.

Ok, I'll order some 74HC164s.

While we wait, do you want to carry on testing 'your' version, or are you expecting it ot jitter?
C.
 

Pommie

Well-Known Member
Most Helpful Member
While we wait, do you want to carry on testing 'your' version, or are you expecting it ot jitter?

A working version is above (#188). It might jitter or it might not, depends if your servos can differentiate 125uS difference or if Oshonsoft is messing with the timing.

Mike.
 

camerart

Active Member
A working version is above (#188). It might jitter or it might not, depends if your servos can differentiate 125uS difference or if Oshonsoft is messing with the timing.

Mike.
Hi M,
If it's ok, I'll use the one at #217 with 'M' in the title, as it is the same as the one you mentioned yesterday, but with the added settings that make it work and compile.
C
 

Pommie

Well-Known Member
Most Helpful Member
The code in #226 has had some corrections to it so try that. Note PLL is not turned on so that needs adding.

Mike.
 

camerart

Active Member
The code in #226 has had some corrections to it so try that. Note PLL is not turned on so that needs adding.

Mike.
Hi M,

Ok, I'll test that.

I've been busy, so didn't get an answer to your "can you confirm that doing CCPR1 = 0x55AA writes 0x55 to CCPR1H and 0xaa CCPR1L?" question.

The PLL is set in "'Define CONFIG1H = 0x06 '8mHzXTL x4=32: fcmen = off: ieso = off" (Comments can be checked in the #217 program)
C
 

camerart

Active Member
The code in #226 has had some corrections to it so try that. Note PLL is not turned on so that needs adding.

Mike.
Hi M,
'live' test of #226:
The SERVO goes to the CCW endstop and jitters wildly.

Comparing #226 with #217, I can see:
T1CON has changed
PIR1.CCP1IF = 1 Has been removed.
There are no SERVOPOS in the MAIN-LOOP

OSCCON is used, which is an internal oscillator (I'm not sure if this is needed for TMR1) In CONFIG1 it is set to Crystalx4.

C
 
Last edited:

camerart

Active Member

Attachments

  • CCPR1.jpg
    CCPR1.jpg
    59.5 KB · Views: 8

camerart

Active Member
Giving up. Bye.

Mike.
Hi M,
I understand! thanks.
Let's magine, that it would jitter, once added to the full program, with other INTERRUPTS.

With so many changes and ideas, I have learnt a lot.

The 74HC164 are on their way, so don't go completely.

Cheers from Uk.
C
 

Pommie

Well-Known Member
Most Helpful Member
I'm happy to try with the HC164s but do believe that 1 chip can do everything you need. Time will tell.

Mike.
 

Latest threads

New Articles From Microcontroller Tips

Top