SPI in ATmega103

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

I was wondering if anybody out there used ATmega103 with multiple SPI devices. If so, how do
you go about implementing this in the hardware? Also, what is the max bus speed?

Thanks.
Vijay

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Assuming the 103 is the master, attach every one to the MOSI, MISO, SCK & GND lines. Use individual SS lines for each slave. Select only one at a time. The rest are supposed to be inactive when not selected.

admin's test signature
 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Bus speed depends on the MCU's clock frequency and SPR1:SPR0 bits of the SPCR register. It may be Fxtal/4, Fxtal/16, Fxtal/64 or Fxtal/128. Therefore, max bus speed is equal to Fxtal/4, and if Fxtal=6 MHz, max bus speed = 1,5 Mbit per second