Since I have on hand only 16F1827, I modified the code for the PortC pins but as expected does not work. Modifications in red.

default sdo for that chip is rb2, for mxdi var porta.6 ​you need to set apfcon0.6




I really do not know what lata.5 does in your code. Maybe a led to sign start?
nether do i , most probably a trigger for log analyzer