Jump to content


  • Content Count

  • Joined

  • Last visited

About tech_juggernaut

  • Rank

Profile Information

  • Sparkfun
  1. Do you know how I could translate the CCR values to an actual position in degrees? I thought it would be cool to be able to output its actual position to a PC via serial. Is something like that possible? Thanks!
  2. Thanks! So in the final code, TIMER0_A0_VECTOR is called when the count matches CCR0, and then ADC10_VECTOR is called when the count resets to 0? I guess I was thinking it generated an Interrupt based on the change in the levels of the analog signals?...
  3. Man you've outdone yourself, thanks! :clap: That utility page is a handy tool to have, I'll try it out tonight. I was wondering if you could give me a quick step by step about how and when the interrupts actually occur, I'm a little fuzzy when it comes to ISR's. Thanks for all of your help!
  4. Ha, I guess it depends on the observer... the warnings could either be pithy or induce pity... or both! 8-) I'd say the probability of a good laugh is likely either way. :-P
  5. Ha, I don't blame you, good idea. You could get free shipping for $25 worth, but I have no idea what I'd do with 34 stickers. Just enough to drive me mad. :!!!: Gotta love this one though : http://www.etgiftstore.com/items/all-pr ... detail.htm
  6. Hey Rob, thanks! It's been a lot of fun working on it, I'll post a video of it in action in a couple of days. Thanks for the input, you're right about the LUT, ideally that's what I'd like to use. However, it seems like a daunting task, mostly because I don't have any experience with them, i.e. I wasn't sure if I should just use oPossum's formula to populate the LUT or not?... or how to use it once I did. :problem: I have a tendancy to overcomplicate things... zeke, thanks, I couldn't resist, I've been looking for a reason to use it! :thumbup: I actually just got it along wit
  7. Thanks to you both, worked like a charm!! I replaced the original code in the while loop in the ADC ISR with oPossum's formula to set the servo positions: const int adc_min = 0; // Minimum ADC value const int adc_max = 1023; // Maximum ADC value const int servo_min = 75; // Minimum CCR value const int servo_max = 320; // Maximum CCR value // ADC10 interrupt service routine #pragma vector=ADC10_VECTOR __interrupt void ADC10_ISR(void) { while (ADC10CTL1 & BUSY) ; i = 0; while(i < 6) { // update servo positions servoPosition[5 -
  8. Thanks Rob, I set up some conditions to try to get closer to full range. When the adc value is very close to 0 or 1023 then the servo position is set to either 113 or 263 respectively, and otherwise it calculates for any values in between. #pragma vector=ADC10_VECTOR __interrupt void ADC10_ISR(void) { while (ADC10CTL1 & BUSY) ; i = 0; // update servo positions while(i < 6) { // CCR from ADC is calculated if ( adcValues[i] >= 0x3FC ){ // adcValue >= 1020 servoPosition[5 - i] = 0x107; // 2100us / 8us = ~263 = 0x1
  9. The code works very well, thanks! I noticed that I'm only getting about 90 degrees of motion out of the servos, do I need to adjust the code to get the full 180 degrees range out of them? At first I thought it may be a problem with the torque specs, but it also happens with the servos at the wrist and claw where very little torque is required. Thanks again.
  10. Ah, brilliant, that makes sense, an image always seems to help my neurons fire. Thanks, Rob. :thumbup:
  11. Thanks Rob, I really appreciate your help, I can't wait to test it out this evening! If I can't use one servo per channel, would the servos still be able to maintain their positions? In your code does the PWM work by using CCR0 in the timer to set the period and then the other registers are used to set the duty cycle? After talking to a friend of mine, I was wondering if the following method work if I wanted to use one servo per channel: Free-up the CCRO's by setting the timers to continuous mode instead of up mode, counting up to FFFF and then rolling over. Fix the period, calcu
  12. Hi Rob, I have an MSP430G2553 and I'd like to control six RC servos independently, and simultaneously, with six pots using all six capture/compare registers of Timer_A0 and Timer_A1. I'm aiming to control a robotic arm with pots and servos and, in order for it to keep its position, each servo has to always have a constantly updated PWM signal. Is this possible? If so, how would the code differ from the code that you posted for the G2331? Thanks for any help!
  • Create New...