Jump to content


  • Content Count

  • Joined

  • Last visited

  1. My bad, I was using P1.2 all along. Just that I wrote P1.4 by mistake. Do you think using a pin for direction is necessary? I just assumed that having no pin connected to it would just make it move to whatever direction a logical "0" would make it move to. I think it might have something to do with the cables in the motor. I don't have a datasheet for it (Made in China ) so I have tried various combinations to see how it works. Do you have any experience with this type of stepper motors, by any chance? Thanks for the reply!
  2. Hello guys! I am trying to interface 4-wire, 12 V stepper motor using the A4988 Stepper Motor Driver from Polulu. As far as I understand (and according to the A4988's Datasheet), all that it needs to make the motor move is a simple pulse to the STEP input. I did this and it is not making the motor move. I will attach a few pictures that will allow you guys to understand what's happening a little bit better: This is how the chip is supposed to be connected: Now, my configuration is the following: The yellow and purple cables are of an external 12 V voltage supp
  3. Hello Guys, I am trying to understand how the MSP430 timer works. I am running the sample code that comes from TI, and trying to play around with the number of counts. I understand the formula time(s) = counts/Frequency. This is why the sample code comes with a count of 50000, which turns into 50000/1.045Mhz = 0.5 seconds. However, using this logic, if I want the interrupt to trigger every second, I should do count/1.045Mhz = 1 seconds -> count = 1.045e6 counts. I try this, and for some reason the LED does not blink every second. It blinks much faster. Here is the code: #incl
  4. This still doesn't work. I am trying to modify the already-made example by TI now, but it doesn't seem to work either. Could you guys tell me what is wrong with it? #include <msp430.h> int main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer P1DIR |= BIT0; // Set P1.0 to output direction while (1) // Test P1.4 { if (P1IN & BIT1) P1OUT |= BIT0; // if P1.1 set, set P1.0 else P1OUT &= ~BIT0; // else reset } }
  5. Why not? I want to toggle the LED with the press of the button.
  6. Hey guys! I am trying to use the on-board P1.1 button on the MSP430 F5529. However, for some reason the following code is not working correctly. What I am trying to do is to toggle the on-board LED at P1.0 using the on board push button at P1.1. What am I doing wrong? Do I have to debounce the push button somehow? Here is the code: #include <msp430.h> int main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop watchdog timer P1DIR |= BIT0; // Set P1.0 to output direction P1REN |= BIT1; // P1.1 pullup while (1)
  7. Thanks! I will try it now using the clock as the delay. Let's see how it works out.
  8. Hello guys, I finally got my stepper motor to move. Now, I would like to know how to make it move as fast as it can move. I tried the following code, which basically turns on each pin (one at a time): #include <msp430.h> volatile unsigned int i; // volatile to prevent optimization void init() { WDTCTL = WDTPW | WDTHOLD; // Stop watchdog timer P1DIR |= 0x3C; // Set direction of pins. } void delay(int val) { i = val; do i--; while(i != 0); } void counterClockwise(int speed) { P1OUT = 0x04; // Toggle P1.2 delay(speed); P1OUT = 0x08; // Toggle P1.3 delay(speed
  9. Good day guys, I bought this stepper motor to play around: http://www.amazon.com/gp/product/B00DUSYEWY/ref=oh_details_o02_s00_i00?ie=UTF8&psc=1#productDetails It includes the very useful ULN2003 test board, which I am using to interface the MSP430 with the motor. The MSP430 is working perfectly fine (the Pins that are turned on have 3.3V), but the motor doesn't turn around. I am thinking that the reason that it isn't working is because I am powering the test module with the 5V that my Raspberry Pi provides. I think these motors need around 500mA to work. Is there a way for
  10. Hello guys, I need to control a Boost Converter using an MCU. For those that don't know, this is done using PWM. However, our Boost Converter will be very particular, and the PWM needs to run at 500 kHz. I am new to PWM so I was wondering, is this value too high? How does a high frequency alter my duty cycle (if at all)? And, most importantly, how is this done with the MSP? Thank you!
  11. I usually use this notation. This is what I mean by my "crazy antiques" I use CCS right now, but if there is a better compiler that you guys can suggest then I would be more than happy to try them out. Is mspgcc any good? Also, I do know hex perfectly well, so I guess it is a good idea to stick with it for now.
  12. Hello guys, I have some experience programming ARM-based MCU's (Tiva C in particular) and over there I always declared ports using binary numbers. For example, I always declared the GPIO pins this way: // Set pin 7 (could also be the Hex equivalent, 0x80): GPIO_PORTC_DIR_R = 0b10000000; // Digital enable of of Pin (needs to be 1 in order to be enabled): GPIO_PORTC_DEN_R = 0b10000000; // Turn LED ON: // Data of the pin (a 1 or a 0): GPIO_PORTC_DATA_R = 0b10000000; I have noticed that all the examples of the MSP 430 use the following notation: P1DIR |= BIT0;
  13. Maybe saying "really" high is a bit far-fetched. It's around 50V.
  14. Hello guys, I though that ADC's should be used to read analog signals into the MCU. However, what should I do if I need to measure really high voltages (above 30 V)? I am thinking that applying that amount of voltage into a resistor and connecting it to the MCU is not a good idea at all. What is the solution to this type of problem? Thanks!
  15. Thank you all for your great replies, specially enl who really gave a great answer. I would like to do my own drive like he says, but I might end up just using some ULN2003 drivers instead, depending on what happens. Thank you all again. I'll ask any questions I come across with throughout the project.
  • Create New...