Mon 16 Jan 2012 05:25:31 PM UTC, original submission:
I apologize for the mess, but this is the result of attempting to add a more thorough AT89S5x support (including the 'S8253/'Sx051 subgroup (for which the "sck_polarity" config keyword was added) and accordingly modified STK500 firmware, to be published later); and while working on it, I could not resist to fix other bugs I came across...
This is a work in progress, so the '51-specific stuff is not polished up to expectations (including no documentation YET); I am submitting it as it is now as I have no idea when will I have the opportunity to get back to it. Incorporating them should make no harm to the "mainstream" though, IMO. Please note that this patch incorporates https://savannah.nongnu.org/patch/?7538 although with a different, more generic keyword ("reset_polarity" rather than "is_at89s", as the newer AT89LP family for which I plan to add support later too, has members with "normal" reset polarity).
On the other hand, items 1, 3 and 4 may be of general interest.
Adding to the mess, I tend to set my editor to strip extra spaces from line ends and convert tabs to spaces; sorry.
List of changes:
1. sck frequency setting/printout in terminal mode for stk500V2
- fixed sck frequency reading
- fixed correct calculation of the frequency (based on AVR068 rather than AVR061 which would be correct for stk500v1)
- both sck period and frequency printed out
- correct xtal frequency for AVRISP used
- sck frequency can be entered as frequency in Hz/kHz/MHz now
2. 'S5x programming support
- created a configuration file containing 'S52
- reset_polarity and sck_polarity (normal/invert) added to part configuration
- ** TODO ** add documentation
- reset pin for bitbanged-style programmers is inverted based on reset_polarity
- programming enable in bitbang.c now correctly checks returned value according to pollindex/pollvalue
- stk500v2 now issues the correct value for PARAM_RESET_POLARITY
- for paged memories, _byteblock and block (or any other name) mode added to stk500v2.c
3. default retry_pulse changed to RESET, as SCK is used for retry_pulse only in the historical AT90S parts
- ** todo ** set explicit retry_pulse in conf file for those parts where this applies
4. attempt to "spi" in terminal mode for stk500 crashed avrdude
- fixed (hopefully)
Jan Waclawek
|