Page 1 of 1

USART Rx Interrupts

Posted: Wed Dec 02, 2020 4:05 pm
by Docara
Hi

Trying to follow Wiki help regarding custom interrupts for Serial reception

https://www.matrixtsl.com/wiki/index.ph ... upts_-_AVR

From the following, if I had a macro called ' MyRoutine' where / how do I put in the 'Call Flowcode Macro' section - do I replace the %n, do away with the line completely and just put 'MyRoutine' in its place or what. I've tried a couple of iterations but nothing works.

ISR(USART_RXC_vect) // USART receive vector

{

FCM_%n(); // Call Flowcode Macro

}

Thanks

Re: USART Rx Interrupts

Posted: Wed Dec 02, 2020 4:18 pm
by Benj
Hello,

Are you placing the code inside the interrupt icon and not inside a C icon? The %n is correct and will be overridden for you.

If you post a simple project with the code you have then we can take a look for you.

Re: USART Rx Interrupts

Posted: Wed Dec 02, 2020 4:32 pm
by Docara
Hi Ben,

A bit of background - Just need to show 5 characters a LCD sent from a terminal window (tera term) to (eventually) simulate and debug another project written in AS7 for a Mega .
This code is for a genuine UNO R3 (AtMega 328P) with a 16x2 LCD shield.


Thought I'd have a play with FC interrupts with USART instead of polling.

Code below

Thanks

Edit - Opps this is an old version there is now a continuous loop after INT Icon