October 20, 2013
about a year ago
And clearly - if you are bitbanging your SPI, do it as per above post.
And a hint for everyone - this L6470 DSpin chip talks nonsense until the MOTOR is POWERED !!
This exact problem plagued me for a few days, till I nailed it!
Ha … SPI bus has the properties of CLOCK POLARITY and CLOCK PHASE. I was writing my own drivers - running on Freescale 56F805 - for the DSpin L6470, and from reviewing the ST datasheet - came to the conclusion that Data clocking was to happen on the LEADING EDGE of the CLOCK signal, and CLOCK was ACTIVE-HIGH.
Only when I came to implement the item Get_Abs_Pos - I found that the 8th bit in all three bytes returned was missing (reads zero - always). (PS many would say SEVENTH Bit, counting from zero …). Then realised ALL BYTES returned from DSpin missing the highest bit, always. Sure makes your Config and Status registers look strange! After a bit of pfaffing about - revisited the Clk phase and polarity setting in my micro, tried the three remaining combos of Phase and Polarity, found that these are the SPI settings that work:
clk phase = TRAILING EDGE
clk polarity = ACTIVE LOW
in order to implement this on your Arduino or whatever, look to the hardware manual for SPI port registers.
Very surprising that Sparkfun has released a ‘library’ with this very glaring error - only kills some users though?
Your design looks very appealing - I would be interested in a few of these (not for CNC btw). Thanks !
No public wish lists :(
Forgot your password?
No account? Register one!