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

stepper motor controlled using sd02b

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



Joined: 02 Nov 2016
Posts: 1

View user's profile Send private message

stepper motor controlled using sd02b
PostPosted: Wed Nov 02, 2016 1:18 am     Reply with quote

Can anyone help me give an example of code to control stepper motor using sdo2b driver ? I'm using a pic18f4550 microcontroller.
Thanks in advance.
Ttelmah



Joined: 11 Mar 2010
Posts: 19549

View user's profile Send private message

PostPosted: Wed Nov 02, 2016 2:07 am     Reply with quote

This is a 'help' forum, not a 'write it for you' forum.

This is easy to drive. It accepts TTL serial. Direct connection to the PIC's RX/TX (RX on PIC to TX on the unit, and vice versa). Look at the UART examples with the compiler for how to setup the UART. Then just print the controls to the UART. Remember things take time, so the motor can't go straight from forwards to back instantly.

The commands are simple, but will depend on your motor. So "S\x80" will start the motor, and run it, but the actual speed will depend on your motor.

printf(">A\x01\xFF\x05");

This will set the direction to 'forwards' (which way this is will depend on your motor), start at speed '1', then accelerate to speed '255' (xFF), ramping the speed at rate '5'.
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