Jump to content


  • Content Count

  • Joined

  • Last visited

About Sillycrackers

  • Rank

Profile Information

  • Sparkfun
    Stepper drivers
  1. Hi, I am having trouble getting the ADC interrupt working for the msp430g2452. I am simply trying to turn on a flag when the interrupt goes off but it doesn't seem to be working. Code below.... #include <msp430g2452.h> void initAdc(); volatile char flag = 0; int main(void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer P1DIR |= BIT6; P1OUT &= ~BIT6; initAdc(); __bis_SR_register(GIE); while(1){ if(flag == 1){ P1OUT |= BIT6; }else{ P1OUT &= ~BIT6; } } return 0; } void in
  2. Okay, So lets say i only need 2 pwm outputs for 2 motors and I have 6 sensors that need to hook up to the adc inputs. What pins would you recommend I hook these up to? (I have the 20 pin package) Thank you
  3. Hello quick question here, How many Pwm outputs does the G2553 chip have? I am trying to read the datasheet: http://www.ti.com/lit/ds/symlink/msp430g2553.pdf but it is hard to get a straight answer. I need 4 individual Pwm outputs and 6 ADC inputs is this possible without interfering with each others pins? Thank you.
  4. I tried the code RobG but since I'm using a different chip then you I think I have to change the timer vector name but I'm not sure what to so I tried : #pragma vector = TIMER0_A1_VECTOR And I also added: P2DIR |= BIT2; P2OUT &= ~BIT2; and: #pragma vector=ADC10_VECTOR __interrupt void ADC10_ISR(void) { if (adcValues[1] > 500){ P2OUT |= BIT2; } } Full Code: #include "msp430g2553.h" #include unsigned char valueIndex = 0; unsigned int adcValues[6] = {0,0,0,0,0,0}; void main(void) { WDTCTL = WDT
  5. Okay Thank you. Would you also happen to know how I would be able to tell which individual input went over my setpoint?
  6. Hello, I am currently working on a linefollowing robot car. I plan on having 6 analog sensors that will be hooked up to P1.0 - p1.5. 'm new to this style of programming I'm trying to make the adjustment from arduino! Anyways right now I'm just debugging and trying to light an led when the either of the inputs go over a certain value. For some reason it is not working. Also when it comes time to make the line follower I will need to know what specific input is going over the setpoint is there a way to know which individual input went over ? Thank you. #include "msp430g2553.h" #includ
  7. Hello, I am new to the msp430. I have a launchpad and am using the msp430g2553. I am learning from the text "MSP430 Microcontroller Basics" but in the book the author uses the header file io430.h. I tried to include that in one of my projects but it seems I do not have it available in my compiler ( I am using CCS). Would anyone happen to know where I would aquire this header file so I can use it in CCS? Thank you.
  8. Thanks a lot this was driving me nuts Great explanation.
  9. Okay I understand Binary math but I thought that the ports were automatically set as inputs?
  10. Oh man Thank you so much. Would you mind explaining what this actually does?
  11. Hello, I am having trouble setting up the on board push button to port P1.3. For some weird reason when I hold my fingers on the male headers for the MCU pins the button works otherwise it doesn't work. I understand that you need to activate the internal Pull up resister which I have tried but yet I still cannot achieve any sort of progress with properly using the push button. Here is my code Thanks in advance. #include "msp430g2553.h" // Pins for LED and button on port 2 #define LED1 BIT0 #define B1 BIT3 void main (void) { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer P1OUT = LE
  • Create New...