It works. I hate RealTek. Even with the r8618_dkms driver it doesn't work. I bought a Intel network card, set irq coalesce rx-usecs and tx-usecs to 0. Now it works works WORKS. No lost packages, no delayed packages. I hate RealTek
This commit is contained in:
@@ -22,7 +22,7 @@ public:
|
|||||||
HardwareTimer *startTimer; // Use timers 10,11,13,14
|
HardwareTimer *startTimer; // Use timers 10,11,13,14
|
||||||
uint8_t dirPin;
|
uint8_t dirPin;
|
||||||
PinName stepPin;
|
PinName stepPin;
|
||||||
uint32_t Tjitter = 350; // Longest time from IRQ to handling in handleStepper, unit is microseconds
|
uint32_t Tjitter = 400; // Longest time from IRQ to handling in handleStepper, unit is microseconds
|
||||||
uint64_t dbg;
|
uint64_t dbg;
|
||||||
const uint16_t t2 = 5; // DIR is ahead of PUL with at least 5 usecs
|
const uint16_t t2 = 5; // DIR is ahead of PUL with at least 5 usecs
|
||||||
const uint16_t t3 = 3; // Pulse width at least 2.5 usecs
|
const uint16_t t3 = 3; // Pulse width at least 2.5 usecs
|
||||||
|
|||||||
@@ -84,8 +84,7 @@ void StepGen2::startTimerCB()
|
|||||||
digitalWriteFast(digitalPinToPinName(dirPin), nSteps < 0 ? HIGH : LOW); // nSteps negative => decrease, HIGH
|
digitalWriteFast(digitalPinToPinName(dirPin), nSteps < 0 ? HIGH : LOW); // nSteps negative => decrease, HIGH
|
||||||
// There will be a short break here for t2 usecs, in the future.
|
// There will be a short break here for t2 usecs, in the future.
|
||||||
timerEndPosition += nSteps;
|
timerEndPosition += nSteps;
|
||||||
pulseTimer->pause();
|
pulseTimer->setMode(pulseTimerChan, TIMER_OUTPUT_COMPARE_PWM2, stepPin);
|
||||||
pulseTimer->setMode(pulseTimerChan, TIMER_OUTPUT_COMPARE_PWM1, stepPin);
|
|
||||||
pulseTimer->setOverflow(timerFrequency, HERTZ_FORMAT);
|
pulseTimer->setOverflow(timerFrequency, HERTZ_FORMAT);
|
||||||
pulseTimer->setCaptureCompare(pulseTimerChan, 50, PERCENT_COMPARE_FORMAT);
|
pulseTimer->setCaptureCompare(pulseTimerChan, 50, PERCENT_COMPARE_FORMAT);
|
||||||
pulseTimer->refresh();
|
pulseTimer->refresh();
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ void handleStepper(void)
|
|||||||
timeDiff = 1000 * (reallyNowTime - reallyThenTime);
|
timeDiff = 1000 * (reallyNowTime - reallyThenTime);
|
||||||
nLoops = round(double(timeDiff) / double(StepGen2::sync0CycleTime));
|
nLoops = round(double(timeDiff) / double(StepGen2::sync0CycleTime));
|
||||||
reallyThenTime = reallyNowTime;
|
reallyThenTime = reallyNowTime;
|
||||||
|
nLoops=1;
|
||||||
Step1.enabled = true;
|
Step1.enabled = true;
|
||||||
Step1.commandedPosition = Obj.CommandedPosition1;
|
Step1.commandedPosition = Obj.CommandedPosition1;
|
||||||
Step1.stepsPerMM = Obj.StepsPerMM1;
|
Step1.stepsPerMM = Obj.StepsPerMM1;
|
||||||
|
|||||||
Reference in New Issue
Block a user