As Bob Paddock wrote:
> With that background, what I was thinking
> about was adding some type of 'preamble'
> to AVRDUDE, that would talk to the
> dual mode parts in I2C mode to disable
> I2C mode, which remains to be seen if that
> can even be done, as your turning of the
> interface your using. ...
Cool idea. In order to make it useful, I suggest you'd have
to invent some kind of "SPI language" though that just
generically describes the bit-bang transactions to perform
before trying to initiate the ISP sign-in sequence. Then,
allow such a sequence to be specified for your particular
programmer in your ~/.avrduderc aka. avrdude.ini (or whatever
it is called on Win32).
Something like:
preinit = "reset low; mosi high; sck high; wait 200;\
sck low; wait 100; mosi low; wait 10; mosi high; \
...";
One issue with that is that it would only be applicable to bit-bang
programmers, where avrdude handles the entire communication by itself.
> Assuming I go down this road,
> what sections of code should I be looking
> at to add this feature?
Any changes to the config syntax go through the lex scanner and yacc
parser in config_gram.y and lexer.l. Even if you don't know lex/yacc,
adding new stuff based on templates that can already be found there
should not be too hard.
The preinit bit-banging is probably best implemented as either a
separate file, or by adding it to bitbang.c, the generic (hardware
independent) bit-bang programmer implementation.
For a completely different route, couldn't you build one of those ISP
programmers that implement STK500 protocol but use their own micro to
run the bit-banging? Something like Matthias Weißer's USBisp (on
http://www.matwei.de/ ) comes to mind. That way, you could simply
modify the firmware to run your custom startup sequence, and
avrdude can be left completely untouched. I think that's the smaller
effort.
--
cheers, J"org .-.-. --... ...-- -.. . DL8DTL
http://www.sax.de/~joerg/ NIC: JW11-RIPE
Never trust an operating system you don't have sources for. ;-)
_______________________________________________
avrdude-dev mailing list
[email protected]
http://lists.nongnu.org/mailman/listinfo/avrdude-dev