Jump to content
43oh

Mateus

Members
  • Content Count

    12
  • Joined

  • Last visited

Reputation Activity

  1. Like
    Mateus reacted to abecedarian in Some times dc motor doens't stop working in my project   
    First thing I would suggest is to initialize your variable:

    char senha[3] = {'x', 'x', 'x'};
  2. Like
    Mateus reacted to abecedarian in Some times dc motor doens't stop working in my project   
    If it's working with UART / Serial, then I'm not sure what to say, but I don't see any "Serial" code in what you've posted so far. Pin 3 is connected to the emulation side of J3; pin 4 is connected to the MSP430 side of J3.
  3. Like
    Mateus reacted to abecedarian in Some times dc motor doens't stop working in my project   
    Just noticed something.... Your first question was regarding using serial.
     
    You should switch the jumpers on header to take advantage of hardware serial on the 2553.
     
    This does create a conflict with how you are wiring things:

    const int C0 = 5; // 2 a 4 pinos referentes as colunas do teclado em ordem de signific
  4. Like
    Mateus reacted to abecedarian in Some times dc motor doens't stop working in my project   
    What does your code look like now?
  5. Like
    Mateus reacted to abecedarian in Some times dc motor doens't stop working in my project   
    Yes, that's what I meant. A 4.7k resistor from pin 1 to ground, but only after moving pin 1 off of VCC and connecting it to a GPIO pin on the MSP430. 

    msp pin ----+---- L293D pin 1 | > < - 4.7k > | gnd --------+
  6. Like
    Mateus reacted to abecedarian in Some times dc motor doens't stop working in my project   
    I think one thing you're doing wrong is driving the lock and unlock functions wrong. You should be using the 1,2EN pin (pin 1) on the L293D to enable the motors, and pins 2, 7 to control motor direction. If 2 is high and 7 is low, motor goes one way; if 2 is low and 7 is high motor goes opposite.
    This does mean you'd have to take VCC off pin 1 and run that to another assigned pin on the MSP430.
     
    I don't have an L293D to test, but maybe something like below. Think of it like setting motor direction, then enabling the motors to spin.

    //if enable is low motor will not spin; lock and unlock signals do not matter const lockEnable = X; // X is launchpad pin to control drive enable // to unlock door: digitalWrite(lockEnable, LOW); // disable the drive circuit - guarantees motors won't run digitalWrite(unlock, LOW ); // set motor to unlock direction digitalWrite(lock, HIGH ); // lock must be opposite of unlock or motor won't spin digitalWrite(lockEnable, HIGH); // enable the drive circuit delay(500); // wait 1/2 second digitalWrite(lockEnable, LOW); // disable the drive circuit digitalWrite(open, HIGH); // turn on OPEN LED digitalWrite(close, LOW); // turn off CLOSE LED ... // to lock door: digitalWrite(lockEnable, LOW); // disable the drive circuit - guarantees motors won't run digitalWrite(unlock, HIGH ); // set motor to lock direction digitalWrite(lock, LOW ); // lock must be opposite of unlock or motor won't spin digitalWrite(lockEnable, HIGH); // enable the drive circuit delay(500); // wait 1/2 second digitalWrite(lockEnable, LOW); // disable the drive circuit digitalWrite(open, LOW); // turn off OPEN LED digitalWrite(close, HIGH); // turn on CLOSE LED
  7. Like
    Mateus reacted to abecedarian in Some times dc motor doens't stop working in my project   
    Another thing might be to put weak pull-down resistor from L293D pin 1 to ground to guarantee the motor is disabled when the unit powers up since the MSP pins' states are undefined on power up, usually.
×
×
  • Create New...