question about usbtinyisp firmware

USB AVR Programmer and SPI interface. Adafruit's USBtinyISP.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
rb76543
 
Posts: 29
Joined: Sat Dec 15, 2007 7:52 pm

question about usbtinyisp firmware

Post by rb76543 »

from the usbtinyisp overview:

# Existing firmware allows for fast SPI interfacing using USB

does 'spi interfacing' refer to spi communication in general, i.e., my pc sends one or more bytes to my avr, or is it referring to the 4-byte spi commands, such as 'read eeprom memory'?

the reason i ask is, my old parallel-port based system involves lots of communication between my pc and the running program in the avr, which is done via the spi. also, periodically, the avr uses the miso line to signal the pc that a new packet of data is ready for the pc to retrieve.

i've looked at the usbtinyisp firmware, and it appears that i will need to add code to the firmware to communicate over usb the way i use the parallel port. it looks to me like the basic function in the firmware, spi(), can handle 1 byte, but both usb_in() and usb_out() call spi_rw() which always sends 4 bytes to the avr.

can anyone confirm this, or have i overlooked/misunderstood something?

thanks,

rod

rb76543
 
Posts: 29
Joined: Sat Dec 15, 2007 7:52 pm

Post by rb76543 »

this is what i need:

device sends a message to pc when miso line changes state (while no spi operations are happening).

device has conduit mode where it passes bytes from master (pc) to slave (avr), and returns the response byte.

not too hard, once i learn how to flash the avr on the usbtiny board.

i'll post the code here when it works.

rod

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm

Post by adafruit »

it definately can do only 1 byte a time. i suggest you continue to look at the example C++ spi xfer code linked on the website

rb76543
 
Posts: 29
Joined: Sat Dec 15, 2007 7:52 pm

Post by rb76543 »

ladyada wrote:it definately can do only 1 byte a time. i suggest you continue to look at the example C++ spi xfer code linked on the website
you have made my day. thanks!

rod

Locked
Please be positive and constructive with your questions and comments.

Return to “USBtinyISP”