DarthMessiah15 0 Posted May 17, 2011 Author Share Posted May 17, 2011 thanks a lot. I had an initial grace configuration, should i just get rid of all that junk now> Quote Link to post Share on other sites
bluehash 1,581 Posted May 17, 2011 Share Posted May 17, 2011 Yes. Quote Link to post Share on other sites
DarthMessiah15 0 Posted May 17, 2011 Author Share Posted May 17, 2011 ok one more stupid question. using the given code, 1.0 and 1.1 are the control bits for the motor direction. got that. what I don't understand is what's actually happening with CCR1 and bit2. It seems based off the video and the code from the example that the lower CCR1 is, the faster the motor goes. but I think i'm missing something very fundamental. say for example, bit 1 and 0 are set to 1 and 0 respectively, what do I actually do to change the signal on 1.2 to turn the thing on or off? Quote Link to post Share on other sites
RobG 1,892 Posted May 18, 2011 Share Posted May 18, 2011 P1.2 is timer's output and it is connected to enable pin of motor driver. CCR1 controls duty cycle, the smaller CCR1 is the longer driver is enabled and the motor runs faster. Quote Link to post Share on other sites
DarthMessiah15 0 Posted May 18, 2011 Author Share Posted May 18, 2011 so do i actually manipulate the 1.2 bit? or CCR1 to turn the thing on and off? i've tried a million combos and nothing seems to do what I think it's going to Quote Link to post Share on other sites
RobG 1,892 Posted May 18, 2011 Share Posted May 18, 2011 Instead of manually turning motor on and off (when doing PWM that is,) I am using timer's feature. CCR0 is the interval, CCR1 controls duty cycle. So for example, if CCR0 is 100, CCR1 close to 0 means motor is on for almost 100% of the time, when close to 100, motor is on for just a bit of time. If you want to turn the motor off for good, you can disable P1.2 TA1 feature and set P1.2 manually to 0. Note that setting CCR1 to CCR0, will keep the PWM at 1 cycle, so the motor will never be totally on. See 12.2.5 of the User's Guide, there you will find information about timer's output modes and how they work. Basically, at the beginning, set P1.2 as output and set it to 0. Setup everything else as you do except TA1 output. (P1SEL |= BIT2;) Then when you ready to turn your motor on, set P1SEL bit2 to 1 and that will enable timer's TA1 output which will control motor's duty cycle. Quote Link to post Share on other sites
DarthMessiah15 0 Posted May 18, 2011 Author Share Posted May 18, 2011 alright. i'll keep giving it a try. I'm pretty sure all my hardware is just fine because occasionally the motor turns, it's just never turning when I want it to. I can get the select bits set just fine and checked em with my DMM, Just the 2nd bit is not doing what it needs to do and I can't figure it out. How much risk of burning stuff up am I gonna be if i just don't use PWM and set bit 2 to high when I want it on, and low when I don't? Quote Link to post Share on other sites
RobG 1,892 Posted May 18, 2011 Share Posted May 18, 2011 No risk, just set port's 1.2 P1SEL to 0 (P1SEL &= ~BIT2) and then you can turn the motor on and off by setting P1.2 to high or low. What driver are you using? If 754410, make sure you power it with 5V. Quote Link to post Share on other sites
DarthMessiah15 0 Posted May 19, 2011 Author Share Posted May 19, 2011 yeah, i'm using the 754410. i just jumpered from tp1 and it's at just shy of 5 volts. somewhere like 4.92V. shouldn't cause any problems right? Quote Link to post Share on other sites
bluehash 1,581 Posted May 19, 2011 Share Posted May 19, 2011 You'll be good. Quote Link to post Share on other sites
DarthMessiah15 0 Posted May 19, 2011 Author Share Posted May 19, 2011 awesome. now if only i could get pwm figured out. lol. thanks guys. Quote Link to post Share on other sites
RobG 1,892 Posted May 19, 2011 Share Posted May 19, 2011 BTW, by powering 754410 with 5v I meant Vcc1, Vcc2 can be higher. Quote Link to post Share on other sites
DarthMessiah15 0 Posted August 6, 2011 Author Share Posted August 6, 2011 Ok i'm having a really interesting problem. Everything is wired up fine and my code is now fine, but for some reason, the motor doesn't start to turn until I start probing around with my multimeter. Once i do this, it starts working perfectly. I first thought it was maybe a short or loose connection but i've since eliminated that as a possibility. maybe capacitance across the MM? any ideas? i'm pretty stumped here. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.