SPI module

General discussion relating to the library modules supplied with the compiler

Moderators: David Barker, Jerry Messina

Post Reply
Del l
Posts: 1
Joined: Fri Apr 29, 2011 5:05 pm

SPI module

Post by Del l » Fri Apr 29, 2011 5:38 pm

I am trying to use the SPI module, and found that setting the clock to idle high causes SSPStatus to be set to BF.
Should the line in the library module sub below read:
pEdge = not pEdge and $40

Anyone else used these module settings?

public sub SetClock(pIdle as byte, pEdge as byte)
SSPControl1 = SSPControl1 and $EF
SSPControl1 = SSPControl1 or pIdle
if pIdle = spiIdleHigh then
pEdge = not pEdge and $BF
endif
SSPStatus = SSPStatus and $BF
SSPStatus = SSPStatus or pEdge
end sub

Post Reply