Hello!I'm new in this forum.
I need some example to comunicate two pic's with SPI by software (because the pins of SPI are occupied with I2C). I'm novice in this subject
THANKS THANKS THANKS!!
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Sun Jun 24, 2007 1:16 pm
The SPI master is easy to do in software, but the slave is a problem.
The problem is that SPI protocol uses a clock edge to sample the data.
You could use an interrupt (INT_EXT) to detect the start of a \CS signal.
Then within the interrupt routine, you could poll the SCLK signal to
determine when the clock edge occurs for each data bit. Then you could
read the SDI pin immediately after that.
An SPI slave could be done in software, but the speed will be limited
because clock edge detection has to be done by polling.
(At least it does in my proposed method).
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum