I'm trying to generate a quadrature signal with a L297 http://www.st.com/content/ccc/resource/technical/document/datasheet/f9/35/6e/3f/48/18/48/51/CD00000063.pdf/files/CD00000063.pdf/jcr:content/translations/en.CD00000063.pdf I use only phase A and C in order to have a 90° offset

Here is my wiring:
// L297 -> MCU
2 GND -> GND
4 A -> read out phase A
7 C -> read out phase C
10 ENABLE -> GPIO Pin 1
12 Vs - +5v
11 Control -> GPIO Pin 5 set to high for phases line ABCD
17 CW/CCW -> GPIO Pin 2 set to high or low depeding the direction
18 Clock -> GPIO Pin 3
19 Half/Full -> GPIO Pin 6 set to low for full step
20 RST -> +5v

According to my understanding, when I want the L297 to run, I write a bit on GPIO Pin 1 (HIGH) to enable the L297 For changing direction, I must put Pin 2 High or Low And when I want to send a pulse, I write a bit on Pin 3 /Clock i'm sending pulse to clock but channel A and C stay always low. Do you have any idea of what could go wrong with my wiring ? or with my understanding ?

Thank you

  • \$\begingroup\$ Are you simply setting the clock line high each step, or are you remembering to actually produce a pulse? \$\endgroup\$ Commented Sep 11, 2017 at 0:18
  • \$\begingroup\$ I set alternatively the pin HIGH then LOW then High etc \$\endgroup\$
    – vib
    Commented Sep 11, 2017 at 3:46

1 Answer 1


If you don't have current sense R to ground, and a Vref on p15 , a floating input that exceeds Vref p15 which is also floating, it will reset the outputs.

  • \$\begingroup\$ OK I put 2v (randomly choose between 0 and 3v) on Vref. What should I do with this part of your comment " current sense R to ground"? \$\endgroup\$
    – vib
    Commented Sep 11, 2017 at 3:49
  • \$\begingroup\$ 0V or a resistor to ground \$\endgroup\$ Commented Sep 11, 2017 at 4:39
  • \$\begingroup\$ but connected to what? \$\endgroup\$
    – vib
    Commented Sep 11, 2017 at 5:05
  • \$\begingroup\$ look at the IC schematic and you will see these pins on a comparator. It is supposed to sense motor current and shutoff when > Vref \$\endgroup\$ Commented Sep 11, 2017 at 5:18
  • \$\begingroup\$ Ok, thank you I connected both SENS1 and 2 to ground, Vref with 2v but I have the same result, my counter is still going up very quickly and never stop. I don't know what 'im doing wrong \$\endgroup\$
    – vib
    Commented Sep 11, 2017 at 5:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.