[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] SPI comm on At90S8535
From: |
TODD BATZLER |
Subject: |
Re: [avr-gcc-list] SPI comm on At90S8535 |
Date: |
Wed, 27 Nov 2002 14:19:13 -0600 |
I've run into this issue as well, but with the Slave Select pin. Make
sure it's set up as an output for Master SPI mode. It took me half a
day to figure out that you need to configure the DDR for the SS pin as
an output BEFORE enabling the SPI thru SPCR. Setting the DDR as an
output after enabling the SPI has no affect, at least on the
mega8 I worked with most recently.
>>> "Mike Hoyt" <address@hidden> 11/27/02 11:17AM >>>
Torsten,
Sounds like MISO is configured as an input. I've never used the SPI
port in
slave mode, but according to the datasheet for the 8515 (I don't have
the
8535 datasheet), MISO is user-defined in slave mode. Therefore, you'll
have
to set the appropriate Data Direction bit to get MISO to function as
an
output.
Hope this helps,
--Mike
On Tuesday 26 November 2002 19:11, Torsten Mohr wrote:
> Hi,
>
> just a stupid question, it must be something really
> simple:
>
> I have:
> SIGNAL(SIG_SPI) {
> turn LED on
> }
>
> I initialise:
> outp(0x00, SPDR);
> outp(0xeb, SPCR); // slave mode, Int enabled, LSB first
> sei();
>
> Now when i set SlaveSelect of the AVR to GND, MISO should be
> set to a valid level, right?
>
> It is hanging at 1.3 V though there is nothing connected to it.
>
>
> I assume my initialisation is not correct, is there
> something missing? The interrupt is never called...
>
>
> Thanks for hints,
> Torsten.
>
> avr-gcc-list at http://avr1.org
avr-gcc-list at http://avr1.org
avr-gcc-list at http://avr1.org