Zilog - Servo motor help

Status
Not open for further replies.

aredhel

Member level 2
Joined
Feb 22, 2008
Messages
50
Helped
1
Reputation
2
Reaction score
1
Trophy points
1,288
Activity points
1,800
how to control servo motor using the zilog

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;
}
}
}
 

controlling servo in zilog

where is the schematic?

and what PORTB pins did you connect the 2 PBs?
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…