CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

877a + bipolar stepper

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
o_wan
Guest







877a + bipolar stepper
PostPosted: Wed Nov 30, 2005 1:17 am     Reply with quote

I'm using 877a with half h-bridge driving a bi-polar stepper using code below, it's not quite work although it generates pulse to port B,

Is there anyone working with that too? I suspect the problem would be bit output, please debug,

byte const POSITIONS[4] = { 0b00010000, 0b00100000,
0b01000000,
0b10000000 };

void drive_stepper(byte steps)
{
static byte stepper_state = 0;
byte i;
for( i = 0; i < steps; i++ ) {
output_b(POSITIONS[stepper_state]);
delay_ms(250); //Time delay to change stepping speed
stepper_state = (stepper_state + 1)&(sizeof(POSITIONS) - 1);
}
}

main()
{
int count = 0;
set_tris_b(0x00);
drive_stepper(10);
output_b(0x00);
}
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

RE:
PostPosted: Wed Nov 30, 2005 3:08 am     Reply with quote

Hi,

Have you generated the proper pulses, (quadrature) ??

thanks
arunb
Ttelmah
Guest







PostPosted: Wed Nov 30, 2005 4:11 am     Reply with quote

A big hint has been given, but I'll be a little more explicit. When directly driving a bipolar motor, _two_ of the transistor drives, always have to be 'on', or no current cn actually flow through the coil. Your bit patterns all have single drives on (which would be useable with a unipolar motor). Without knowing how your motor is actually wired (which bit feeds which connection on the bridge), we cannot tell you what petterns are needed.

Best Wishes
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group