Replies: 6 comments 3 replies
-
I think it is okay to have |
Beta Was this translation helpful? Give feedback.
-
I already started to deep dive into stk500v1 ( |
Beta Was this translation helpful? Give feedback.
-
Using a |
Beta Was this translation helpful? Give feedback.
-
main...Ho-Ro:avrdude:stk500-x_xtal This is work in progress, step 1 fixed some minor bugs sleeping in the code (it seems that these extra options are not heavily used). Unfortunately my editor kate automatically removes trailing spaces even when told to do not, so there are some format changes. If you don't like this, I can rework - finally I found the solution. Step 2 will be the implementation of EDIT: HOLD on, the more I test, the more bugs creep in, e.g. -xfosc=100k works, but -xfosc=100000 sets fosc=0.000 |
Beta Was this translation helpful? Give feedback.
-
I did - and during testing I discovered some issues how we call it in the job - not bug, not error...
or even mhz (shudder) but -x xtal=1234567Hz should also work, I will add this. - wenn schon, denn schon - how we say in German. :) |
Beta Was this translation helpful? Give feedback.
-
The stk500 v1 (as well as the stk500 v2) uses the constant xtal frequency (7372800 Hz) of the original Atmel STK500 HW when calculating the timer parameters
Parm_STK_OSC_PSCALE
andParm_STK_OSC_CMATCH
from the terminal commandfosc
to set the external clock for targets without their own clock source.These two parameters are direct register values for an 8-bit timer of an ATmega, (e.g.
TCCR2B
andOCR2A
for m328p).When using an STK500 compatible programmer with a different clock (e.g. based on an Arduino Nano with 16 MHz), the resulting frequency is much too high.
My current solution is to change this line in
stk500.c
fromto
before building :)
I don't see a straightforward concept at the moment how to provide the correct frequency for
avrdude
, unless you introduce a newprogrammer
parameter, e.g.xtal
.I am posting this here for discussion anyway, maybe you can find a simple future solution that fits into your concept.
Thx, Martin
Beta Was this translation helpful? Give feedback.
All reactions