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 --------------------~-->
Get to your groups with one click. Know instantly when new email arrives
http://us.click.yahoo.com/.7bhrC/MGxNAA/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/
|