» Home

  » Products

  » Interfaces

  » Lab

  » Downloads

  » Buy It

  » Contact

  » Links

» Lab » Hello Palm via SIrTx

Proto
Project:Hello Palm via SIrTx
Source Code:PIC BASIC
PIC:16F628
Interface:SIrTx
Author:Ravi Deo
Last Updated:7th April 2005

Project Description:

This sample PIC project demonstrates how to use PIC BASIC with the SIrTx interface to transmit a string repeatedly. This applications is developed using PIC BASIC Pro Compiler and the "SEROUT" and "SEROUT2" commands. The "Hello Palm" string is transmitted using the various combinations of baud rate and mode to fully test the SIrTx interface with SirPic.

Project Download

Hello Palm Basic via IR : Zip file containing ASM and HEX files (approx 3KB).

Hardware Schematic


16f628

Source Code

In the following code a 1 millisecond delay has been specified between characters (CHAR_PACING). However this can be reduced to 10 microseconds when transmitting data for a fixed baud mode.

include "bs2defs.bas" DEFINE CHAR_PACING 1000 loop: SEROUT PORTB.2,N9600,[10,"Hello Palm (Mode N9600)",10] PAUSE 1000 SEROUT PORTB.2,T9600,[10,"Hello Palm (Mode T9600)",10] PAUSE 1000 SEROUT2 PORTB.2,16416,1,[10,"Hello Palm (Mode N19200)",10] PAUSE 1000 SEROUT2 PORTB.2,32,1,[10,"Hello Palm (Mode T19200)",10] PAUSE 1000 Goto loop

Testing Procedure

Note: The user should expect to see garbage data surrounding a line of clear text displaying "Hello Palm" followed by a description of the baud mode in use (eg N9600). The garbage data arises from the data transmitted for mismatched baud modes.
  1. Configure SirPic Communications settings to Infra Red(SIR), 9600 baud, 8 data bits, 1 stop bit, no parity.
  2. Configure SIrTx for 9600 baud, and mode N.
  3. Now begin logging data on SirPic
  4. Amongst the garbage data you should see "Hello Palm (Mode N9600)"
  5. Now switch SIrTx to 9600 baud, and mode T.
  6. Amongst the garbage data you should see "Hello Palm (Mode T9600)"
  7. Configure SirPic Communications settings to Infra Red(SIR), 19200 baud, 8 data bits, 1 stop bit, no parity.
  8. Configure SIrTx for 19200 baud, and mode N.
  9. Now begin logging data on SirPic
  10. Amongst the garbage data you should see "Hello Palm (Mode N19200)"
  11. Now switch SIrTx to 19200 baud, and mode T.
  12. Amongst the garbage data you should see "Hello Palm (Mode T19200)"
This confirms that SirPic works for all baud modes.

Trouble Shooting

First confirm that the PIC Basic serial signal is being generated, by connecting an LED to the output pin and checking it pulses briefly every second. If not, you have a problem with your PIC Basic microchip (check power, resonator and resistor is connected correctly, and chip was programmed succesfully).

Every second or so you should also see data LED on the SirTx interface flicker, indicating data being transmitted. If the LED does not flicker, this indicates a possible problem with the SIrTx interface.

A simple way of testing the SIrTx interface standalone (without a serial source) is to switch it to N9600 mode, and and tie the serial data input wire to GROUND. The data LED should be OFF. Now switch to mode T, and the data LED should appear on (actually its flickering constantly at a very fast rate). Then switch SIrTx to T9600 mode and tie the serial data input wire to +5V, and the led should be OFF. Now switch to N mode and the data LED should again appear ON.

If you are still not receiving infra red data on SirPic, double check your communication port settings. 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.