Take the 2-minute tour ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

My understanding of the ATtiny13 datasheet is that although you can ISP the micro via "SPI" it actually doesn't have the functionality to operate on an SPI bus with other devices (at least not in hardware). Is that right?

share|improve this question
add comment

2 Answers

up vote 6 down vote accepted

Like all AVRs, the ATtiny13 uses SPI for programming. However, it doesn't have an actual SPI port that can be used in applications. Software SPI could be implemented, of course, and Atmel has an app note on the technique:

http://www.atmel.com/dyn/resources/prod_documents/doc1108.pdf

share|improve this answer
add comment

SPI is the simplest synchronous serial protocol you can think of, and since it requires only a shift register one could wonder why it isn't implemented in the ATtiny. At the same time the protocol's simplicity offers a solution: bit-banging. SPI is simpler to bit-bang than UART, where you have to worry about timing, or Manchester.
So the reason SPI is used for programming is that it's simple and reliable. The reason why it's not implemented in hardware is that it can easily be emulated in software.

share|improve this answer
    
Interesting; I was aware of bitbanging libraries, but had assumed that the performance would not be good enough to talk to many other devices; I am not yet familiar enough the the protocol to know how much of an issue this would be, but it sounds like not much. Thanks! –  Chinasaur Jul 1 '11 at 20:32
    
@Chinasaur - Like I said, with SPI you don't have to worry about timing. As SPI master you provide the clock pulses, so it doesn't matter if one of them comes a bit later. –  stevenvh Jul 2 '11 at 4:35
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.