ts-7000
[Top] [All Lists]

[ts-7000] Re: SPI interface on TS7500

To:
Subject: [ts-7000] Re: SPI interface on TS7500
From: Michael Schmidt <>
Date: Wed, 12 Jan 2011 09:58:00 -0700
On 1/11/2011 6:26 AM,  wrote:
>
>      Posted by: "norma"  norma_elits
>      Date: Mon Jan 10, 2011 1:38 pm ((PST))
>
> dear Forum

Hello Norma,

> Excuse me for opening this topic again. I have read TS Documentation but I 
> still can't solve my problem.
> I am trying to utilize hardware SPI without modifying FPGA core.
> What I was trying is running TS7500 without TS752, so I can use SPI pins 
> which were before connected to offboard SPI (TS-752 flash chip) for my custom 
> requirement.
>
> 11     DIO_11                DIO or flash_cs#
> 12     DIO_12                DIO or spi_miso
> 13     DIO_13                DIO or spi_mosi
> 14     DIO_14                DIO or spi_clk
>
> I was trying the following code and tapping signal form SPI pins to 
> oscilloscope, but I didn't get anything.
>
>      sbuslock();
>      sbus_poke16(0x40, (0<<  14) | (15<<  10) | (1<<  8)); // go to LUN#1
>      sbus_poke16(0x4c, ii); // write ii to SPI
>      usleep(10000);
>      ret_val = sbus_peek16(0x42)>>  3; // read from SPI
>      usleep(10000);
>      sbusunlock();
>
> Did I access the right register? Is there any procedure I must do before 
> accessing SPI register?
> I give so much appreciation for your answer

Have you tried the spictl utility?  For many applications you may be 
able to use it as-is, otherwise it can serve as sample code which you 
can modify to suit your needs.

For example, the following command would set SPI to use the positive 
clock edge, with a clock frequency of 2Mhz, using LUN #1, and would 
write 0x04:0x00 and then would write 0x01:0x02 while reading and 
outputting to stdout in hex format:

spictl -e 1 -c 2000000 -l 1 -w 04:00 -d 01:02 | hexdump -C

Or for a description of the available command line options:

spictl --help

One benefit of using spictl is that you can also issue SPI commands 
remotely over TCP/IP, either using spictl as a client, or by writing 
your own client in any language you like that supports TCP ports.  I'm 
not positive that the spictl server runs by default though, so you'll 
want to make sure it is running first.  (spictl --server)


  ______   Best Regards,
|__  __/                  Michael Schmidt
    ||                   Software Engineer
    ||echnologic Systems (EmbeddedARM.com)
    || (480)        16525 East Laser Drive
    |/ 837-5200   Fountain Hills, AZ 85268
        http://oz.embeddedarm.com/~michael


------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU