Connect a Character LCD to a Programmable XBee

Print Friendly, PDF & Email

In this example, we will look at how to use the Programmable XBee module to control a character LCD. This example demonstrates how to create different actions with a character LCD based on the HD44780, KS0066U or equivalent display controller. The purpose of this example is to show how to use the char_lcd driver/API.

To create the Character LCD sample you need to install Codewarrior 10.2 (download from Digi here) and Programmable XBee SDK from (download from Digi here). Once installed, open Codewarrior 10.2, go to File -> New -> Programmable XBee Sample Project, in the new window that will pop up, select the sample “Char LCD Demo,” you will find under “Displays.”

Now, you should build and flash the character LCD demo application into the Programmable XBee. After flashing the demo, check that you have the application header in the serial console. That means that the demo is running!

In next section we will show you how to connect the Programmable XBee and the character LCD.

The Character LCD sample is supported in following kits:
– Programmable XBee-PRO ZB Dev Kit (P/N: XBP24BZ7B-DK)
– Programmable XBee-PRO ZB SMT 32K Dev Kit (P/N: XK2-Z7SB0)
– Programmable XBee 865/868LP Dev Kit (P/N: XK8-DMS-0)


In the config.xml you have the setup of the Programmable XBee module that should be connected to the character display for this example.
Here is a screenshot of the config.xml file for the character LCD sample:

Here is the schematic to connect the Programmable XBee and the character LCD:

Note that the XBee module used is a Programmable XBee module, not the standard XBee module. When you have set up all the hardware, connect the power supply and demo application will perform a sequence of actions in the character LCD:


Programmable XBee SDK offers following API commands for character LCDs:

  1. Character LCD configuration functions:
  • char_lcd_init()
  • char_lcd_cmd_write()
  • char_lcd_on_off()
  • char_lcd_cursor_on_off()
  • char_lcd_cursor_blink_on_off()
  • char_lcd_clear()
  • char_lcd_goto_xy()
  1. Functions to read/write the LCD:
  • char_lcd_putchar()
  • char_lcd_write()
  • char_lcd_read_data_xy()

For more information about the API,  have a look at the help delivered with the Programmable XBee SDK.

Happy prototyping! Questions or comments? Let us know!

5 Responses to Connect a Character LCD to a Programmable XBee

  1. Dhruval says:

    Can i write code in programmable Xbee without use of debugger??

    • Carlos Marin says:

      Hi Dhruval,

      Assuming that your programmable module has a bootloader, you can develop your program using the CodeWarrior IDE, build the application and transfer the binary using the “Xmodem” feature (transfer via serial) in the XCTU v5.x. To do that you do not need a debugger.

      if you are developing your code, this method seems not very nice, but you avoid to use the debugger.

      In our documentation you have following chapter explaining how to flash your module using Xmodem: “10.6. Flashing a programmable XBee application via XModem”


  2. Dhruval Parmar says:

    Thank you so much Sir for give me replay

    Carlos Marin,
    Sir now i have P & E USB multilink interface for debug code,
    I have use directly use sample code of give in CodeWarrior 10.2 with XBEE SDK . I am select “Xbee sample application project ” in that next select my device Xbee 865/868 lp S8 module next i have have to select GPIOs project in that i have select blink_led project. Then i have to build that project. After that i have go to run configure then in connection type i have select “P & E HSS08 Multilink \ Multilink Universal \ Cyclone Pro \ OSBDM ” then i run that project but i got “POWER CYCLE DIALOG” after click ok then i got”p&e connection ” .

    Please sir give me solution about about my problem and Sir Can you give me your email id so i directly contact with you sir.


  3. Alan says:

    Any particular reason you’re using those particular DIO pins? Would DIO0 – DIO6 work just as well? And can I do this with a 802.15.4 or ZigBee device, assuming I have another unit to write my own code to for a coordinator?

Leave a Reply

Your email address will not be published. Required fields are marked *