Quote Originally Posted by Bruce View Post
SHIFTOUT is a software SPI communications routine. If you use it, don't enable the PICs hardware SPI. If you do, then the hardware SPI takes control of these pins, and SHIFTOUT won't work.
Thanks for the heads up.

Ok....struggling here! (being completely new to SPI!)

I'd assumed the reason that SPI hw being available on the PIC was to assist in ease of comms with SPI devices....but now youre saying that h/w should not be used when shiftout is used? So (n00b hat on again!).... Why use shiftout wrt SPI then?

How does shiftout 'marry' up with the SPI master clock (when using h/w presumably there's tight correlation between the SPI buffers being read out at the right time etc)

If not using shiftout (as in my above code), how would getting an 11 bit control stream out the SDO pin (the least 3 significant bits of an upper byte + a complete lower byte) be approached in hw?