ts-7000
[Top] [All Lists]

Re: [ts-7000] Re: problem with SSP : spi format + Slave Mode

To:
Subject: Re: [ts-7000] Re: problem with SSP : spi format + Slave Mode
From: Brian Newberry <>
Date: Wed, 5 Jul 2006 06:30:34 -0700 (PDT)
I encountered a similar problem when trying to use the TS-7200 SPI port and I don't think its your software or the way you are trying to set up as the slave.  It may be a problem with your physical setup or a limitation thereof.  My problem was the interference that the signal lines caused on one another.  The crosstalk between the wires was significant enough to hose the communication completely past a certain speed.  SPI is a great way to get high speed communication when the two chips communicating are on the same board where small traces of PCB are used to connect devices, but the bandwidth should be limited by trying to connect using a cable especially one of any significant length.
 
If you have access to an oscilliscope try sending the same byte multiple times and try to capture each signal line on the screen.  If you do this I think you will see that when two lines go low or high simultaneously this will cause a spike on the other lines large enough to mess up the transmission.  Obviously this kind of interference will not allow your reciever to interpret the data correctly.
 
It is also very important to make sure your wires are all the same length.  This will skew your results which gets worse as your clock speed increases.
 
What I did to get my system to work was used a short length of ribbon cable to connect the TS-7200 SPI to my peripheral.  This gave me the exact same length on all wires and allowed me to put ground lines between every signal.  This is a trick I think is done on IDE cables as well to help mitigate crosstalk on the wires.  I was still only able to get speeds of up to 1.1 MHz to work flawlessly.  As I sped up the clock my performance degraded.  So even with my setup I still didn't get much faster than what you are describing that you have already acheived.
 
So it may be you've done everything right and will still be unable to get the high speeds that you want.
 
Brian

suptouch <> wrote:
I've develop a driver module for the SSP in SPI slave mode.
I 've an interrupt on the SSP fifo to catch the received data.

When I work at 850KHz, all work, all the received data are true but
when I try with 1.7MHz or faster (I've try with 2.4MHz or 3MHz), some
data are bad :
- in 8 bit mode the first bit is some time bad
- in 16 bit mode , some data are lost.

In master mode , the max frequency is 3.645MHz.

What's the max frequency than can use in slave mode ?
Is there condition to use it ?

--- In .com, "suptouch" <.> wrote:
>
> Perhaps, I've two ideas :
>
> 1/
> My SPI slave test program is in user space.
> Can I use the SPI in user space ? or have I to develop it in kernel
> space ? why ?
>
>
> 2/
>
> The SPI is also use with the eeprom, and I presume that at the boot ,
> it's use in master ...
>
> Is here a special procedure to configure SPI to slave from master ?
>
>
>
> --- In .com, "suptouch" <suptouch@> wrote:
> >
> > I need to use the SSP (synchronous serial port) of the TS7300 in 16
> > bit SPI slave mode. In the final project, I need to work with a fast
> > SPI (3MHz or faster), in continous mode. I will implement a SPP module
> > to do it and perhaps use the DMA to fill a RAM buffer.
> >
> > The clock is connected to the SPI_CLK so to the SCLK1 of the EP9302.
> > The out of the master is connected to the SPI_MISO so to the SSPRX1 of
> > the EP9302.
> >
> > For the first test with the SPI, I'm trying with a reduced master
> > (8bit, 250KHz, not continous mode). The signal is like the 19.8 figure
> > (page 506) in the user manuel so with the SPO and SPH activated.
> >
> > After reading the EP9301 user manual, while inspiring to me with the
> > spp.c driver in the mach-ep93xx and the tempSensor.c, I've develop
> > this small test program :
> >
> > ssp_page = mmap(0, getpagesize(), PROT_READ|PROT_WRITE, MAP_SHARED,
> > fd, SSP_PAGE);
> >
> > /* 1.) Set enable bit(SSE) in register SSPCR1*/
> > POKE32( (unsigned long)(ssp_page + SSPCR1), SSPC1_SSE );
> >
> > /* 2.) Write other SSP config registers(SSPCR0 & SSPCPSR)*/
> > POKE32( (unsigned long)ssp_page + SSPCR0, (SSPCR0_FRF_MOTOROLA |
> > SSPCR0_SPH | SSPCR0_SPO | SSPCR0_DSS_8BIT) );
> >
> > /* 3.) Clear the enable bit(SSE) in register SSPCR1*/
> > POKE32( (unsigned long)(ssp_page + SSPCR1), 0x00 );
> >
> > /* 4.) Set the enable bit(SSE) in register SSPCR1*/
> > POKE32( (unsigned long)(ssp_page + SSPCR1), (SSPC1_MS | SSPC1_SSE) );
> >
> > /* Done with configuration now lets read ...*/
> > while(1)
> > {
> > val = PEEK32((unsigned long)(ssp_page + SSPSR));
> > if(val & SSPSR_RNE)
> > {
> > //read the data
> > val = PEEK32( (unsigned long)(ssp_page + SSP_DATA) );
> > printf("The test is:0x%x ", val);
> > printf(" ## SSPSR : 0x%x \n",PEEK32((unsigned long)(ssp_page +
> > SSPSR))&0x0F);
> > }
> > }
> > /* end program */
> >
> > When I send a data from the master, my program catch sometimes a good
> > character ... but I've to try to send lot of time to catch one. When
> > I've read the character the RNE flag stay up in the status register
> > SSPSR and so I continue to catch the same character !
> >
> > Perhaps, I've a bad configuration for the slave mode and I don't read
> > correctly in the SSP. I can't find more information in the user
> manual ...
> >
> > I seek for someone witch use the SSP in slave SPI ... but also for any
> > other proposal
> >
> > Thanks !
> >
>



Do you Yahoo!?
Next-gen email? Have it all with the all-new Yahoo! Mail Beta. __._,_.___


SPONSORED LINKS
Linux os Hardware Arms
Computer internet Computer security Computer hardware security


YAHOO! GROUPS LINKS

  •  Visit your group "ts-7000" on the web.
     
  •  To unsubscribe from this group, send an email to:
     =Unsubscribe
     
  •  Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.



__,_._,___
<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