Thursday, December 6, 2012

Graphic Display Connected to the Programmable XBee


In this post we will show how to control a Graphics LCD display using a Programmable Xbee module from Digi international.

Digi international delivers a SDK for the Programmable Xbee in a free way, you can downdload from here (http://ftp1.digi.com/support/developmentsoftware/40003003_B.exe). 

One of the samples Digi deliver in the SDK is the Graphic display. This example draws different shapes in a graphic display based on the ST7565R chip. Depending on the button pressed from the XBee Interface Board, the display will show a circle or a rectangle.

To run this sample you need a S2B or S2C module with 128 KBytes of flash memory. The sample is not supported in standard 32 Kbytes flash memory modules.

You should connect the graphic display to the SPI interface of the XBee module.
Take a look to the “config.xml” file of the sample application to see how is configured each pin of Programmable Xbee. 




In following schematic you have the connections.

Here a photo of the sample running:

Digi Programmable XBee SDK offers following API to control the graphics LCD display: 


voidlcd_graphic_cmd_write (uint8_t cmd)
Sends the given command to the LCD.
voidlcd_graphic_data_write (uint8_t data)
Sends a byte of data to be written in the LCD.
voidlcd_graphic_goto_xy (uint8_t x, uint8_t y)
Sets the pointer of the LCD at the specified coordinates.
voidlcd_graphic_init (void)
Initializes graphic display with default params.
voidlcd_graphic_set_clear_screen (uint8_t data)
Fills all the display with the specified byte mask.
voidlcd_graphic_write_box (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, bool_t color)
Draws a filled rectangle in the LCD defined by two points.
voidlcd_graphic_write_circle (uint8_t x0, uint8_t y0, uint8_t r, bool_t color)
Draws a circle in the LCD defined by its center point and the radius.
voidlcd_graphic_write_line (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, bool_t color)
Draws a line in the LCD defined by two points.
voidlcd_graphic_write_pixel (uint8_t x, uint8_t y, bool_t color)
Draws a pixel in the LCD given position (point).
voidlcd_graphic_write_rectangle (uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1, bool_t color)
Draws a rectangle in the LCD defined by two points.
voidlcd_graphic_write_text (uint8_t x0, uint8_t y0, uint8_t *textplot, bool_t color)
Writes the given text in the graphic display.
voidlcd_graphic_write_tile (uint8_t x, uint8_t y, uint8_t *buf)
Writes a tile (square of 8x8 pixels/bits) at the given point.

Enjoy!


1 comment:

  1. I read your post. You gave briefly explanation to install XBee module easily in Linux, those are shown in the pictures. By using Xbee examples, to understand XBee module is an easy process.

    ReplyDelete