as1_RecvBlock not receiving block

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

as1_RecvBlock not receiving block

Jump to solution
2,063 Views
GMVS
Contributor III

oks

 

i have to MC9S08DZ128MLL connected by RS232 interface, but one of them has an LCd display attached where all messages send by rs232 are displayed

both have the exact same code

i'm using processor expert libraries

 

i called SendChar at the main and it works

i called RecvChar from the OnRxChar interrupt and works

i called SendBlock at the main and it works

but i called RecvBlock from the OnRxChar interrupt and doesnt work

i assume it doesn't work because the interrupt is just for one char and i'm getting a lot of them

but if i cant use OnRxChar, then which other interrupt should i use?

 

(or maybe i'm messing up pointers?)

 

i'll send you my code

thank you

Original Attachment has been moved to: myINT-code.txt.zip

Original Attachment has been moved to: myLCD-code.txt.zip

Original Attachment has been moved to: PE-code.txt.zip

1 Solution
1,023 Views
Petr_H
NXP Employee
NXP Employee

Hi,

The problem is that the RecvBlock method of the AsynchroSerial component is not intended to be called within OnRxChar event, which is called after reception of every character.

If you'd like to use RecvBlock method, use it from the main routine or from the OnFullRxbuf event.

Example of the OnFullRxBuf event code from the 'Typical usage' page of the component help. You can access this page using the pop-up menu command 'Help on component' :

  void AS1_OnFullRxBuf(void)

  {

    word Received;

    byte err;

    err = AS1_RecvBlock((byte*)&message, sizeof(message), &Received);

    ....

  }

best regards

Petr Hradsky

Processor Expert Support Team

View solution in original post

1 Reply
1,024 Views
Petr_H
NXP Employee
NXP Employee

Hi,

The problem is that the RecvBlock method of the AsynchroSerial component is not intended to be called within OnRxChar event, which is called after reception of every character.

If you'd like to use RecvBlock method, use it from the main routine or from the OnFullRxbuf event.

Example of the OnFullRxBuf event code from the 'Typical usage' page of the component help. You can access this page using the pop-up menu command 'Help on component' :

  void AS1_OnFullRxBuf(void)

  {

    word Received;

    byte err;

    err = AS1_RecvBlock((byte*)&message, sizeof(message), &Received);

    ....

  }

best regards

Petr Hradsky

Processor Expert Support Team