Jump to content
43oh

DarthMessiah15

Members
  • Content Count

    24
  • Joined

  • Last visited

Everything posted by DarthMessiah15

  1. It is a 5 volt chip, I have the 5volts coming from T0 on the launchpad. then it's basically p1.0 and 1.1 are the select bits, and 1.2 is the enable bit. it works fine.. after i poke at it with my MM. but not before. can't figure it out for the life of me. i'll try to draw up a schematic and take a pic when I get home.
  2. Hey guys, i'm using a 754410 hbridge as a motor driver for a little 3.3 volt radioshack motor. Having a wierd problem though. Whenever I start running my code, nothing happens, but then if I pull out my MM and start checking pins to make sure everything is where it's supposed to be, well, then it starts working. I thought it might be a loose connection but have eliminated that from possibility. any ideas what this could possibly be?
  3. When using this to initialize adc10, ADC10CTL0 &= ~ADC10ENC; ADC10MCTL0 = ADC10INCH_12; ADC10CTL2 = ADC10RES; ADC10CTL1 = ADC10DIV2 | ADC10SSEL_0 | ADC10SHP; ADC10CTL0 = ADC10SHT_2 | ADC10ON | ADC10ENC; I'm getting these errors? "../main.c", line 26: error: identifier "ADC10ENC" is undefined "../main.c", line 27: error: identifier "ADC10MCTL0" is undefined "../main.c", line 27: error: identifier "ADC10INCH_12" is undefined "../main.c", line 28: error: identifier "ADC10CTL2" is undefined "../main.c", line 28: error: identifier "ADC10RES" is undefined "
  4. 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.
  5. so would I just call this function to seed srand? Thanks by the way. really bailing me out.
  6. no help possible on the adc seed? or the whole twenty minute timer set up?
  7. Ok so I understand I need to use an adc reading as the seed, anyone care to explain what an adc reading is and how to go about taking one? thanks.
  8. Alright guys, ran into a problem that is really really holding me up and could use some quick help. first of which, I need some way to delay operations but I need to be able to pass it a variable instead of just a constant so delay_cycles won't work. Here is what some quick google searching yielded. will this work? void delay_ms(unsigned int delay) { while (delay--) { __delay_cycles(16); } } also, I need the easiest way to get a random number 1-20. I tried.. srand( (unsigned int) time(NULL) ); int i= rand()% 20; is that the best way to go ab
  9. awesome. now if only i could get pwm figured out. lol. thanks guys.
  10. 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?
  11. 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?
  12. 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
  13. 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?
  14. thanks a lot. I had an initial grace configuration, should i just get rid of all that junk now>
  15. alrighty. so would i just replace my code with where he does his demo movements? or in the bottom function. so you fully understand what I'm needing to accomplish.. this thing is going to be plugged in almost all the time. all i want is the button press to make it execute my code(start a loop which will run a set amount of times), which is going to turn on an LED(stimulus light for drug discrimination research) turn it off, then turn the motor one way which is converted to a small linear actuator. then turn it other other way, then wait a set amount of time, and start the loop over. after
  16. alrighty, i'm definitely willing to give it a try as obviously the more i can learn from this project the better. my biggest issue is i was going to be trying to adapt and modify the code this guy used ( viewtopic.php?f=9&t=699 ) to use pwm to control my motor. will any of that stuff negatively interact with what i've got going on do you think? and if not, should i just combine your code and his and then put the main chunk of my functionality in that interrupt function? kinda confused on what's really going on there. thanks again!
  17. anyone know if it's tp3 or tp1 that's 5volts?
  18. I'm kinda confused on a few things and appreciate everyones patience. polling is definitely the way I'd like to go for now, don't know why i even said interrupt earlier. I guess really what's confusing me is how i actually implement it. I understand the logic as I can code in C++ all day, I'm just very new to MC programming. basically.. i need int flagvariable=0; while (flagvaraible==1 && counter < cyclestocomplete) { //do my stuff counter++; } problem is I don't know how exactly to get the button to change the flag variable.
  19. ok one more question. by interrupt lines do you mean one of the pins like 1.3? and do I have to do any initialization stuff or just set it as an input within grace and then it'll take care of the rest?
  20. cool. i didn't know it was that easy. never used buttons before.
  21. so, i have a fairly basic question, and i'm sure the answer to this question already exists somewhere I just wasn't able to find it. Basically, I need to figure out how to add a button interrupt into my very basic code. mainly, I'm gonna be running a prototype off a launchpad that's basically hooked up to the usb port the entire time, and I just need to add one button press to make it start, as opposed to starting as soon as it's plugged in which is the case now. anyone got any quick easy resources or just a template I could look over? Thanks. Chris
  22. it's more of just making this for someone that would be much more comfortable using a GUI for the adjustments. I'm kinda being rushed to make a prototype for a buddy who's doing some medical research. and he just think's there's an entire higher level of legitimacy by launching it from a desktop. does that make sense? more of just trying to fulfill a request more than it's an actual requirement.
  23. ok thanks. the GUI isn't really necessary, but basically i just wanted to be able to control some time constant editing directly before running the code. so I was thinking about writing a program of some sort that will then generate the code, compile it on the MC, then start rolling. anyone done this?
  24. Looking for someone to offer some basic answers. I'm a sophomore CoE/CS double major so the coding shouldn't be an issue, I just have a question to how i should fundamentally set up the project i'm going for. basically, I need to make a prototype that will give some type of warning, say an led flashing for a controlled amount of time, then i need it to do some mechanical task, then the inverse of said task. for example, turn a DC motor. my first question, is about the output voltage/current of the board. 1) is it relational to VCC or does it differ by chip and how do I find this
×
×
  • Create New...