Apps     Components     Interfaces     All Files     Source Tree     source: tos.lib.Util.UartDebuggerM.nc

Component: UartDebuggerM

UartDebuggerM.nc Module to drive a Scott Edwards Electronics LCD display -- see http://www.seetron.com/pdf/bpi_bpk.pdf for documentation on commands, etc. Note that the mote (mica or mica2) must be connected via an old style programming board (e.g. new, expensive crossbow boards don't work.)
Author: Sam Madden, Matt Welsh Instructions for using the display: Parts needed: a) 1 9 pin female serial connector (from Radio Shack), e.g. Radio shack part # 276-1538 b) 1 Enclosure: Radio shack part # 910-5035 c) Stranded wire d) Display e) Power Switch (SPST, e.g. Radio shack # 275-406) f) 4 AA Batteries g) AA Battery Holder, e.g. Radio shack part # 270-409 Instructions: 1) Cut holes in the enclosure for the display, serial connector, and switch. I put the screen on the top, the switch on one side, and the serial connector on the other. I was able to cut the whole for the display to be narrow enough that I could press fit the display in and have it fit snugly without falling out. Don't permanently affix the display / switch / connector just yet. I used a Dremel tool to cut the enclosure -- it's not pretty, but it works... 2) Solder the positive terminal of the battery pack to one pole of the switch. 3) Solder the (+5) pin of the display to the other pole of the switch 4) Solder the negative terminal of the battery pack to the (GND) pin on the display 5) Solder a wire between the (GND) pin of the display (or the negative battery terminal) and pin 5 of the serial connector. 6) Solder a wire between pin 3 of the serial connector and the (SER) line of the display 7) Solder another wire between pin 2 of the serial connector and the (SER) line of the display 8) Press fit the display in the enclosure. Place the batteries behind it so that they keep it from fall back inside the case. Mount the power switch and serial line. Put batteries in the battery pack. 9) Connect a serial cable to your display and a PC. Flip the power switch so that the backlight on the display lights (you may have to enable the backlight by flipping the switch on the display controller board.) Configure a terminal program to 9600 bps and type -- your typing should appear on the display. 10) Close up the enclosure -- you're done! If you don't want to solder directly to the display, there are a number of connectors available on the Scott Edwards web site -- see: http://www.seetron.com/lcdcbl_1.htm You could solder the PBX-CBL to a battery pack /switch as described above -- this would alleviate soldering the the serial connector, although I found that I had to connect pin 2 of the connector (step 7 above) to get it work with the motes.

Required Interfaces

Provided Interfaces

Variables

Function Index

Function Descriptions

StdControl.init

command result_t StdControl.init (void)

Initialize the component.
Returns: Always returns SUCCESS

StdControl.start

command result_t StdControl.start (void)

Start things up. Set the UART to the proper bit rate and display the initialization string.
Returns: Always returns SUCCESS

StdControl.stop

command result_t StdControl.stop (void)

Halt execution of the application. Reset the UART to the original bit rate
Returns: Always returns SUCCESS

Debugger.writeString

async command result_t Debugger.writeString (char *msg, uint8_t len)

Write the specified string onto the display. Note that some display can write to locations that aren't visible on the screen -- e.g. a 16x2 display with a 40x2 buffer is common. Use nextLine() to ensure output is visible.

Parameters:

msg - The msg to display

len - The length of the message.