Hello Thomas,
I decided to modify your code to support 1/64 microstepping.
That's what I've done so far:
AstroEQ.cpp:
Added new case to drv882x
case 64:
// 1/64
modeState[SPEEDNORM] = (( HIGH << MODE2) | ( HIGH << MODE1) | ( LOW << MODE0));
// 1/8
modeState[SPEEDFAST] = (( LOW << MODE2) | ( HIGH << MODE1) | ( HIGH << MODE0));
break;
And modified this line
if ((driverVersion == A498x) && microstepConf > 16){
return false; //invalid value.
} else if (microstepConf > 64){ < from 32 to 64
return false; //invalid value.
UploaderGUI.pde:
And changed the utility uploader gui: populateMicrostepDropdown cycle from 6 to 7, to show the 64 micro stepping.
Map<String,Integer> populateMicrostepDropdown (int driver) {
Map<String,Integer> entries = new LinkedHashMap <String,Integer>();
entries = new LinkedHashMap <String,Integer>();
for (int j = 0; j < 7; j++){
int mode = (int)pow(2,j);
entries.put(""+mode+" uStep",mode);
The problem is the EEPROM write or the read goes bad.
When I change the microstep 64 the utility read back wrong values after flash, with 32 step is ok.
My 1/32 axis/rev:9216000, with the double(18432000) maybe is to big the address?
I just tried to double the motor gear ratio to get the same value, and also got the same issue.
UPDATE!!!
The problem is the SyntaString.syntaEncoder cannot handle big numbers like 18432000, I guess cannot read back the values/or write to eeprom
When I changed the motor gear ratio to 7, and the aVal is 16128000, and the config read back was ok.
Settings :
motor:0.9
motor gear ratio:8
worm gear ratio:180
aVal: 18432000
Regards Tamas