» Home

  » Products

  » Interfaces

  » Lab

  » Downloads

  » Buy It

  » Contact

  » Links

» Lab » Hello Palm via IrTx

top
Project:Hello Palm via IrTx
Source Code:PIC Assembler
PIC:16F84 & 16F628
Interface:IrTx
Author:Ravi Deo
Last Updated:7th April 2005

Project Description

This sample PIC project is based upon the typical "Hello World" program. The PIC simply transmits the string "Hello Palm" repeatedly via Infra-red (using raw SIR mode). It demonstrates the infra-red transmission and reception capability end to end (PIC to IrTx to Palm).

Project Download

Hello Palm via IrTx : Zip file containing Source ASM and Binary HEX files for 16F84 and 16F628 (approx 5KB).

Hardware Schematic

The following schematics show the circuit setup for using the PIC16F84 or PIC16F628. The Infra-red bit-stream output from the PIC (pin 8) feeds the Infra-red transmitter unit (IrTx). It is possible to use a 4MHz 3-pin ceramic resonator as the clock source (less the capacitors and middle pin to ground).

16f628

16f84

Source Code

The sample source code assumes use of an external 4MHz crystal oscillator or (external clock XT mode) on the PIC16F628 / PIC16F84. The source code comprises of the following subroutines:
TxChIr:      Standard SirPic subroutine to transmit char via Infra-Red
IrPulse0:    transmits a '0' bit pulse
IrPulse1:    transmits a '1' bit pulse
SpWaitDelay: Standard SirPic delay routine

SirPic Settings

SirPic Communication and Options settings should be configured as shown below:

16f628   16f628

SirPic Output

On starting the SirPic log session, you should see the following data being captured.

16f628

Trouble Shooting

Firstly you should confirm that the PIC device has been programmed correctly, and is transmitting data. This can be verified by connecting an LED to the data output (pin 8) of the PIC device and ground. The LED should flicker indicating that the data bit stream is being transmitted continuously.

Next, you should confirm that the SirPic settings are applied correctly, and that data is being received. If you are receiving garbage data (with possible error messages), and you are using the internal 4Mhz clock, it is likely that your timing constants will need tweaking to compensate for the clock instability.

If you are receiving no data, ensure that the log session has started (black square stop icon showing in top right corner, and the "Logging..." status message displayed).

If the PDA still appears not to be logging data, check the compatability page to see whether the PDA model supports raw SIR mode. If not, you should try the "Framed" mode sample lab project.