![](templates/subSilver/images/CCSLogo.jpg) |
![CCS C Software and Maintenance Offers](templates/subSilver/images/forumAd6.jpg) |
View previous topic :: View next topic |
Author |
Message |
Guest
|
Stepper motor with motor driver coding problems |
Posted: Wed Aug 22, 2007 7:26 pm |
|
|
Hi all, I'm like a new born baby in PIC world.
I have a 5 phase Stepper Motor with Motor Driver, previously I controlled it by using PLC, simply include the function of motor in the ladder diagram will do. However, I have a problem with PIC16F877a coding, the motor driver have 2 inputs for stepper, 1st input is clockwise movement, 2nd input for counter-clockwise.
I have referred to the examples like ex_pwm.c, ex_ccpmp.c, ex_ccp1s.c, ex_step.c and other solutions provided in this forum. I would like to know for sure:
1)Does " setup_ccp1(CCP_PWM)" means enabling the pin17, which is RC2/CCP1 to become CCP1 instead of standard I/O pin?
2)If yes, then how's the coding is going to be? I've tried to measure the outpin with oscilloscope using the code as above, but what i get is noise....
3)Does i mean, i only need to plug in output from CCP1 and CCP2 pins to CW and CCW input of the motor driver? Because, all i need is pulse...
Thanks a lot for answering my question. |
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Wed Aug 22, 2007 10:33 pm |
|
|
Quote: | I have a 5 phase Stepper Motor with Motor Driver. |
Post the manufacturer, part number, and website for the stepper motor. |
|
![](templates/subSilver/images/spacer.gif) |
windz
Joined: 19 Aug 2007 Posts: 7
|
|
![](templates/subSilver/images/spacer.gif) |
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Thu Aug 23, 2007 12:46 am |
|
|
See this CCS example file:
Quote: | c:\Program Files\PICC\Examples\Ex_Step.c |
|
|
![](templates/subSilver/images/spacer.gif) |
windz
Joined: 19 Aug 2007 Posts: 7
|
|
Posted: Thu Aug 23, 2007 2:23 am |
|
|
Actually, i dont really understand all the coding in the example, but at least now i can get the square wave output on the oscilloscope. I'm playing around with the coding now...
thanks for your help. ![Very Happy](images/smiles/icon_biggrin.gif) |
|
![](templates/subSilver/images/spacer.gif) |
|
|
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
|