Rules | Recent posts | topic RSS | Search | Register  | Log in

Zilog - Servo motor help

 
Post new topic  Reply to topic    EDAboard.com Forum Index -> Embedded Systems and Real-Time OS
Author Message
aredhel



Joined: 22 Feb 2008
Posts: 36


Post03 Aug 2008 2:19   Zilog - Servo motor help

Hi there! I am trying to make a mini servo motor turn in both clockwise and anticlockwise direction using Zilog Z8F042APH020SC. There are 2 buttons. Button A is to turn the motor clockwise by 180° whenever it is pressed, while Button B does the same function except the motor is moving in the opposite direction.

The type of motor I am using is Cytron of the model C8.0C, however the product website does not have product specification, but I am able to find another product that I think is similar to the one I have; it is HS-55 Standard Feather Servo with pulse width control of 1500us.

I have attached the schematic and the codes are as below:

# include <eZ8.h>
void main (void)
{
long D;
int PButton = 0;
PBDD = 0x00;
PBAF = 0x08;
T1RH = 0x08;
T1RL = 0x00;
T1CTL0 = 0x00;
T1CTL1 = 0x03;
PButton = PBIN;

while (1)
{
switch(PButton)
{
case PB1:
for (D = 0; D < 300000; D++){}
T1PWMH = 0x01;
T1PWML = 0x80;
break;

case PB2:
for (D = 0; D < 300000; D++) {}
T1PWMH = 0x0C;
T1PWML = 0x80;
break;

default:
break;
}
}
}
Back to top
themask



Joined: 05 Mar 2008
Posts: 3


Post27 Aug 2008 6:53   Re: Zilog - Servo motor help

where is the schematic?

and what PORTB pins did you connect the 2 PBs?
Back to top
Post new topic  Reply to topic    EDAboard.com Forum Index -> Embedded Systems and Real-Time OS
Page 1 of 1 All times are GMT + 1 Hour


Abuse
Administrator
Moderators
topic RSS 
sitemap