sundar dev

SPI configuration

Discussion created by sundar dev on Jan 29, 2008
Latest reply on Jan 29, 2008 by sundar dev
Hi! I'm trying to transmit a byte from SPI0 to SPI1, for which I tried using the below given code- --------------------------------------------------------- void main(void) { SPI0CR1=0x5F;//SPIO enabled and cofigured as master SPI0CR2=0x00; SPI0BR=0x77; SPI1CR1=0x48;//SPI1 enabled and configured as slave SPI1CR2=0x00; SPI1BR=0x77; EnableInterrupts; for(;:smileywink: { while(!SPI0SR_SPTEF ); SPI0DR=0x78; while(!SPI1SR_SPIF); i=SPI1DR; } } ----------------------------------------------- and also this is being run as Full Chip Simulation where i've used the following command file to virtually connect MOSI0 to MOSI1 and SCK0 to SCK1 ------------- openio pinconn connect "Pim.PORTSPin5","Pim.PORTPPin1" connect "Pim.PORTSPin6","Pim.PORTPPin2" ------------- My problem is, while the Txd byte is available at MOSI0, the same is not being transmitted to SPI1, or in other words, data is not getting written onto the SPI1... Can someone please help me figure out the problem.. Regards, Dev