This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

LCD printing causing data to be transmitted in RS-232 serial port

Other Parts Discussed in Thread: CC2530

Hi everyone,

  Any ideas on why when calling HalLcdWriteString(....) it's causes the characters that are printed to the LCD to also be transmitted through RS-232? I am using Tera Term to monitor and inject data. I also have Free Serial Port Monitor as a packet sniffer.

 

I am using CC2530 on SmartRF05, and running the Generic App that comes in the sample applications.

 

Thanks in advance!

  • Hi Mark,

    If you look at the source code of the funtion "HalLcdWriteString" (in hal_lcd.c), you'll find the reason:

     

    #if defined (ZTOOL_P1) || defined (ZTOOL_P2)

    #if defined(SERIAL_DEBUG_SUPPORTED)

          debug_str( (uint8*)buf );

    #endif //LCD_SUPPORTED

    #endif //ZTOOL_P1

     

    Regards,

    Lasse

  • Somewhere you have LCD_SUPPORTED=DEBUG defined. Check your preprocessor options and config files. Change it to just LCD_SUPPORTED if you still want to use the LCD but you don't want to echo everything over the serial port. 

  • Because the default sample applications setting is to enable "serial debug" messages - in the Project --> Options --> C/C++ Compiler --> Preprocessor --> Defined symbols   you will see this: LCD_SUPPORTED=DEBUG

    Look in OnBoard.h and see what is results in is this:

    // LCD Support Defintions
    #ifdef LCD_SUPPORTED
      #if !defined DEBUG
        #define DEBUG  0
      #endif
      #if LCD_SUPPORTED==DEBUG
        #define SERIAL_DEBUG_SUPPORTED  // Serial-debug
      #endif
    #else // No LCD support
      #undef SERIAL_DEBUG_SUPPORTED  // No serial-debug
    #endif

    So in hal_lcd.c you see the write to the serial port:

    #if defined(SERIAL_DEBUG_SUPPORTED)
          debug_str( (uint8*)buf );
    #endif //LCD_SUPPORTED

    Since DEBUG is not defined by default (so gets defined to zero), try changing the project option to this:

    LCD_SUPPORTED=1