Re: SPI Problem

"TODD BATZLER" <[email protected]> Wed, 14 Jan 2004 07:48:30 -0600
Newsgroups gmane.comp.hardware.avr.general
Message-ID <[email protected]>
Question.  Are you setting up the SS pin as an output before enabling
the SPI port?  I had a similar problem on the mega8.  If I set up the
sfr's for the SPI port, then the sfr's for PORTB to set SS as a general
purpose I/O port, my settings for DDRB were be overridden.  On a SPI
command I would get one pass thru the SPI ISR and the part would switch
to slave mode.  No data, no SCLK, nothing would happen coming "out" of
the SPI port.

I "fixed" it by setting up the port DDRB and PORT sfr's first, then
setting up the SPI sfr's (basically enabling the SPI port after setting
up SS as an output).

Hope this helps.
----------------------------------------------------
This message may contain privileged and/or
confidential information.  If you have received
this e-mail in error or are not the intended
recipient, you may not use, copy, disseminate
or distribute it; do not open any attachments,
delete it immediately from your system and notify
the sender promptly by e-mail that you have done so.
Thank you.
<<<<Miller Electric Mfg, Co.>>>>