Quote Originally Posted by hankshone View Post
As I found out the reads are all zeros, I use os-scope to track the signals and found out that there is totally no signals out in SCK, therefore no SDI because the master is not generating clocks. the SDO has some data out which I could not understand...So I am think if the MCU hardware got any problem.. or the MSSP module was not running?...it is really a torture...
.....
Vinson
Torture? If it were easy it wouldn't be nearly as much fun...

So no clock signals. SCK is on PORTC.3, which the datasheet says defaults to an input. You'll need to add "SCK_TRIS=0".

One other thing that jumped out at me is that the 16LF877 is only rated for 4MHz and you are using 10MHz according to your defines. Could that also be a source of trouble?

I hope you also took languer's suggestions. I'm pretty sure he's sharper than me...

Best Regards,
Paul