From: <dhy...@al...> - 2006-10-04 18:54:43
|
Hi, > I wanna connect gumstix and robostix(R324) over SPI. > So I compiled wiki sample code of SPI and execute it . It worked > well after few modifications. > Then I wrote program to communicate with robostix, but I couldn't. > while(!(SPSR & (1 << SPIF))) > Question1 > Is gumstix and robostix(R324) SPI Line connected ? Yes the gumstix and robostix are connected together. However, the way that they're connected together forces the gumstix to be the master and the robostix to be the slave. > Question 2 > If so, I think what I should do in robostix program to send DATA from > robostix to gumstix is to The robostix can't initiate the converstaion. The robostix needs to be configured as a slave, which means that the gumstix controls the clock. > set DATA > SPDR = DATA; > enable SPI > SPCR = (1<<SPE); > and then wait transmission > while(!(SPSR & (1 << SPIF))); > > Is this right? That looks right for receiving, although I don't see whether you set the DDR register for the MOSI and MISO, SCK, and SS pins correctly? Dave Hylands |