Sunday, August 15, 2010

Tait T800 Series I EPROM Calculator

As I said in an earlier post, the Tait PGM800 software will not let you program a T800-10 with 10kHz channel increments.  I need the 10 kHz channel spacing to program up the frequency assigned to me by the ORRC.  After I figured out all the nuances of the bytes that needed to be laid out on the PROM, I wrote a Perl program to calculate the bytes that needed to be pasted into your favorite hex editor.  I also posted this to the Tait_Radios Yahoo! group.  Hopefully someone finds this useful.


#!/usr/bin/perl


use strict;
use Math::Round;


#  SET PARAMETERS HERE


#  Reference clock frequency in MHz
#  6.4 for T855-10
#  0.2 for T857-10
my $refClock = 12.8;


#  Channel step size in MHz
my $channelStep = 0.01;


#  1 for a transmitter, 0 for a receiver.
my $transmitter = 0;


#  Frequencies you want to get lines for
my @frequencies = (
                     439.900,
                     439.910,
                     439.920,
                     439.930,
                     439.940,
                     439.950,
                     439.960,
                     439.970,
                     439.980,
                     439.990,
                  );


#####  NO USER SERVICABLE PARTS BELOW HERE #####


my $scalingFactor = 64 * $channelStep;


foreach my $frequency (@frequencies) {
  my $target = $frequency;


  if ($transmitter == 0) {
    $target -= 45;
  }


  my $M = int($target / $scalingFactor);
  $target -= $M * $scalingFactor;


  my $A = round($target / $channelStep);


  my $R = $refClock / ($channelStep * 2);


  #  Hex Conversion
  my $MHex = $M << 2;


  #  Convert into a proper string
  printf("0%01X 0%01X 0%01X ", $MHex & 0x00F, ($MHex >> 4) & 0x00F, ($MHex >>8) & 0x00F);
  printf("0%01X 0%01X ", $A & 0x0F, $A >> 4);
  printf("0%01X 0%01X 0%01X ", $R & 0x00F, ($R >> 4) & 0x00F, ($R >>8) & 0x00F);
  printf("\t%.3d\t%.2d\t%.3f ", $M, $A, $frequency);
  if($transmitter == 1) {
    print "TX USING ";
  } else {
    print "RX USING ";
  }


  printf("%d KHZ STEPS", $channelStep * 1000);
  print "\n";
}

No comments:

Post a Comment