Platform Creation and Testing

From TinyOS Wiki
Revision as of 14:43, 28 November 2007 by Jgriessen (talk | contribs) (New page: =Lesson 10a: Platform Creation and Testing= Last updated 15 August 2007 A new platform wiring debug tool with only three code files. We have a fairly simple goal -- to harness GPIOs so we...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Lesson 10a: Platform Creation and Testing

Last updated 15 August 2007 A new platform wiring debug tool with only three code files.

We have a fairly simple goal -- to harness GPIOs so we can control them and see what they are inputting on a MSP430 based platform. Seeing means displaying, so we will use the three LEDs found on many MSP430 platforms to display a 3 bit binary number corresponding to pin0 through Pin7 that we wish to test. This module is for MSP430 testing purposes so will never need Hardware Independent HIL modules -- we will come to that in 10b. The tests this code helps with are whether a new printed circuit board has traces going to the right MSP430 IO ports.

With a HAL, (hardware adaptation layer), configuration and code file plus a HPL, (hardware presentation layer), configuration and code file we would have 4 files. Since we reuse the GeneralIO interface with new names and add no new functions, we can do without a code file. So we have just three files, (beyond all the core tinyOS modules), for this exercise. The HPL configuration file maps connections from any port names predefined in the MSP430 chip directory to our desired group of eight ports named Pin0 - Pin7. The HPL file is part of a new platform, defined by a new directory added to the tinyos source code tree: /opt/tinyos-2.x/tos/platforms/ecosens1p. Some necessary parts for a new platform variant were copied from telosb: PlatformC.nc MoteClockC.nc MoteClockP.nc PlatformP.nc. They set up the clocks and initialize the MSP430. Also needed in this new platform is hardware.h, which was copied from telosb and modified to change names to leave off the humidity sensor, and rename some GeneralIO signal names.