My problem is the coding just wait forever until the packet of data received to the pic due to this coding line
- CODE: SELECT_ALL_CODE
while(PIR1bits.RCIF==0); //wait for data to received
and i just want it to wait for a while, if there is no data then leave from the task.
So my solution (if it is possible) is to ON a TIMER to wait for a while and AT THE SAME TIME waiting for the packet of data to be received. If the timer is off, just jump back to the main.
So it is possible to create code like that? or there are other solution that im not aware of.