public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] at91sam7 spi test code
@ 2007-01-30 20:36 Frank Wu
  2007-01-30 20:51 ` Andrew Lunn
  2007-01-30 22:55 ` [ECOS] Fwd: " Nikita Tabatsky
  0 siblings, 2 replies; 6+ messages in thread
From: Frank Wu @ 2007-01-30 20:36 UTC (permalink / raw)
  To: ecos-discuss

Dear All,

I want to use SPI bus on a sam7 uC. Where can I find SPI test code to
make sure the SPI driver works?

Thanks,

Frank

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] at91sam7 spi test code
  2007-01-30 20:36 [ECOS] at91sam7 spi test code Frank Wu
@ 2007-01-30 20:51 ` Andrew Lunn
  2007-01-31  0:55   ` Frank Wu
  2007-01-30 22:55 ` [ECOS] Fwd: " Nikita Tabatsky
  1 sibling, 1 reply; 6+ messages in thread
From: Andrew Lunn @ 2007-01-30 20:51 UTC (permalink / raw)
  To: Frank Wu; +Cc: ecos-discuss

On Tue, Jan 30, 2007 at 12:36:40PM -0800, Frank Wu wrote:
> Dear All,
> 
> I want to use SPI bus on a sam7 uC. Where can I find SPI test code to
> make sure the SPI driver works?

This is not easy. You need a device on the bus and a driver for the
device. It is not really possible to test the SPI bus driver without
testing the SPI device device driver at the same time.

So i suggest you just write your device device driver and maybe
connect a logic analyser/3-channel digital oscilloscope to the SPI bus.

        Andrew

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ECOS] Fwd: [ECOS] at91sam7 spi test code
  2007-01-30 20:36 [ECOS] at91sam7 spi test code Frank Wu
  2007-01-30 20:51 ` Andrew Lunn
@ 2007-01-30 22:55 ` Nikita Tabatsky
  1 sibling, 0 replies; 6+ messages in thread
From: Nikita Tabatsky @ 2007-01-30 22:55 UTC (permalink / raw)
  To: Frank Wu, ecos-discuss

Hi Frank.

There you can find an example of work with SD MMC cards.
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/efsl_arm/index.html

".....Memory-cards like SD-Cards or MMC offer a huge amount of memory
and are relativly cheap. SD-Cards and MMC can be accessed in SPI-Mode
so only 4 data-lines are needed to connect such cards to a
microcontroller (chip-select, MOSI, MISO, SCK). To read and write data
from/to the  card with a "standard"-PC a filesystem is needed......"


Best Regards,
  Nikita

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] at91sam7 spi test code
  2007-01-30 20:51 ` Andrew Lunn
@ 2007-01-31  0:55   ` Frank Wu
  2007-01-31  1:13     ` jiang jet
  2007-01-31  7:17     ` Andrew Lunn
  0 siblings, 2 replies; 6+ messages in thread
From: Frank Wu @ 2007-01-31  0:55 UTC (permalink / raw)
  To: Frank Wu, ecos-discuss

Hi Andrew,

It is very easy to get a SPI eeprom sample chip on line to be the SPI device.
Maybe my question is not addressed clearly. What I want is how to use
SPI driver in eCos porting to at91sam7 evaluation board (I have the
board). Something like,
1) Initialize the spi port
2) write
3) read
4) use in interrupt/pulling mode

Thanks

Frank


On 1/30/07, Andrew Lunn <andrew@lunn.ch> wrote:
> On Tue, Jan 30, 2007 at 12:36:40PM -0800, Frank Wu wrote:
> > Dear All,
> >
> > I want to use SPI bus on a sam7 uC. Where can I find SPI test code to
> > make sure the SPI driver works?
>
> This is not easy. You need a device on the bus and a driver for the
> device. It is not really possible to test the SPI bus driver without
> testing the SPI device device driver at the same time.
>
> So i suggest you just write your device device driver and maybe
> connect a logic analyser/3-channel digital oscilloscope to the SPI bus.
>
>        Andrew
>

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] at91sam7 spi test code
  2007-01-31  0:55   ` Frank Wu
@ 2007-01-31  1:13     ` jiang jet
  2007-01-31  7:17     ` Andrew Lunn
  1 sibling, 0 replies; 6+ messages in thread
From: jiang jet @ 2007-01-31  1:13 UTC (permalink / raw)
  To: qiongwu23; +Cc: ecos-discuss

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=gb2312; format=flowed, Size: 2002 bytes --]

All device drivers in Ecos are almost the same.you have to implement two 
MACRO, DEVTAB_ENTRY,DEVIO_ENTRY, here you can do the job you decribe, 
initialization..read write register interrupt and so on..
BTW, you have to make sure ur bus work correctly, or else it will be a 
nightmare for u to debug device driver...

jet


>From: "Frank Wu" <qiongwu23@gmail.com>
>To: "Frank Wu" <qiongwu23@gmail.com>,  	ecos-discuss 
<ecos-discuss@ecos.sourceware.org>
>Subject: Re: [ECOS] at91sam7 spi test code
>Date: Tue, 30 Jan 2007 16:55:35 -0800
>
>Hi Andrew,
>
>It is very easy to get a SPI eeprom sample chip on line to be the 
>SPI device.
>Maybe my question is not addressed clearly. What I want is how to 
>use
>SPI driver in eCos porting to at91sam7 evaluation board (I have the
>board). Something like,
>1) Initialize the spi port
>2) write
>3) read
>4) use in interrupt/pulling mode
>
>Thanks
>
>Frank
>
>
>On 1/30/07, Andrew Lunn <andrew@lunn.ch> wrote:
>>On Tue, Jan 30, 2007 at 12:36:40PM -0800, Frank Wu wrote:
>> > Dear All,
>> >
>> > I want to use SPI bus on a sam7 uC. Where can I find SPI test 
>>code to
>> > make sure the SPI driver works?
>>
>>This is not easy. You need a device on the bus and a driver for the
>>device. It is not really possible to test the SPI bus driver 
>>without
>>testing the SPI device device driver at the same time.
>>
>>So i suggest you just write your device device driver and maybe
>>connect a logic analyser/3-channel digital oscilloscope to the SPI 
>>bus.
>>
>>        Andrew
>>
>
>--
>Before posting, please read the FAQ: 
>http://ecos.sourceware.org/fom/ecos
>and search the list archive: 
>http://ecos.sourceware.org/ml/ecos-discuss
>

_________________________________________________________________
ÓëÁª»úµÄÅóÓѽøÐн»Á÷£¬ÇëʹÓà MSN Messenger:  http://messenger.msn.com/cn  


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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] at91sam7 spi test code
  2007-01-31  0:55   ` Frank Wu
  2007-01-31  1:13     ` jiang jet
@ 2007-01-31  7:17     ` Andrew Lunn
  1 sibling, 0 replies; 6+ messages in thread
From: Andrew Lunn @ 2007-01-31  7:17 UTC (permalink / raw)
  To: Frank Wu; +Cc: ecos-discuss

On Tue, Jan 30, 2007 at 04:55:35PM -0800, Frank Wu wrote:
> Hi Andrew,
> 
> It is very easy to get a SPI eeprom sample chip on line to be the SPI 
> device.
> Maybe my question is not addressed clearly. What I want is how to use
> SPI driver in eCos porting to at91sam7 evaluation board (I have the
> board). Something like,
> 1) Initialize the spi port
> 2) write
> 3) read
> 4) use in interrupt/pulling mode

O.K. So you need to read the manual:

http://ecos.sourceware.org/docs-latest/ref/io-spi.html

There is already a driver for the AT91SAM7S and AT91SAM7X, so there is
no need to write any new driver code. 

What you need is a structure for each device on the bus. eg see
packages/devs/spi/arm/eb55/current/src/spi_eb55.c which declares a
DataFlash device on the bus. And you need a device drives for the
device, eg  packages/disk/generic/mmc/current/src

Unfortunately, i don't think there is a complete example in anoncvs of
all the parts coming together for one development board :-(

    Andrew

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-01-31  7:17 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-01-30 20:36 [ECOS] at91sam7 spi test code Frank Wu
2007-01-30 20:51 ` Andrew Lunn
2007-01-31  0:55   ` Frank Wu
2007-01-31  1:13     ` jiang jet
2007-01-31  7:17     ` Andrew Lunn
2007-01-30 22:55 ` [ECOS] Fwd: " Nikita Tabatsky

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).