Good day all.
I have a zigbee project that does not employ an LCD screen. On selecting verbose, the AT commands that initialize the module are sent to the LCD if connected.
I would like to know if someone would be kind enough to give detailed outline on redirecting the AT commands to a second software and or hardware USART port.
I'm working 18LF46k80 which has 2 USART ports.
Thanks in advance
Ondra Simons
Redirect Zigbee verbose to Usart
Moderator: Benj
- 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: Redirect Zigbee verbose to Usart
Hello Ondra,
If you include a RS232 component in your program, configue the properties as you would like them and then include a random RS232 receive comp macro at the start of your program to ensure the component code is included into the code. Then compile to C and have a look at the generated C file and find the RS232 send function headers.
They should look something like this.
void FCD_RS2320_SendRS232Char(short nChar);
void FCD_RS2320_SendRS232String(char* String, char MSZ_String);
Maybe also physically test your RS232 here before continuing so you know bytes can be sent to the PC correctly using your settings.
Once you have done this right click the Zigbee component on the panel and select custom code.
Modify the following command.
Send_AT_Command
Look for this section of code.
and change to the following where the function call matches your function header.
Then modify the following command.
Get_AT_Response
Look for this section of code. It is in this function twice.
and change to the following where the function call matches your function header.
Then the verbose information should be streamed through to the RS232 connection.
If you include a RS232 component in your program, configue the properties as you would like them and then include a random RS232 receive comp macro at the start of your program to ensure the component code is included into the code. Then compile to C and have a look at the generated C file and find the RS232 send function headers.
They should look something like this.
void FCD_RS2320_SendRS232Char(short nChar);
void FCD_RS2320_SendRS232String(char* String, char MSZ_String);
Maybe also physically test your RS232 here before continuing so you know bytes can be sent to the PC correctly using your settings.
Once you have done this right click the Zigbee component on the panel and select custom code.
Modify the following command.
Send_AT_Command
Look for this section of code.
Code: Select all
if (LCD_VERB_ZIG == 1)
{
#if MX_ZIG_LCD == 1
#ifdef MX_GFXLCD_PORT
FCD_gLCD0_Clear();
FCD_gLCD0_Print(String, 10, 2, 2, 2, 0);
#else
FCD_LCDDisplay0_Clear();
FCD_LCDDisplay0_PrintString(String, 10);
#endif
#endif
}
Code: Select all
if (LCD_VERB_ZIG == 1)
{
FCD_RS2320_SendRS232String(String, 10);
}
Get_AT_Response
Look for this section of code. It is in this function twice.
Code: Select all
if (LCD_VERB_ZIG == 1)
{
#if MX_ZIG_LCD == 1
#ifdef MX_GFXLCD_PORT
FCD_gLCD0_Print(String, 10, 2+(idx * 12), 20, 2, 0);
#else
#ifdef MX_MIAC
FCD_MIAC0_PrintASCII(temp);
#else
FCD_LCDDisplay0_PrintASCII(temp); //Output to LCD
#endif
#endif
#endif
}
Code: Select all
if (LCD_VERB_ZIG == 1)
{
FCD_RS2320_SendRS232Char(temp);
}
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel