Hello, and welcome to the forum.
Actually, I do not think that you are "done with the hardware". These very cheap, low power transmitter and receiver modules that use OOK modulation are not suitable for direct use with the SCI module, and its NRZ operation. To provide a consistent operating threshold for "slicing" the data output requires that the modulation method provides at least one on-off transition for each data bit. This does not occur for the SCI output, where the number of transitions within a byte will widely vary, depending on the data being sent.
A further issue may be the presence of noise at the receiver output in the absence of a signal. Your decoding solution must discriminate this noise by virtue of its random timing.
For OOK operation, you might utilize a phase encoded modulation method, such as Manchester coding, or use a PWM method. Because of the very low transmitter power levels of a few milliwatts, the range will be limited to perhaps 15-25 metres only.
Error detection is typically provided by transmitting each data sequence multiple times, with a successful decode when the same sequence is received two or three times in succession. The data sequence would probably not exceed 32 bits in length. This approach is therefore not suited to a continuous data stream, but is intended for very simple control applications.
With the presence of random noise fluctuations from the receiver, the code must test the timing of each transition to determine the start of the data. This may mean that the MCU is "very busy", even when there is no signal. For some applications, this may be unacceptable for the main MCU, and in such cases a separate MCU would handle the decoding.
Perhaps you should utilize alternative transmitter and receiver modules that internally encode and decode the data, provide for error detection/correction, and use a SCI interface to the MCU.
As least part of your coding issues appear to be that the main function for the slave may potentially exit. This is not allowable. Another possibility is that you have a COP timeout reset. The cause of each reset may be determined from the SRS register.
Regards,
Mac