[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-gcc-list] SPI troubles on atmega8
From: |
Brad Harrison |
Subject: |
Re: [avr-gcc-list] SPI troubles on atmega8 |
Date: |
Wed, 11 Dec 2002 08:42:59 -0600 |
Hi there,
Looking at your code, it seems that you havn't set the SS_BIT as an output.
If it's left as an input and is driven low, the SPI system becomes a slave
and you are not going to be able to initiate data transfer. Set that bit as
an output and see what happens.
I hope that fixes your problem. I went through a bunch of "fun" on the
weekend playing with SPI and a CAN controller.
Brad
Jamie Morken wrote:
> Hi,
>
> I am trying to get the SPI on my atmega8 chip to send 1 byte over the MOSI
> line.
> After doing the send I wait for the transmit complete flag in the SPI
status
> register
> to be set. For some reason the flag is not being set and I don't think
that
> any data is
> being transmitted either.
>
> I put the code I am using here:
> http://www.rocketresearch.org/new/midi-light.c
>
> It locks up right before the line:
> PRINT("byte sent");
>
>
> cheers,
> Jamie
>
>
> avr-gcc-list at http://avr1.org
avr-gcc-list at http://avr1.org