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:
Hakan Bastedt
2024-03-20 17:06:24 +01:00
parent d4fed6cfe8
commit 8f26a10224
3 changed files with 3 additions and 4 deletions

View File

@@ -22,7 +22,7 @@ public:
HardwareTimer *startTimer; // Use timers 10,11,13,14
uint8_t dirPin;
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;
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

View File

@@ -84,8 +84,7 @@ void StepGen2::startTimerCB()
digitalWriteFast(digitalPinToPinName(dirPin), nSteps < 0 ? HIGH : LOW); // nSteps negative => decrease, HIGH
// There will be a short break here for t2 usecs, in the future.
timerEndPosition += nSteps;
pulseTimer->pause();
pulseTimer->setMode(pulseTimerChan, TIMER_OUTPUT_COMPARE_PWM1, stepPin);
pulseTimer->setMode(pulseTimerChan, TIMER_OUTPUT_COMPARE_PWM2, stepPin);
pulseTimer->setOverflow(timerFrequency, HERTZ_FORMAT);
pulseTimer->setCaptureCompare(pulseTimerChan, 50, PERCENT_COMPARE_FORMAT);
pulseTimer->refresh();

View File

@@ -58,7 +58,7 @@ void handleStepper(void)
timeDiff = 1000 * (reallyNowTime - reallyThenTime);
nLoops = round(double(timeDiff) / double(StepGen2::sync0CycleTime));
reallyThenTime = reallyNowTime;
nLoops=1;
Step1.enabled = true;
Step1.commandedPosition = Obj.CommandedPosition1;
Step1.stepsPerMM = Obj.StepsPerMM1;