-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Query a programmer to figure out its current clock speed (low priority) #1329
Comments
I've played around a little and implemented I'll throw this one on the back burner for now. |
There are multiple USBASP FW in the market. There are also programmers called USBISP which can be made to be compatible with avrdude.
From version 1.07 (or maybe 1.06 version), it is using a default SCK clock of 1.5Mhz and automatic SCK slowing if target does not respond. PORTD is left as input, so this firmware also works with USBISP modules. ( nerdralph ) From version 1.08 the firmware is WCID compliant, meaning it should work on Windows without any driver or .inf install.
|
I am thinking one way to sort out this issue is to add a parameter for the programmer to advertise that it has the capability to report the bit clock and then implement the enhancement only for those programmers. |
Just wondering if you have some comments about this issue. Thanks. Or maybe we can just close this issue as not planned for now. |
Both protocols stk500 and stk500v2 have the parameter
But they do not send the parameter to set the SCK speed, here for v1: $ avrdude-git -c stk500v1 -pt85 -vvvv -B1 -l B1
$ avrdude-git -c stk500v1 -pt85 -vvvv -B10 -l B10
$ diff -u B1 B10
--- B1 2023-11-05 17:36:34.973659722 +0100
+++ B10 2023-11-05 17:36:43.433718475 +0100
@@ -8,7 +8,7 @@
Using Port : /dev/ttyUSB0
Using Programmer : stk500v1
- Setting bit clk period : 1.0
+ Setting bit clk period : 10.0
avrdude-git: ser_send: 0 [30] [20]
avrdude-git: ser_send: 0 [30] [20]
avrdude-git: ser_send: 0 [30] [20] |
stk500v2 already sets the |
At the moment, Avrdude can change the clock speed using the -B flag, but there's no way to query the programmer to reveal what the current ISP clock is set to.
The default programmer clock speed varies significantly between different hardware. The USBasp for instance, has a default clock of ~750kHz and is too fast for a stock AVR running at 1 MHz.
Several genuine Atmel/Microchip programmers store the last used clock frequency in its non-volatile memory, meaning the user has to use the -B flag to restore it to its default speed. None of this is evident to the users really.
It would be great if Avrdude could be aware of the current ISP clock speed, regardless if the user is using the -B flag or not.
Then, if the clock speed is too fast for the target, Avrdude could print the current clock speed.
Perhaps the current clock speed could be viewed in terminal mode as well using the
sck
command without passing a second argument?The text was updated successfully, but these errors were encountered: