Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

TLC5940NT Mal-operation???

Status
Not open for further replies.

ecaits

New Member
As I have to control servos by TLC5940NT in Arduino Uno.
During testing, the servos are not rotated as per command and sometimes it stopped and not working.
The wiring diagram is attached in file.
Simple program I have used for servos testing, given below,

#include "Tlc5940.h"
#include "tlc_servos.h"

#define SERVO_CHANNEL 0
#define DELAY_TIME 20

void setup()
{
tlc_initServos(); // Note: this will drop the PWM freqency down to 50Hz.
}

void loop()
{
for (int angle = 0; angle < 180; angle++) {
tlc_setServo(SERVO_CHANNEL, angle);
Tlc.update();
delay(DELAY_TIME);
}
for (int angle = 180; angle >= 0; angle--) {
tlc_setServo(SERVO_CHANNEL, angle);
Tlc.update();
delay(DELAY_TIME);
}
}

Thank you,

Regards,
Nirav
 

Attachments

  • TLC5940_Arduino_circuit.jpg
    TLC5940_Arduino_circuit.jpg
    97.6 KB · Views: 319
Why you open a new thread

Have you tried it like it tells you...?
Code:
/*
    This sketch sweeps a servo on channel 0.

    To connect a servo:
     1. Put a 2k-5k pull-up resistor (R0 below; I've tried with 3.3k) between the
          servo control output pin and +5v.
     2. Connect that same pin to the servo's control line like so

        servo data pin
              |     _____
     OUTn ----+----[_____]---+5v
                      R0

    Steve Pomeroy <steve ~AT~ staticfree.info>, 2009-01-20 */

#include "Tlc5940.h"
#include "tlc_servos.h"

#define SERVO_CHANNEL   0
#define DELAY_TIME      20

void setup()
{
  tlc_initServos();  // Note: this will drop the PWM freqency down to 50Hz.
}

void loop()
{
  for (int angle = 0; angle < 180; angle++) {
    tlc_setServo(SERVO_CHANNEL, angle);
    Tlc.update();
    delay(DELAY_TIME);
  }
  for (int angle = 180; angle >= 0; angle--) {
    tlc_setServo(SERVO_CHANNEL, angle);
    Tlc.update();
    delay(DELAY_TIME);
  }
}
 
Dear Burt,

I have tried exactly same way as told in your reply.
But still servo is not rotating in commanded fashion.

Regards,
Nirav
 
Im sure if not hooked up right it will not work that chips made for driving leds there using pullups to keep it from thinking you have a broken led.
**broken link removed**
 
Last edited:
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top