Sunday, October 2, 2022

Bread Board PBX (BB_PBX) - Ring Generator

 I am working on a PICAXE ring generator for the BB_PBX. Since the SLIC modules require two pins with signal timings to ring them, I can reduce the I/O pins needed from the PIC32 and simplify the software too.

The PICAXE 08M2 chip will generate 20 Hz ringing signal on pin 5 C.2 and the ring mode signal on pin 6 C.1. The PICAXE is also taking care of the ring cadence (ringing then silence then ringing, etc.) and signal timing. This will no longer need to be handled in a software, so a single I/O pin connect to for example - Ring1 line brought high to start ringing line 1, etc.

The logic gates connected to the PICAXE route the ringing to one of 3 SLIC modules (technically possible to ring all lines if needed). It is also connected to the SHK (Hook) of the SLIC module so it will kill ringing when the phone goes off hook instantly, since with the software there could be delays.


Here is the PICAXE Blockly code for the ringer.



FTDI Picaxe programmer

 I needed to build a simple logic block for my Bread Board PBX to simplify the software and decided to use one of the PICAXE micro-controllers for a ring generator.

I had a couple of the small 8-Pin 08M2 chips already in my supplies, so I started to dig through my cables to find the special cable to use with the old AXE029 bread adapter to program the devices. It has been a while since I last programmed one, and I was using it via serial COM port cable the last time I did this and was not using the newer PICAXE USB cable that they have to connect to the adapter. Long story short, I could not get it to work. It may be a driver issue or because I am using the newer 8-Pin device now.

Anyway, I did some quick googling to see if I program a PICAXE with one of my other serial devices like my USB FTDI adapter HERE. The answer is yes!

Here is the minimal circuiy found HERE



But, I found using the FTDI 3.3v version the TX pin can go directly to pin3 without the resistor network and the RX to pin 7. And the PICAXE is being powered by the FTDI module too!

So, the setup just reduces to the following, but there is one more step required.


It turns out that the RX and TX signals need to be inverted to program the PICAXE. This is not a problem since there is a tool to make that change for you at FTDICHIP.com it is call FT_PROG (Windows).

Unzip FTProg tool, and run FT_PROG.exe.  Select Devices >> Scan and Parse, or just hit F5.

Your FTDI device will show up in the device tree.  click the + next to Hardware_Specific, then click on Invert_RS232_Signals.  Check the first 4 properties;

Invert TXD

Invert RXD

Invert RTS#

Invert CTS#

Click Devices >> Program or just hit CTRL + P

The Program Devices Dialog will appear.  Check the device to program, then click Program. 

This is very quick, but remember once you do this step, it will remain this way so, if you need to use it for something else you will need to revert this change.

As an alternative, you could use two inverters from a CD4049 hex inverter chip on the TX/RX lines and then you would not need the FTDI to be reprogrammed. I have not tested this yet, but it should work.





Wednesday, September 21, 2022

Bread Board PBX (BB_PBX)

I have been experimenting with the construction of a simple telephone Private Branch Exchange (PBX) using ready made telephony, audio WAV/MP3 players,and DTMF decoder modules built on a set of bread boards. You could probably buy a small PBX but what is more fun than building your own and writing the software to drive it?

The modules are connected to a Micromite PIC32 microcontroller that is running an embedded BASIC called MMBasic. I am using the 28 Pin PIC32 Micromite. I am very amazed by it capabilities.

To make it easier to develop on the BB_PBX I have a ESP8266 D1 Mini connected to the serial console of the PIC32 and am running ESP-LINK: Wifi-Serial Bridge firmware. This allows me to telnet to the BB_PBX and use the built-in editor on the Micromite to edit the code on my PC.



I don't have much working yet but I have developed most of the BASIC subroutines to make it work. I have exercised the ringing and control of the telephony modules, pulse dialing, and control of the SDCard audio player.

See my github for more detail on the code and modules



Monday, December 6, 2021

Simple Analog Servo Loop

 I am working on a simple proportional servo loop using a 741 Op Amp and a complimentary pair of transistors TIP41 & TIP42.  This circuit and hardware was inspired by n3ox and his web post.




I am using the AdaFruit TT motor --> HERE tied into a ~ 1:3 LEGO gear reduction box that drives the motor position potentiomter.

So far, this is just proportional control but I intent to expand it to full PID.

I have been experimenting with the proportional gain between 5 and 10, higher than that it gets unstable. I am having an issue with very slow changes were it stops moving even if I increase the position pot R1 to a much greater value. Bumping the drive system gets it to correct, so I don't know if this is a stall issue or a "dead spot" condition with the DC motor. I am just using single turn pots that do have a bit of drag and low resolution, I will be switching them out soon with 10-turn units next.



73

Sunday, June 27, 2021

Receiving ISS SSTV Images from the ISS

ARISS "Amateur radio on Shuttle, Mir and ISS" SSTV event - June 21-26


Myself and several of the folks on our High Altitude Balloon Group copied almost all 12 images that were sent this week. Just a ground plane antenna or even a HT with a rubber duckie could copy the transmissions in most cases.



Monday, December 9, 2019

1802 Membership Card - Loader

I can now load anything into my "all memory" 1802 Membership Card. I located this fine work by Don Meyer on his loader built using an Arduino HERE.

I had everything I needed for this build except the MCP23017 Port Expander chip (Adafruit PRODUCT ID: 732).

I am using a Teensy 2.0 as a USB to Serial adapter to connect to the 1802 Membership Card serial port. The example sketch to perform this function is included with the Teensy 2.0 and under File>Examples>Teensy>USB_Serial>USBtoSerial in the Arduino IDE software.


I am now successfully running the Super Monitor and BASIC3 with no issues using the bin file here --> http://www.sunrise-ev.com/MembershipCard/MCSMP20B.bin via the Serial port on the 1802 Membership card.

Monday, October 21, 2019

1802 Membership Card (For me and you and the 1802)

I built the 1802 Membership Card this weekend and had a blast playing around with it.



It has been 4 decades since I ran code on this processor. Lee Hart has done a great job with this kit.
Next step is to go beyond the "blink" Q hello world and get a Monitor and Tiny Basic running over the serial port.

Monday, March 25, 2019

Balloon Payload Package

I have been working on another balloon payload package. This time it will be based on a TeensyLC MCU and transmit on HF radio using the 10 meter band with telemetry encoded with FT8. I am just getting the basic design worked out now but my working code is uploaded to GitHub HERE.

I spent a bit of time figuring out how to generate a 10 digit Maidenhead Grid value. The details of the Maidenhead Grid system on THIS GitHub page were very helpful. My Maidenhead Grid code can be directly accessed HERE.

I hope to do testing with the payload package with a kite and then a balloon launch by summer.

Saturday, December 1, 2018

WSPR Weather Telemetry Beacon

Over the past few months I have been working on a simple weather station to transmit temperature and humidity data via HF Radio. I am using components I already had like an Arduino UNO, serial GPS, Adafruit Si5351 clock, etc.

The first version used JT65 and the JTEncode library with the telemetry encoded into the 13 character message field but I later decided to use WSPR after discovering a telemetry method described HERE and HERE. The key take away for me was the use of call signs starting with zero "0" or "Q". Since I just need to send temperature and humidity I will not be using the suggested more complex encoding method.

Normal WSPR Frame is:

<call sign> <grid> <dbm>

Example:

WA6PZB DM03 13          

My Telemetry Frame is :

<0A0hhh> <Rttt> <dbm>

Example:

0A0CEF RR20 13


I will fix the prefix of the call sign field to 0A0 (you could change the last digit for more channels if needed) then use the next three characters of the call sign for humidity and use the grid field for temperature. The data values will have only 3 significant figures and will be multiplied by 10 to remove the decimal point.

Humidity is encoded with the letters A to Z (A=1,B=2,C=3...,Z=0),  here are a few examples:

35.6 % = times 10 = 356 = CEF   full call sign becomes --> 0A0CEF
50.0% = times 10 = 500 = EZZ    full call sign becomes --> 0A0EZZ
80.3% = times 10 = 803 = HZC    full call sign becomes --> 0A0HZC

Temperature (in Celsius) is encoded with the first two digits using the numbers of the grid and the last digit as letters A to R (A=1, B=2,C=3..., R=0) as the second letter of the grid with the first letter fixed to  "R" since it is not needed , here are a few examples:

19.4 C = times 10 = 194 = D19    full grid becomes --> RD19
20.0 C = times 10 = 200 = R20    full grid becomes --> RR20
23.5 C = times 10 = 235 = E23    full grid becomes --> RE23


The full weather report will be two WSPR transmissions. The first is a normal message (for Identification) followed by the telemetry frame:

0200 7.040165 WA6PZB DM03 13        <-- Identification
0204 7.040165 0A0CEF  RR20 13         <-- Telemetry channel 0

This data can be extracted from the WSJT-X application log directory in the file WSPR_ALL.txt

As mentioned above you could have multiple telemetry channels and as long as you ID every 10 minutes you could fit several more channels. For example:

0200 7.040165 WA6PZB DM03 13 
0204 7.040165 0A0CEF  RR20 13        <-- Channel 0
0206 7.040165 0A1EZZ  RD19 13        <-- Channel 1
0208 7.040165 0A2HZC  RE23 13        <-- Channel 2

Hardware Description

The hardware consists of the Arduino UNO connected to a serial GPS receiver, an Si7021 temperature and humidity sensor and a Si5351 clock generator. The Si5351 generates approximate 10 mW to 20mW and when connected to a Low Pass Filter (LPF) like THIS it will produce a clean signal that can be heard for thousands of miles with a decent antenna. I originally tried a basic DHT11 temperature and humidity sensor but the libraries conflicted with the Si5351 library. The Si7021 sensor is more accurate and works well with the Si5351 and is on the same I2C bus since the default addresses are different.



Software Description

As normal the software took a bit longer. This projects uses multiple libraries and would not be possible without all those great people that built them for us to use (I am just standing on the shoulders of giants!). I am using TinyGPS which makes working with GPS strings simple and of course JTEncode to generate the WSPR messages. I did encounter some issues with decoding my early JT65 messages and came across KJ6FO's blog HERE that fixed my issue (and hair pulling) so I carried that over to the WSPR code as well. Basically I read the GPS and wait for the top of the hour, 10, 20, 30, 40, and 50 minutes past the hour and send my identification WSPR frame followed by my Telemetry frame. The code is far from optimized but it is working for me. I need to make some minor timing adjustments for the start of the first frame and between frames because I actually start processing before the actual times so that the time spent on checking the time and getting the sensor readings give me the lead time to end as close as I can to the exact second (we need to be within +/- 2 seconds).

My version 1.0 code is on Github -->  HERE. I included as many comments as possible to help me and anyone else working with it. I ran this with the Arduino 1.8.0 IDE along with the needed libraries. Just the call sign and grid will need to be changed to use it with the same hardware.


Saturday, August 11, 2018

Projectile Motion with Analog Computers

After some recent study of old Analog Computers HERE I thought I would try to get some feel of how to work with them using a software implementation.

I found the Open Source tool Scilab that has a module called Xcos that is a graphical editor to design hybrid dynamical systems models very similar to the  analog computer functional blocks.

I was interested in the projectile motion problem that the old Heathkit EC-1 was able to do, that is outlined in the manual on page 27. The analog Op Amps were vacuum tubes in a EC-1 !

After spending more than half of my time figuring out the software and how it worked I was able to get something close. Below is the XY plot of a projectile launched at a 80 degree angle with an initial impulse and gravity.


The diagram of the configuration is shown below.
Scilab is a very powerful tool and I have just scratched the surface of its capabilities with the use of the Xcos module. I was running this on a Ubuntu virtual machine so it was not super fast.


I would like to experience this setup on a physical analog computer since the plots are not real-time and are not on a oscilloscope like "in the day". I think I am missing the faster iterations and interactivity of the true analog system with the wiring board, meters and oscilloscope :-)

Friday, August 10, 2018

Simple ADS-B Monitoring

I tried out some Linux software tools on a x86 box with my old USB SDR dongle recently and wondered if I could do the same things with a Raspberry Pi ZeroW since the power requirements are much less than a PC or Laptop.

The SDR tools I was interested in are rtl_433 and dump1080 .

I stumbled across a web resource that was basically using dump1080 on a Raspberry Pi Zero just like I wanted. The difference was that this was a modified version of dump1080 for use with flightaware.

In the end this was a benefit since running a ground station for flightaware gives you free access to a Enterprise account on their site.

I am running this basically 24x7 now with the simple hardware below. The USB battery is constantly being charged from the line as a basic UPS. Unfortunately this USB battery drops the output when charge power is removed or inserted so it is really not a UPS (so the Pi reboots)  but since I am using a dietpi image for the Raspberry Pi, Dietpi is configured to put all the logs in memory and not on the SD card and I believe corruption is minimized. I have observed excellent uptime.


The basic recipe to get this up and running with the above hardware is to install DietPi --> HERE you can script the setup of the Wifi so it can be completely "headless" and no need to fumble with a keyboard and monitor. Then after about 30 minutes you can SSH in and run the below commands and you will be operational.
       

wget http://flightaware.com/adsb/piaware/files/packages/pool/piaware/p/piaware-support/piaware-repository_3.3.0_all.deb
sudo dpkg -i piaware-repository_3.3.0_all.deb
sudo apt-get update
sudo apt-get dist-upgrade -y
sudo apt-get install -y piaware fail2ban libio-socket-ssl-perl
sudo piaware-config allow-auto-updates yes
sudo piaware-config allow-manual-updates yes
sudo apt-get install dump1090-fa -y
sudo reboot

       
 

Monday, July 2, 2018

More ESP8266 fun

I continue to test and validate the stability of Node Red, MQTT (on Rasp Pi Zero) and SONOFF devices with various firmware loads as a home automation platform.

This past weekend at the TRW Swap Meet I picked up a LoLin V3 NodeMcu Lua CH340G ESP8266 development board for $8 from Tim who is there nearly every month and has many cool Arduino and other micro-controller items. This board is cool because it is a ESP8266, has a built in FTDI USB interface all in a nice break-out board. After doing some quick googling I found many resources to get going with this board. The following are my steps:

1.) Download serial driver for LoLin Board -->  HERE
2.) Configure/check-out the board using the Arduino IDE (I'm using v1.8.1) from this site --> HERE
3.) WebServer to control LED from this site --> HERE
4.) MQTT DHT code  -->  HERE , I then modified it for JSON message format HERE

With step 4, we have our own Arduino IDE based MQTT code running on the ESP8266

I created a Node Red flow HERE to monitor the DHT sensors to chart the message that are sent every minute.

I was able to build this Node Red dashboard.

I am now running ESPurna v1.13.0 firmware on one of my SONOFF basics and so far I believe it is simpler than Tasmota for setup and operation. I am now running it to see how it looks as far as uptime and hangs. I was getting restarts of Tasmota every day or so and recently hard hangs that required me to reset them and reconfigure it back on the network.

Tuesday, April 24, 2018

More SONFF, Node Red, and MQTT testing

Below is my simple lash up of the DHT-11 sensor to the basic SONOFF switch using the unused GPIO. I am powering it via the FTDI board. This works great for the sensor and LED on the SONOFF but does not fully operate the relay. I did this so I could range test the Wifi and actually had it powered by a USB battery pack. The range was great, good signal in the house and back yard.
The Node Red UI screen below shows the use of the chart function to plot the WiFi signal level and DHT-11 temperature. The Node Red code is HERE

Tuesday, April 3, 2018

SONOFF Wireless switches, Node-RED, Tasmota, and MQTT

I have been busy playing with SONOFF wireless switches, both the Basic and the 4CH. I have developed some Arduino IDE based firmware for both devices here on GitHub,

I am also looking at an alternative to OpenHAB for home automation using Node-RED (the coolest software I have ever seen to date) and MQTT Mosquitto all running on Docker. I am running it on a PC with Vagrant but I would like to move it to Raspberry Pi Zero W. The idea being two or more running a Docker swarm for the Node-RED and MQTT services. I want to figure out a way to make it highly available using something like Keepalived. My Node-RED flows are here onGitHub. Today I just loaded the alternate firmware for the SONOFF's --> Tasmota. It is very powerful. So far I got the MQTT mode working with Node-RED and I added a DHT11 sensor (super cool).

Wednesday, January 24, 2018

Digi-Comp I v2.0

This last weekend I built my Digi-Comp I v2.0 which is a replica of a Digi-Comp I which was first released back in 1963.

The Digi-Comp I v2.0 available from Minds-On Toys is made of cardboard verses the plastic of the original. Since originals are hard to come by, this is good alternative. I am still tuning it mechanically but the picture above is basically alternately toggling the A and B flip-flops. It is of course hand operated and the GIF is stop motion without my hand in view :-).

It is great entertainment to researching vintage computing toys and actually being able to own one and build it, to understand it with your own hands is even better.

Tuesday, July 11, 2017

Camper Build IX

The basic build of the folding camper is complete. The panels are insulated and I have begun painting. I decided not to fiberglass. I am using a high quality house paint, The painting and finishing takes time and you can spend as much or as little on it, but it is directly proportional to how it will look in the end. I am trying to strike a balance because I want it get it on the truck and use it soon.

The top, front and side panels will be ultra white. It is taking between 3 and 4 coats to get good thick coverage. The bottom half and underside will be either black or desert tan, maybe forest green, I am still deciding. The inside may not get painted until I use it a few times but I plan to urethane the floor. The interior walls may be what ever color of extra paint I have from other house projects :-)



Sunday, June 11, 2017

APRS Touch Tone Gateway

I have been playing with WB2OSZ Direwolf software, it is very powerful and can act as a APRS Touch Tone gateway. His software ia located HERE.

I was able to get his code working under windows and using the DTMF decoder it is decoding my 10 digit call sign and a two digit message. This is a new configuration idea suggested by the father of APRS WB4APR, see the new idea below. I just set mine up on a simplex radio for testing.

-----------Bob's new idea! --------------
But here is the NEW idea of how to use its 2 digit message capability
locally...
1) Have it listen from a very high central metro area location for DTMF on
146.58
2) The two-digit messages (01 to 99) can be used to trigger the APRS and
voice response of "CALLSIGN, LISTENING ON XXX.XXX MHz"
3) then ALL APRS mobiles in the area will see the message on their radios
4) AND he messages goes worldwide in the APRS-IS system
5) You could be called back via Echolink for example
6) AND if anyone is monitoring 146.58, they will hear EVERYONE on the air
and where they are listening.
In our area with over 50 repeaters, we are so spread out, hardly any
repeater is being used. But this way, everyone's "presence" on the air is
announced on APRS and the single 146.58 just like APRS was always intended
to be... a single clearing house channel for everything happening in ham
radio.
But now you only need a DTMF radio. Not a full APRS rig.
Oh, we just make a local list 01 to 99 of the different frequencies. Every
local list is different, but so are the repeaters in every local area...
Though I am starting to think it can be quite universal! Wow, Il start
now... for example 76 is 146.76 and 94 is 146.94, etc!
You just program your DTMF memory with the few repeaters you use, and then
sending out your message is just one button. Send the DTMF memory with
your chosen "monitoring frequency!
for more info on APRStt see http://aprs.org/aprstt.html
Bob Bruninga, WB4APR
USNA Satellite Lab

Camper Build VIII

It has been a while since I posted in general and regarding the camper build. The build continues  a bit each weekend with the following progress:

  • Windows with slider inserts completed
  • Insulating of the top and sides
  • Paneling of the front with door and one side
Here are the windows with screens in, looking in one to the other.

Here is the basic assembly of the windows using the synthetic wood trim material and the slider guides that are glued to the synthetic wood.

This is the black plastic sliding door tracks I am using that I got from Rockler

I am finishing up all the insulating with the R-TECH foam.

Here is the door insulated and sided with 2.7 mm thin door skin plywood.
Here is one of the sides insulated with the inside sidinging.
Once I finish the insulation and interior paneling I will begin the exterior finish. I am planning on a light epoxy fiberglass coating and then paint. I still need to work out the door latch assembly and the general weather sealing.

I am hoping to try it out camping in the late summer as well as fall/winter since it is insulated.

Monday, April 17, 2017

Retro Computer Fun

For the last couple of months I have been playing with some Retro Computers.


I thought CP/M and the various tools on a tiny computer like the Teensy 3.6 would be a perfect low powered non-Internet computer various projects and to be portable. However I still needed a terminal to use CP/M and I wanted some minimal graphic capability too. In search of a small dumb terminal board I stumbled in the the world of Maximite HERE and MMBasic created by Geoff the genius!

I am now using a Maximite clone (CGCOLORMAX2). It can drive a VGA or composite display directly with great graphics along with a SD card based flash file system, real-time clock and I/O capability. Recently I have been digging into the power of Geoff's MMBasic that runs on the CGCOLORMAX2 (which uses a PIC32). Even though it is a single precision version of BASIC I have had great success in porting some mathematically intensive astronomy programs.

I have setup my CGCOLORMAX2 to run with a small 4.3 TFT LCD composite display used for backup cameras. The only thing else needed is a PS2 keyboard and DC power to run the board and the monitor (e.g. 12 volts). This setup is running great so far and will do some power consumption tests soon to size the battery pack to make this portable.

Tuesday, January 31, 2017

COSMAC ELF 1802 Clock

I am exploring the idea of building a COSMAC ELF 1802 Clock.

This will be a clock based on the COSMAC ELF 1802 CPU along with some CMOS counters and a time base along with some kind of display.

The plan is that it will display time, date, and year. Since it is an "ELF clock" it will be describing the instant in time, defined as the number of days since the ELF was first described in Popular Electronic Magazine in August of 1976 (8/1/1976). This will be similar to Unix time but without the resolution down to a second.

The time keeping element would be a chain of 8 bit CMOS counters, one for seconds, minutes, and days. These counters could be read as input ports from the CPU.

For software I am trying Tiny Basic to see if it can at least update the display several times per minute. The display will not include seconds in the first revision if using Tiny Basic since it can not complete the calculation fast enough.

I have written the initial conversion of the day counter to calculate year, month, and day accounting for leap year. With a 1.75 Mhz clock speed using the Emma02 emulator it takes 20 seconds for the 300+ lines of code to complete the calculation. Since Tiny Basic only supports 16 bit integers the clock will have a limit of the year 2065.

Below is my code so far. I will remove the spaces after it is debugged to save space but for now it has only been slightly space compressed.


 5 PR "SERIAL EPOCH";  
 10 INPUT S  
 20 GOSUB 1000  
 30 GOSUB 3000  
 55 REM Y=YEAR L=LEAP TRUE/FALSE P=POSITION IN YEAR(DAYS) M=MONTH D=DAY  
 60 PR "14:23 ";M;"/";D;"/";Y  
 65 PR "Y=";Y;" L=";L;" P=";P;" M=";M;" D=";D  
 100 END  
 1000 IF S>0Y=1976  
 1005 IF Y=1976L=1  
 1007 IF Y=1976P=S-0  
 1010 IF S>153Y=1977  
 1015 IF Y=1977L=0  
 1017 IF Y=1977P=S-153  
 1020 IF S>518Y=1978  
 1025 IF Y=1978L=0  
 1027 IF Y=1978P=S-518  
 1030 IF S>883Y=1979  
 1035 IF Y=1979L=0  
 1037 IF Y=1979P=S-883  
 1040 IF S>1248Y=1980  
 1045 IF Y=1980L=1  
 1047 IF Y=1980P=S-1248  
 1050 IF S>1614Y=1981  
 1055 IF Y=1981L=0  
 1057 IF Y=1981P=S-1614  
 1060 IF S>1979Y=1982  
 1065 IF Y=1982L=0  
 1067 IF Y=1982P=S-1979  
 1070 IF S>2344Y=1983  
 1075 IF Y=1983L=0  
 1077 IF Y=1983P=S-2344  
 1080 IF S>2709Y=1984  
 1085 IF Y=1984L=1  
 1087 IF Y=1984P=S-2709  
 1090 IF S>3075Y=1985  
 1095 IF Y=1985L=0  
 1097 IF Y=1985P=S-3075  
 1100 IF S>3440Y=1986  
 1105 IF Y=1986L=0  
 1107 IF Y=1986P=S-3440  
 1110 IF S>3805Y=1987  
 1115 IF Y=1987L=0  
 1117 IF Y=1987P=S-3805  
 1120 IF S>4170Y=1988  
 1125 IF Y=1988L=1  
 1127 IF Y=1988P=S-4170  
 1130 IF S>4536Y=1989  
 1135 IF Y=1989L=0  
 1137 IF Y=1989P=S-4536  
 1140 IF S>4901Y=1990  
 1145 IF Y=1990L=0  
 1147 IF Y=1990P=S-4901  
 1150 IF S>5266Y=1991  
 1155 IF Y=1991L=0  
 1157 IF Y=1991P=S-5266  
 1160 IF S>5631Y=1992  
 1165 IF Y=1992L=1  
 1167 IF Y=1992P=S-5631  
 1170 IF S>5997Y=1993  
 1175 IF Y=1993L=0  
 1177 IF Y=1993P=S-5997  
 1180 IF S>6362Y=1994  
 1185 IF Y=1994L=0  
 1187 IF Y=1994P=S-6362  
 1190 IF S>6727Y=1995  
 1195 IF Y=1995L=0  
 1197 IF Y=1995P=S-6727  
 1200 IF S>7092Y=1996  
 1205 IF Y=1996L=1  
 1207 IF Y=1996P=S-7092  
 1210 IF S>7458Y=1997  
 1215 IF Y=1997L=0  
 1217 IF Y=1997P=S-7458  
 1220 IF S>7823Y=1998  
 1225 IF Y=1998L=0  
 1227 IF Y=1998P=S-7823  
 1230 IF S>8188Y=1999  
 1235 IF Y=1999L=0  
 1237 IF Y=1999P=S-8188  
 1240 IF S>8553Y=2000  
 1245 IF Y=2000L=1  
 1247 IF Y=2000P=S-8553  
 1250 IF S>8919Y=2001  
 1255 IF Y=2001L=0  
 1257 IF Y=2001P=S-8919  
 1260 IF S>9284Y=2002  
 1265 IF Y=2002L=0  
 1267 IF Y=2002P=S-9284  
 1270 IF S>9649Y=2003  
 1275 IF Y=2003L=0  
 1277 IF Y=2003P=S-9649  
 1280 IF S>10014Y=2004  
 1285 IF Y=2004L=1  
 1287 IF Y=2004P=S-10014  
 1290 IF S>10380Y=2005  
 1295 IF Y=2005L=0  
 1297 IF Y=2005P=S-10380  
 1300 IF S>10745Y=2006  
 1305 IF Y=2006L=0  
 1307 IF Y=2006P=S-10745  
 1310 IF S>11110Y=2007  
 1315 IF Y=2007L=0  
 1317 IF Y=2007P=S-11110  
 1320 IF S>11475Y=2008  
 1325 IF Y=2008L=1  
 1327 IF Y=2008P=S-11475  
 1330 IF S>11841Y=2009  
 1335 IF Y=2009L=0  
 1337 IF Y=2009P=S-11841  
 1340 IF S>12206Y=2010  
 1345 IF Y=2010L=0  
 1347 IF Y=2010P=S-12206  
 1350 IF S>12571Y=2011  
 1355 IF Y=2011L=0  
 1357 IF Y=2011P=S-12571  
 1360 IF S>12936Y=2012  
 1365 IF Y=2012L=1  
 1367 IF Y=2012P=S-12936  
 1370 IF S>13302Y=2013  
 1375 IF Y=2013L=0  
 1377 IF Y=2013P=S-13302  
 1380 IF S>13667Y=2014  
 1385 IF Y=2014L=0  
 1387 IF Y=2014P=S-13667  
 1390 IF S>14032Y=2015  
 1395 IF Y=2015L=0  
 1397 IF Y=2015P=S-14032  
 1400 IF S>14397Y=2016  
 1405 IF Y=2016L=1  
 1407 IF Y=2016P=S-14397  
 1410 IF S>14763Y=2017  
 1415 IF Y=2017L=0  
 1417 IF Y=2017P=S-14763  
 1420 IF S>15128Y=2018  
 1425 IF Y=2018L=0  
 1427 IF Y=2018P=S-15128  
 1430 IF S>15493Y=2019  
 1435 IF Y=2019L=0  
 1437 IF Y=2019P=S-15493  
 1440 IF S>15858Y=2020  
 1445 IF Y=2020L=1  
 1447 IF Y=2020P=S-15858  
 1450 IF S>16224Y=2021  
 1455 IF Y=2021L=0  
 1457 IF Y=2021P=S-16224  
 1460 IF S>16589Y=2022  
 1465 IF Y=2022L=0  
 1467 IF Y=2022P=S-16589  
 1470 IF S>16954Y=2023  
 1475 IF Y=2023L=0  
 1477 IF Y=2023P=S-16954  
 1480 IF S>17319Y=2024  
 1485 IF Y=2024L=1  
 1487 IF Y=2024P=S-17319  
 1490 IF S>17685Y=2025  
 1495 IF Y=2025L=0  
 1497 IF Y=2025P=S-17685  
 1500 IF S>18050Y=2026  
 1505 IF Y=2026L=0  
 1507 IF Y=2026P=S-18050  
 1510 IF S>18415Y=2027  
 1515 IF Y=2027L=0  
 1517 IF Y=2027P=S-18415  
 1520 IF S>18780Y=2028  
 1525 IF Y=2028L=1  
 1527 IF Y=2028P=S-18780  
 1530 IF S>19146Y=2029  
 1535 IF Y=2029L=0  
 1537 IF Y=2029P=S-19146  
 1540 IF S>19511Y=2030  
 1545 IF Y=2030L=0  
 1547 IF Y=2030P=S-19511  
 1550 IF S>19876Y=2031  
 1555 IF Y=2031L=0  
 1557 IF Y=2031P=S-19876  
 1560 IF S>20241Y=2032  
 1565 IF Y=2032L=1  
 1567 IF Y=2032P=S-20241  
 1570 IF S>20607Y=2033  
 1575 IF Y=2033L=0  
 1577 IF Y=2033P=S-20607  
 1580 IF S>20972Y=2034  
 1585 IF Y=2034L=0  
 1587 IF Y=2034P=S-20972  
 1590 IF S>21337Y=2035  
 1595 IF Y=2035L=0  
 1597 IF Y=2035P=S-21337  
 1600 IF S>21702Y=2036  
 1605 IF Y=2036L=1  
 1607 IF Y=2036P=S-21702  
 1610 IF S>22068Y=2037  
 1615 IF Y=2037L=0  
 1617 IF Y=2037P=S-22068  
 1620 IF S>22433Y=2038  
 1625 IF Y=2038L=0  
 1627 IF Y=2038P=S-22433  
 1630 IF S>22798Y=2039  
 1635 IF Y=2039L=0  
 1637 IF Y=2039P=S-22798  
 1640 IF S>23163Y=2040  
 1645 IF Y=2040L=1  
 1647 IF Y=2040P=S-23163  
 1650 IF S>23529Y=2041  
 1655 IF Y=2041L=0  
 1657 IF Y=2041P=S-23529  
 1660 IF S>23894Y=2042  
 1665 IF Y=2042L=0  
 1667 IF Y=2042P=S-23894  
 1670 IF S>24259Y=2043  
 1675 IF Y=2043L=0  
 1677 IF Y=2043P=S-24259  
 1680 IF S>24624Y=2044  
 1685 IF Y=2044L=1  
 1687 IF Y=2044P=S-24624  
 1690 IF S>24990Y=2045  
 1695 IF Y=2045L=0  
 1697 IF Y=2045P=S-24990  
 1700 IF S>25355Y=2046  
 1705 IF Y=2046L=0  
 1707 IF Y=2046P=S-25355  
 1710 IF S>25720Y=2047  
 1715 IF Y=2047L=0  
 1717 IF Y=2047P=S-25720  
 1720 IF S>26085Y=2048  
 1725 IF Y=2048L=1  
 1727 IF Y=2048P=S-26085  
 1730 IF S>26451Y=2049  
 1735 IF Y=2049L=0  
 1737 IF Y=2049P=S-26451  
 1740 IF S>26816Y=2050  
 1745 IF Y=2050L=0  
 1747 IF Y=2050P=S-26816  
 1750 IF S>27181Y=2051  
 1755 IF Y=2051L=0  
 1757 IF Y=2051P=S-27181  
 1760 IF S>27546Y=2052  
 1765 IF Y=2052L=1  
 1767 IF Y=2052P=S-27546  
 1770 IF S>27912Y=2053  
 1775 IF Y=2053L=0  
 1777 IF Y=2053P=S-27912  
 1780 IF S>28277Y=2054  
 1785 IF Y=2054L=0  
 1787 IF Y=2054P=S-28277  
 1790 IF S>28642Y=2055  
 1795 IF Y=2055L=0  
 1797 IF Y=2055P=S-28642  
 1800 IF S>29007Y=2056  
 1805 IF Y=2056L=1  
 1807 IF Y=2056P=S-29007  
 1810 IF S>29373Y=2057  
 1815 IF Y=2057L=0  
 1817 IF Y=2057P=S-29373  
 1820 IF S>29738Y=2058  
 1825 IF Y=2058L=0  
 1827 IF Y=2058P=S-29738  
 1830 IF S>30103Y=2059  
 1835 IF Y=2059L=0  
 1837 IF Y=2059P=S-30103  
 1840 IF S>30468Y=2060  
 1845 IF Y=2060L=1  
 1847 IF Y=2060P=S-30468  
 1850 IF S>30834Y=2061  
 1855 IF Y=2061L=0  
 1857 IF Y=2061P=S-30834  
 1860 IF S>31199Y=2062  
 1865 IF Y=2062L=0  
 1867 IF Y=2062P=S-31199  
 1870 IF S>31564Y=2063  
 1875 IF Y=2063L=0  
 1877 IF Y=2063P=S-31564  
 1880 IF S>31929Y=2064  
 1885 IF Y=2064L=1  
 1887 IF Y=2064P=S-31929  
 1890 IF S>32295Y=2065  
 1895 IF Y=2065L=0  
 1897 IF Y=2065P=S-32295  
 2000 RETURN  
 3000 IF Y=1976 L=3  
 3010 IF L=0 GOSUB 4000  
 3020 IF L=1 GOSUB 5000  
 3030 IF L=3 GOSUB 6000  
 3040 RETURN  
 4000 IF P>0M=1  
 4010 IF P>0D=P  
 4020 IF P>31M=2  
 4030 IF P>31D=P-31  
 4040 IF P>59M=3  
 4050 IF P>59D=P-59  
 4060 IF P>90M=4  
 4070 IF P>90D=P-90  
 4080 IF P>120M=5  
 4090 IF P>120D=P-120  
 4100 IF P>151M=6  
 4110 IF P>151D=P-151  
 4120 IF P>181M=7  
 4130 IF P>181D=P-181  
 4140 IF P>212M=8  
 4150 IF P>212D=P-212  
 4160 IF P>243M=9  
 4170 IF P>243D=P-243  
 4180 IF P>273M=10  
 4190 IF P>273D=P-273  
 4200 IF P>304M=11  
 4210 IF P>304D=P-304  
 4220 IF P>334M=12  
 4230 IF P>334D=P-334  
 4900 RETURN  
 5000 IF P>0M=1  
 5010 IF P>0D=P  
 5020 IF P>31M=2  
 5030 IF P>31D=P-31  
 5040 IF P>60M=3  
 5050 IF P>60D=P-60  
 5060 IF P>91M=4  
 5070 IF P>91D=P-91  
 5080 IF P>121M=5  
 5090 IF P>121D=P-121  
 5100 IF P>152M=6  
 5110 IF P>152D=P-152  
 5120 IF P>182M=7  
 5130 IF P>182D=P-182  
 5140 IF P>213M=8  
 5150 IF P>213D=P-213  
 5160 IF P>244M=9  
 5170 IF P>244D=P-244  
 5180 IF P>274M=10  
 5190 IF P>274D=P-274  
 5200 IF P>305M=11  
 5210 IF P>305D=P-305  
 5220 IF P>335M=12  
 5230 IF P>335D=P-335  
 5240 RETURN  
 6000 RETURN  
 0