public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Julien St?phane <Stephane.Julien@he-arc.ch>
Cc: ecos-discuss@ecos.sourceware.org, andrew@lunn.ch,
		Etique Philippe <Philippe.Etique@he-arc.ch>
Subject: [ECOS] Re: RE?: [ECOS] RE?: RE?: [ECOS] Does AT91 SPI driver support external SPI devices?
Date: Wed, 28 Feb 2007 17:37:00 -0000	[thread overview]
Message-ID: <20070228173706.GD14399@lunn.ch> (raw)
In-Reply-To: <F7620004260C5D4DB836EDBF8CC6872D028943BB@neptune.intra.eiaj.ch>

On Wed, Feb 28, 2007 at 05:45:38PM +0100, Julien St?phane wrote:
> Yes, the processor is a AT91M55800A. Effectively, it has only one SPI device.
> 
> First, I printed the values of "val" in the set_npcs
> function. Effectively, they change when I change the dev_num
> value. As I understand the function and the values printed, it is
> not writed to work with a multiplexor.

Yes it is. Look at spi_at91_start_transfer() where it calls
spi_at91_set_npcs().

> static void
> spi_at91_set_npcs(cyg_spi_at91_bus_t *spi_bus,int val)
> {
>    /*cyg_uint32 ctr;
>    for(ctr=0;ctr<4;ctr++)
>    {
>       printf("### val1=%i, val2=%i ###\n",val, (val & (1<<ctr)));
>       if(spi_bus->cs_en[ctr])
>       {
>         HAL_ARM_AT91_GPIO_PUT(spi_bus->cs_gpio[ctr], (val & (1<<ctr)));
>       }
>    }*/
>    
>    HAL_ARM_AT91_GPIO_PUT(spi_bus->cs_gpio[0], 0);
>    HAL_ARM_AT91_GPIO_PUT(spi_bus->cs_gpio[1], 1);
>    HAL_ARM_AT91_GPIO_PUT(spi_bus->cs_gpio[2], 0);
>    HAL_ARM_AT91_GPIO_PUT(spi_bus->cs_gpio[3], 1);
> }
> 

> I have tried many values for the different bits because I don't know
> which is the MSB and the LSB. No changes appeared. I never had the
> chip select CS5-8 activated.

And what happens to the actual chip pins, not the demultiplexor pins.
Does the chip pins change?

It could be something like the GPIO functions are not working for the
AT91M55800A.

Which pin is your LED on?

Try something like:
HAL_ARM_AT91_GPIO_CFG_DIRECTION(AT91_PIN_LED, AT91_PIN_OUT);
for(;;) {
        HAL_ARM_AT91_GPIO_PUT(AT91_PIN_LED,0);
        cyg_thread_delay(100);
        HAL_ARM_AT91_GPIO_PUT(AT91_PIN_LED,1);
        cyg_thread_delay(100);
}

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

  reply	other threads:[~2007-02-28 17:37 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <F7620004260C5D4DB836EDBF8CC6872D028943B5@neptune.intra.eiaj.ch>
2007-02-28 14:05 ` Julien Stéphane
2007-02-28 14:43   ` Andrew Lunn
     [not found]     ` <F7620004260C5D4DB836EDBF8CC6872D028943B7@neptune.intra.eiaj.ch>
2007-02-28 15:07       ` [ECOS] RE : " Julien Stéphane
     [not found]       ` <20070228151737.GA14399@lunn.ch>
2007-02-28 15:34         ` [ECOS] RE : RE?: " Julien Stéphane
2007-02-28 15:59           ` [ECOS] RE?: " Andrew Lunn
2007-02-28 16:45             ` [ECOS] RE : " Julien Stéphane
2007-02-28 17:37               ` Andrew Lunn [this message]
2007-03-01 10:15                 ` [ECOS] RE : RE: RE: " Julien Stéphane
2007-03-01 13:04                   ` [ECOS] RE?: " Andrew Lunn
2007-03-01 14:43                     ` Julien Stéphane
2007-02-28 17:13             ` [ECOS] RE : [ECOS] RE?: RE?: " Julien Stéphane
2007-02-28 17:36               ` [ECOS] " Grant Edwards

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070228173706.GD14399@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Philippe.Etique@he-arc.ch \
    --cc=Stephane.Julien@he-arc.ch \
    --cc=ecos-discuss@ecos.sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).