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 "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 !
>
------------------------ Yahoo! Groups Sponsor --------------------~-->
You can search right from your browser? It's easy and it's free. See how.
http://us.click.yahoo.com/_7bhrC/NGxNAA/yQLSAA/CFFolB/TM
--------------------------------------------------------------------~->
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|