[solved] UART problem

A forums to allow bugs and problems with Flowcode v6 to be reported and resolved.

Moderator: Benj

Post Reply
User avatar
STibor
Posts: 263
Joined: Fri Dec 16, 2011 3:20 pm
Has thanked: 116 times
Been thanked: 113 times
Contact:

[solved] UART problem

Post by STibor »

Hello!

I use 1 pc. RS232 hardware macros, and should 9pcs. RS232 software macro. (9 pieces. DFPlayer + RS485 Modbus)
Unfortunately, the program does not compile vain changed the CAL file.
Up to 8 pieces. RS232 component can be used.
What can be wrong?
How many RS232 can be used for many components?
Attachments
PIC_CAL_UART.c
(28.13 KiB) Downloaded 336 times
Last edited by STibor on Fri Jun 10, 2016 4:27 pm, edited 1 time in total.

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: UART problem

Post by Benj »

Hello,

Yes we have only allowed support for up to 8 UARTs channels but this is easy to expand.

The limitation is in the "CAL/includes.c" file.

The end of the file looks like this.

Code: Select all

#ifdef	MX_UART_REF8
  #define MX_UART_NUM 8
  #ifdef MX_CAL_PIC
	#include "PIC\PIC_CAL_UART.c"
  #endif
  #ifdef MX_CAL_PIC16
	#include "PIC16BIT\PIC16BIT_CAL_UART.c"
  #endif
  #ifdef MX_CAL_AVR
	#include "AVR\AVR_CAL_UART.c"
  #endif
  #ifdef MX_CAL_ARM
	#include "ARM\ARM_CAL_UART.c"
  #endif
  #undef MX_UART_NUM
#endif
#ifdef CALFUNCTION
	#undef CALFUNCTION
#endif
if you add this section before the #ifdef CALFUNCTION line then this should allow for up to 10 UARTs.

Code: Select all

#ifdef	MX_UART_REF9
  #define MX_UART_NUM 9
  #ifdef MX_CAL_PIC
	#include "PIC\PIC_CAL_UART.c"
  #endif
  #ifdef MX_CAL_PIC16
	#include "PIC16BIT\PIC16BIT_CAL_UART.c"
  #endif
  #ifdef MX_CAL_AVR
	#include "AVR\AVR_CAL_UART.c"
  #endif
  #ifdef MX_CAL_ARM
	#include "ARM\ARM_CAL_UART.c"
  #endif
  #undef MX_UART_NUM
#endif
#ifdef	MX_UART_REF10
  #define MX_UART_NUM 10
  #ifdef MX_CAL_PIC
	#include "PIC\PIC_CAL_UART.c"
  #endif
  #ifdef MX_CAL_PIC16
	#include "PIC16BIT\PIC16BIT_CAL_UART.c"
  #endif
  #ifdef MX_CAL_AVR
	#include "AVR\AVR_CAL_UART.c"
  #endif
  #ifdef MX_CAL_ARM
	#include "ARM\ARM_CAL_UART.c"
  #endif
  #undef MX_UART_NUM
#endif

Post Reply