SparkFun Forums 

Where electronics enthusiasts find answers.

Have questions about a SparkFun product or board? This is the place to be.
By andrewjfox
#199974
Hi ,

Having problem with the autodriver library/board.

I have 5 boards daisy chained.

During config I write the step mode using;
Code: Select all
bdr[i].configStepMode(2);   // STEP_FS_4
however when I read back later it returns 7 instead of 2
Code: Select all
stepmode = brd[i].getStepMode();  // returns 7 (STEP_FS_128)
The weird things is that it only returns incorrect result for boards 0 & 2. Boards 1,3 & 4 return correct result of 2.

I set and readback various other configuration parameters, all work correctly. It's only on step mode. Unfortunately this is a big problem since my positioning is all out of whack.

Any thoughts or things to try would be greatly appreciated.
By andrewjfox
#199991
after more testing found it's not limited to boards 0 & 2, and is happening to random boards, but is mostly prevalent on board 0 (the first board to be configured). Have tried testing for status not busy before writing to register but still persists.

As correction to earlier typo, code examples should read;
brd.configStepMode(2);
stepmode = brd.getStepMode();
By andrewjfox
#200004
Resolved!

To all those eager to hear the answer -> RTFM
In the data sheet for the L6470, hidden in the table of configuration parameters, is a little note 'RH' which, upon inspection, states that this param is only writeable when outputs in high impedance state. When I specifically set high z before writing configuration, all worked ok.