Compass, Tilt/Roll and Temperature sensor applications with the TD-CMP modules. |
Get this page as PDF |
|
|
This page will show you how to use the TD-CMP modules in a way which fits you most.
Here are the technical specifications of the modules:
These assembled modules are available from our online shop. You may also purchase the bare pcb, a KIT DIY* version and the source code. KIT step-by-step construction guide. New: compass calibration. Schematics and pcb diagrams available for download. Last update: November 26, 2009. DIY* = Do It Yourself |
Screenshots:
C# Windows Example Program |
|
Schematics: (click for full resolution image)
Main Connections:
Module header diagram |
Header pinouts |
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Power Source: JP4: Connect pin 2 to pin 3 to power the module directly from USB. Connect pin 1 to pin 2 when powered externally via JP3, pin 1.
New: Increase sampling speed from 12,5/second to 25/second: connect SPEED1 to SPEED2 (JP3, pin4 to JP3, pin2.)
LCD contrast Adjust: Connect pin 5, JP3 to +5V before powering up. Release when the desired the contrast is reached.
Tilt/Roll Calibration: (TD-CMP02 and TD-CMP03 only):
Compass Calibration: (do not touch the PCB or chips whilst calibrating.)
Module RESET: apply GND to MCLR pin.
Temperature sensor: (TD-CMP03 only): The external LM335Z sensor connects to JP3 pin 4 and 6. No temperature will be displayed when the sensor is removed.
RS232 interface:
JP2 provides the interface to connect to your COM port and hyper terminal. Communications @ 115200 bpS, 8N1.
Use a level converter like the MAX3232 between the TD-CMP module and the pc serial port. See this example.
Also used for bootloading (module software update.) Check under the download section below for the latest version. Bootloading of the HEX-file can be done with Tiny Bootloader 1.91
RS232 terminal screen @115200 bps
I²C interface: JP3 allows us to connect to another µC. The module is the slave device on address 0xa0. It can be read via a simple EXT_EEPROM command. Download this I²C CCS C example to see how to connect I²C with a 18F452. Don't forget to change the POWER SOURCE (JP4) and connect pin 1 to pin 2.
Internal 8 bit registers are:
Reading the module (ccs c code):
USB interface: is HID (Human Interface Device) on PID=0461, VID= 1023 Each packet is 8 bits long (4 bytes address and 4 bytes data.)
Low power LED: Will light up shortly when USB is connected and enumerated. Also the LED will blink several times, according to the capital direction it is facing:
Downloads: right-click & save as
WARNING: may not be duplicated for any commercial use whatsoever without explicit consent from the author (c) Michel Bavin, TechDesign Electronics. |
Windows Example program setup: 023- TDCMP setup.msi - January 28, 2009. Written in C# Visual Studio .NET, compatible with Windows XP and Vista. Important Note: You need to have Microsoft .NET Framework 1.1 (or higher) installed to get the executable running. I²C Connection CCS C Source Code: 023_i2c_v02_18F452.zip - May 18, 2006. Connects a 18F452 to the TD-CMP module using I²C to read data. TD-CMP Module HEX: 023_v34.HEX - November 26, 2009. Can be bootloaded to the module through the RS232 port (JP2) and Tiny Bootloader 1.91 PCB Diagram: gif. Partslist: html.
|
Module PIC CCS C Source Code, Schematics (eagle) , C# code : not released, but you can buy a license on our Products page. |
Info & datasheet:
|
|
Graphic LCD module type LPH7779 (NOKIA 3310 LCD) 48*84 pixels and its integrated controller PCD8544. | |
Tools:
Check out our development tools page.
The PIC code was made with the PCWH CCS compiler ($425,-); you can install Microchip's MPLAB IDE (click on the link and you can get it for free) with it to get things running smoothly.
Bootloading of the modules is done with the excellent Tiny PIC bootloader, through RS232 (JP2).
Eagle 4.11e was used for the schematic & PCB layout.