This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

RM48L952: How to abort SCI operation

Part Number: RM48L952
Other Parts Discussed in Thread: HALCOGEN

When using the halcogen functions for receiving and sending bytes via sci all function are waiting for RX/TX -Ready- Interrupts. What is the correct way to abort a running receive/send operation.

Regards

Jan Scharnweber

  • Can you be a bit more specific about what you are trying to do? There are functions for sending or receiving individual bytes. Do you need to abort a byte that is in the middle of being sent or received, or are you trying to abort out of a polling loop?
  • Thank you for your reply!
    I am looking for a method to abort the function "void sciReceive(sciBASE_t *sci, uint32 length, uint8 * data)".

    Regards
    Jan Scharnweber
  • If you are receiving an unknown number of bytes with a termination character, don't use sciReceive(). I suggest you use interrupts to receive the characters into a buffer checking each time if the character was the termination character. Once the termination character is received, set a flag so your main routine knows there is a new command (or data) to process. You can Ping-Pong between two receive buffers, or use a circular buffer.
  • Actually i always know how many bytes to be received. But in certain situations i must be able to abort the current receive process and start with a new one.

    Thanks for the feedback

    Regards 

    Jan Scharnweber

  • Then I suggest you write your own sciReceive() function which checks for this certain situation within the while statement. You can model it after the function in sci.c. You can make it return the number of characters received (instead of being a void function) so that your program can check if all characters were received or not.