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.

Drive 33 Servos With One PIC + USART

Status
Not open for further replies.
Is there a nice simple circuit for the 18f4550 that I can use with schroeders code? This is perfect as I need to drive 20 servos...... any suggestions would be great... thanks.
 

Dear wschroeder,

You wrote an awesome code for 18F452.I am thinking of making a servo controller for my project.Could you please post the circuit diagram and the control protocol for controlling the servos from th serial port.I have experience in programming AVR but I am totally new to PIC.

Hoping for a positive reply.
 
ok, I don't get it... why aren't you just using a counter, interrupt driven serial routine (three byte min block - table addy, byte count, data ), and an endless loop?
 
ok, I don't get it... why aren't you just using a counter, interrupt driven serial routine (three byte min block - table addy, byte count, data ), and an endless loop?

Was there a particular post you were replying to?

Mike.
 
Was there a particular post you were replying to?

Mike.
No, just a very quick scan of the posts. With and interrupt routine repsonding UART to update the desired PWM values, a simple endless loop looks up the value and compares it to a time counter to reset it's pin and they all get set on the overflow interrupt.

It stalls briefly on serial reception, but that is easier to deal with than having to make time for 30 bytes regularly...
 
Could anyone please post the circuit diagram for the 18F452?Also is it possible to make a USB driven servo controller with 18F4550 (with the same efficiency as user "wschroeder" created with 18F452 for which he posted the code)?
 
i need help

Hi,

this code seems great, i m trying to use it with my robotic arm

can anybody help me to modify the code so i can drive only 7 servo motors ?

i tried to drive them using the code provided but i couldnt

should i attache the chematic diagram for 18f2550 i used ?

thx
 
hi mike,

first of all i really hope i can learn programming skills that you all guys have in this forum. i m a begginner in pic and i m looking forward i learn from you.

my project is to control a robotic arm. I achieved the first object by controlling the robotic arm with USB connection with computer and VB software.

now i designed a mobile base for the arm. my goal is to control 7 servos on the arm, and 2 DC motors of the differential mobile base.

to do this, i will use RF link. first pic is 16f628 ( or any other pic ) is the sender pic. i connected joystich potentiometers to it and used PICbasic pro to read potentiometers and send the data serially to RF transmitter. i used serout command but i think i should switch to mikrobasic and find another way with hard usart.

the second pic is 18f2550 , it is the receiving end, it must recieve the data from RF receiver and use it to generate PWM signals for servos and DC motors.

the most important thing is to generate servos signals, since DC motors could simply switched on and off ( i.e. no speed control ).

the data sent from the sending end must be 7 bytes as following

1- the first byte is for servo 1 and 2. since they are on the same joint, if receiving pic receives a byte that is equal to 200, this will be control byte for servo1, and 256 - 200 will be the control byte for the second servo
2- servos 5,6 are on the same joint also , and need only a byte
3- three more bytes for 3 other servos
4- 1 byte for dc motors ( on , off , right , or left )
5- a qualifier byte ( if needed )

my problem is how to modify the code provided in the first post of this thread to control only 8 servos. and is it possible to use usart in the way i described ? is it possible to use serout from sender pic and receive it with usart ?

i m using pic basic pro , but i m switching to mikrobasic. ( i m a beginner )
 

Attachments

  • Capture.JPG
    Capture.JPG
    101.9 KB · Views: 362
Last edited:
i forgot to mention that i m seeking one way connection between pic's.

i wont use tranceivers. i ll use 1 transmitter on the first pic. and one receiver on pic18f2550.
 
I apologize for not being able to help you with BASIC or with your particular serial protocol but some other Forum members may be able to help.

Kind regards, Mike
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top