Wed 02 Dec 2015 07:30:22 AM UTC, original submission:
(This is not a bug report but a patch for a new feature. This was the
only tracker I could add it to without registration.)
In my next open source hardware project I program an attiny to be an SPI
slave. I figured the easiest way to test the firmware would be to use my
parallel port avr programmer device to emulate an SPI bus master. For this
I need avrdude to be able to:
- avoid resetting the target device
- omit any SPI commands related to AVR programming during initialization
- initiate arbitrary long SPI transactions
The patch attached implements this in the following steps.
1. a new device flag AVRPART_NO_RESET can disable the reset signal
normally generated for no-tpi devices
2. a new device configuration called "spi" or "transparent_spi" defines
a device that omits the reset and all SPI communication during initialization
3. a new command line switch -S puts avrdude in transparent SPI mode
4. in transparent SPI mode binary data is relayed between stdio and SPI until
EOF on stdin.
I've tested it with a parallel port programmer and a scope, with
MISO-MOSI looped back with a wire, left unconnected or an attiny2313
connected. Both the transparent SPI mode and programming the attiny worked.
I have no idea if it works with non-bitbang programmers.
Command line for the transparent SPI mode: avrdude -c <whatever> -p spi -S
|