Snippet - L6470 Beta Ported Device Driver

You are saying the SDO line might not be fully soldered? My apologies, I am a mechanical engineer by trade. Can I test this with a multimeter on the SDO line?

Yes, you can. Measure ohms between the lead, where it exits the chip, and on the track. Try to avoid measuring on the pad as that might contact the pin and give you a false positive.

Both data lines appear to be connected securely…

Sorry, then I’m out of ideas.

Did you measure all the way to the mainboard? Maybe there is a loose wire?

I might get my samples this week(should have had them on Friday or Monday already), then I can also test…

Just to let you all know…bit of a plug…I have posted a L6472 board up for sale that attaches to the back of a NEMA 17 motor. It works with the L6472 library that I developed based on kurtnelle’s work. Anyone from this forum can certainly get it at a discount if interested.


Very nice!

Ack… after 1.5 weeks of pain I finally figured out why the driver wasn’t communicating properly with the device (no switch case fall through in c#). Painful but we learned something new.

The driver has been updated with the required changes. Thanks to people who have made comments and suggestions; they have been taken into consideration.

Switch cases can fall through when they’re empty; when they’re not, not having a “break” statement is a compiler error (CS0163: Control cannot fall through from one case label to another).

How did you manage not to run into compiler complaints?

If you do need fall through, you can simulate it with ‘goto case’ if the case statements do not have empty statement bodies.


switch (expr)
  case 1:
     goto case 2; // Simulate fall through
  case 2:

  case 3:
  case 4:
  case 5:

But, as @ godefroi has mentioned, it is surprising that you did not get a compiler error if you simply assumed fall through. <- a feature which makes no sense, I would just prefer fall through.

But it is also very easy in C to accidentally fall through because you forgot a break statement.

C# is forcing you to explicitly state that you want to “fall through” via a goto statement…

@ tommyvdp - Hi, I am learning the L6470. But I don’t know how to set the parameters,
KVAL_HOLD, KVAL_ACC, KVAL_DEC, KVAL_RUN, ST_SLP and so on. Can you help me?Thank you!