CompilerError UART-Interrupt solved (AVR)

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
Niro
Posts: 77
Joined: Mon Jan 03, 2011 8:58 pm
Has thanked: 29 times
Been thanked: 10 times

CompilerError UART-Interrupt solved (AVR)

Post by Niro »

Hi all,

there's a compiler error using 'RXINT0' in FC V5 AVR.
If you want to use this interrupt you have to build it with the custom option, the already inlcuded 'RXINT0' does not work because of the
wrong handler-code:
ISR(USART0_RX_vect)
{
FCM_ISR_UART();
}

The right code need to be:
ISR(USART_RX_vect)
{
FCM_ISR_UART();
}

So you need to simply build your custom Interrupt:
Enable Code:
sei();
UCSR0B |= (1 << RXCIE0);

Handler Code:

//Handler code for [RXINT]
#ifndef MX_UART0_RX_HANDLER
#define MX_UART0_RX_HANDLER
ISR(USART_RX_vect)
{
FCM_ISR_UART();
}
#else
#warning The <UART0 RX> interrupt has previously been enabled, so the macro <ISR_UART> may never get called.
#endif

Now assign it to the requird ISR (macro) and than it will work.

Maybe this hopefully will get fixed with the next update.

Have fun,
Niro


PS: this solution is related to my former post 'Problem with UART, porting V4 to V5' http://wwww.matrixmultimedia.com/mmforu ... 46&t=12170

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: CompilerError UART-Interrupt solved (AVR)

Post by Benj »

Hi Niro,

Thanks for the workaround. Do you know what device(s) this problem effects and I will fix the FCD files? I did recently provide a load of FCD fixes for this very issue so I will attach them here (ATMEGA48, 88, 168, 328).
AVR_FCD_Mods.zip
(11.34 KiB) Downloaded 395 times
Plus if we don't head off the issue now then it is likely to continue on into the v6 code.

Niro
Posts: 77
Joined: Mon Jan 03, 2011 8:58 pm
Has thanked: 29 times
Been thanked: 10 times

Re: CompilerError UART-Interrupt solved (AVR)

Post by Niro »

Hi Ben,

mainly I'm using the attached AVR-types you correctd. Actually a QFP version of the ATMEGA328. It has different I/O pinout and additional ADC ports compared to the 328.
Thererfore I modified the ATMEGA328 FCD-file.
Attached you'll find the version with the corrected UART-interrupt.

regards,
Niro
Attachments
ATMEGA328_QFP.fcd
(9.83 KiB) Downloaded 322 times

Post Reply