Merge branch 'master' of ssh://git.gag.com/scm/git/fw/altos
authorBdale Garbee <bdale@gag.com>
Sun, 7 Sep 2014 05:42:47 +0000 (23:42 -0600)
committerBdale Garbee <bdale@gag.com>
Sun, 7 Sep 2014 05:42:47 +0000 (23:42 -0600)
17 files changed:
altoslib/AltosConfigData.java
altoslib/AltosLink.java
doc/Makefile
doc/altusmetrum.xsl
doc/configure-altimeter.png
doc/configure-groundstation.png
doc/easymega-outline.xsl [new file with mode: 0644]
doc/easymega-v1.0-bottom.jpg [new file with mode: 0644]
doc/easymega-v1.0-top.jpg [new file with mode: 0644]
doc/easymega.svg [new file with mode: 0644]
doc/release-notes-1.5.xsl [new file with mode: 0644]
doc/scan-channels.png
src/cc1111/ao_radio.c
src/drivers/ao_cc1120.c
src/drivers/ao_cc1120.h
src/drivers/ao_cc115l.c
src/drivers/ao_packet_master.c

index fd38635cc0cd25c1e7e1560c5741e53ac8bafe09..4ada1d3bbb309442a893171712a75340cb89e692 100644 (file)
@@ -386,6 +386,10 @@ public class AltosConfigData implements Iterable<String> {
                return radio_frequency >= 0 || radio_setting >= 0 || radio_channel >= 0;
        }
 
+       public boolean has_telemetry_rate() {
+               return telemetry_rate >= 0;
+       }
+
        public void set_frequency(double freq) {
                int     frequency = radio_frequency;
                int     setting = radio_setting;
@@ -558,20 +562,39 @@ public class AltosConfigData implements Iterable<String> {
                                                        radio_calibration);
                        /* When remote, reset the dongle frequency at the same time */
                        if (remote) {
+                               link.flush_output();
                                link.stop_remote();
                                link.set_radio_frequency(frequency);
+                               link.flush_output();
                                link.start_remote();
                        }
                }
 
-               if (callsign != null)
+               if (telemetry_rate >= 0) {
+                       link.printf("c T %d\n", telemetry_rate);
+                       if (remote) {
+                               link.flush_output();
+                               link.stop_remote();
+                               link.set_telemetry_rate(telemetry_rate);
+                               link.flush_output();
+                               link.start_remote();
+                       }
+               }
+
+               if (callsign != null) {
                        link.printf("c c %s\n", callsign);
+                       if (remote) {
+                               link.flush_output();
+                               link.stop_remote();
+                               link.set_callsign(callsign);
+                               link.flush_output();
+                               link.start_remote();
+                       }
+               }
+
                if (radio_enable >= 0)
                        link.printf("c e %d\n", radio_enable);
 
-               if (telemetry_rate >= 0)
-                       link.printf("c T %d\n", telemetry_rate);
-
                /* HAS_ACCEL */
                /* UI doesn't support accel cal */
                if (pad_orientation >= 0)
index eadab5dff6d3029b77c7e8b08e84c0444f6cba79..62bd82b93c2ae617c4d67a305696e99a32bd3ba7 100644 (file)
@@ -163,8 +163,21 @@ public abstract class AltosLink implements Runnable {
                if (!can_cancel && remote)
                        System.out.printf("Uh-oh, reading remote serial device from swing thread\n");
 
-               if (remote && can_cancel)
+               if (remote && can_cancel) {
                        timeout = 500;
+                       switch (telemetry_rate) {
+                       case AltosLib.ao_telemetry_rate_38400:
+                       default:
+                               timeout = 500;
+                               break;
+                       case AltosLib.ao_telemetry_rate_9600:
+                               timeout = 2000;
+                               break;
+                       case AltosLib.ao_telemetry_rate_2400:
+                               timeout = 8000;
+                               break;
+                       }
+               }
                try {
                        ++in_reply;
 
@@ -307,7 +320,7 @@ public abstract class AltosLink implements Runnable {
         */
        public boolean monitor_mode = false;
        public int telemetry = AltosLib.ao_telemetry_standard;
-       public int telemetry_rate = AltosLib.ao_telemetry_rate_38400;
+       public int telemetry_rate = -1;
        public double frequency;
        public String callsign;
        AltosConfigData config_data;
@@ -446,7 +459,12 @@ public abstract class AltosLink implements Runnable {
                if (debug)
                        System.out.printf("start remote %7.3f\n", frequency);
                set_radio_frequency(frequency);
-               set_callsign(AltosPreferences.callsign());
+               if (telemetry_rate < 0)
+                       telemetry_rate = AltosPreferences.telemetry_rate(serial);
+               set_telemetry_rate(telemetry_rate);
+               if (callsign.equals(""))
+                       callsign = AltosPreferences.callsign();
+               set_callsign(callsign);
                printf("p\nE 0\n");
                flush_input();
                remote = true;
index c39450c7ddd100ff4de458beb850efd565292b06..60c63f63524d156f08c2f927ac06493ff202bf17 100644 (file)
@@ -16,7 +16,8 @@ RELNOTES=\
        release-notes-1.3.1.html \
        release-notes-1.3.2.html \
        release-notes-1.4.html \
-       release-notes-1.4.1.html
+       release-notes-1.4.1.html \
+       release-notes-1.5.html
 
 PICTURES=\
        altosui.png \
@@ -61,12 +62,13 @@ SVG=\
        easymini.svg \
        telemega.svg \
        telemetrum.svg \
-       telemini.svg
+       telemini.svg \
+       easymega.svg
 
 RELNOTES_XSL=$(RELNOTES:.html=.xsl)
 HTML=altusmetrum.html altos.html telemetry.html companion.html micropeak.html telegps.html $(RELNOTES)
 PDF=altusmetrum.pdf altos.pdf telemetry.pdf companion.pdf micropeak.pdf telegps.pdf \
-       telemetrum-outline.pdf telemega-outline.pdf easymini-outline.pdf
+       telemetrum-outline.pdf telemega-outline.pdf easymini-outline.pdf easymega-outline.pdf
 HTMLSTYLE=/usr/share/xml/docbook/stylesheet/docbook-xsl/html/docbook.xsl
 FOSTYLE=xorg-fo.xsl
 TEMPLATES=titlepage.templates.xsl
index b4cac48e201ddf4268dbcd4ca6d79b32b37f936b..0785f65a9a8219ebaae8d4e3ffe553a7234cbd3c 100644 (file)
       </para>
     </legalnotice>
     <revhistory>
+      <revision>
+       <revnumber>1.5</revnumber>
+       <date>6 September 2014</date>
+       <revremark>
+         Major release adding EasyMega support.
+       </revremark>
+      </revision>
       <revision>
        <revnumber>1.4.1</revnumber>
        <date>20 June 2014</date>
@@ -202,6 +209,11 @@ NAR #88757, TRA #12200
       EasyMini is a dual-deploy altimeter with logging and built-in
       USB data download.
     </para>
+    <para>
+      EasyMega is essentially a TeleMega board with the GPS receiver
+      and telemetry transmitter removed. It offers the same 6 pyro
+      channels and integrated gyroscopes for staging/air-start inhibit.
+    </para>
     <para>
       TeleDongle was our first ground station, providing a USB to RF
       interfaces for communicating with the altimeters. Combined with
@@ -231,7 +243,7 @@ NAR #88757, TRA #12200
       “starter kit” is to charge the battery.
     </para>
     <para>
-      For TeleMetrum and TeleMega, the battery can be charged by plugging it into the
+      For TeleMetrum, TeleMega and EasyMega, the battery can be charged by plugging it into the
       corresponding socket of the device and then using the USB
       cable to plug the flight computer into your computer's USB socket. The
       on-board circuitry will charge the battery whenever it is plugged
@@ -252,7 +264,7 @@ NAR #88757, TRA #12200
       deeply discharged battery.
     </para>
     <para>
-      TeleMetrum v2.0 and TeleMega use a higher power battery charger,
+      TeleMetrum v2.0, TeleMega and EasyMega use a higher power battery charger,
       allowing them to charge the battery while running the board at
       maximum power. When the battery is charging, or when the board
       is consuming a lot of power, the red LED will be lit. When the
@@ -456,7 +468,7 @@ NAR #88757, TRA #12200
          EasyMini and TeleMini v2 are designed to use either a
          lithium polymer battery or any other battery producing
          between 4 and 12 volts, such as a rectangular 9V
-         battery. TeleMega and TeleMetrum are not designed for this,
+         battery. TeleMega, EasyMega and TeleMetrum are not designed for this,
          and must only be powered by a lithium polymer battery. Find
          instructions on how to use other batteries in the EasyMini
          and TeleMini sections below.
@@ -574,6 +586,16 @@ NAR #88757, TRA #12200
              <entry>40mW</entry>
              <entry>3.7V</entry>
            </row>
+           <row>
+             <entry>EasyMega <?linebreak?>v1.0</entry>
+             <entry><para>MS5607 30km (100k')</para></entry>
+             <entry><para>MMA6555 102g</para></entry>
+             <entry>-</entry>
+             <entry><para>MPU6000 HMC5883</para></entry>
+             <entry>8MB</entry>
+             <entry>-</entry>
+             <entry>3.7V</entry>
+           </row>
          </tbody>
        </tgroup>
       </table>
@@ -682,6 +704,25 @@ NAR #88757, TRA #12200
              <entry>3¼ inch (8.26cm)</entry>
              <entry>38mm coupler</entry>
            </row>
+           <row>
+             <entry>EasyMega</entry>
+             <entry><para>
+               Debug<?linebreak?>
+               Companion<?linebreak?>
+               USB<?linebreak?>
+               Battery
+             </para></entry>
+             <entry><para>
+               Apogee pyro <?linebreak?>
+               Main pyro<?linebreak?>
+               Pyro A-D<?linebreak?>
+               Switch<?linebreak?>
+               Pyro battery
+             </para></entry>
+             <entry>1¼ inch (3.18cm)</entry>
+             <entry>2¼ inch (5.62cm)</entry>
+             <entry>38mm coupler</entry>
+           </row>
          </tbody>
        </tgroup>
       </table>
@@ -1361,6 +1402,178 @@ NAR #88757, TRA #12200
        </para>
       </section>
     </section>
+    <section>
+      <title>EasyMega</title>
+      <informalfigure>
+       <mediaobject>
+         <imageobject>
+           <imagedata fileref="easymega-v1.0-top.jpg" width="4.5in" scalefit="1"/>
+         </imageobject>
+       </mediaobject>
+      </informalfigure>
+      <para>
+       EasyMega is a 1¼ inch by 2¼ inch circuit board. It was
+       designed to easily fit in a 38mm coupler. Like TeleMetrum,
+       EasyMega has an accelerometer and so it must be mounted so that
+       the board is aligned with the flight axis. It can be mounted
+       either antenna up or down.
+      </para>
+      <section>
+       <title>EasyMega Screw Terminals</title>
+       <para>
+         EasyMega has two sets of nine screw terminals on the end of
+         the board opposite the telemetry antenna. They are as follows:
+       </para>
+       <table frame='all'>
+         <title>EasyMega Screw Terminals</title>
+         <?dbfo keep-together="always"?>
+         <tgroup cols='3' align='center' colsep='1' rowsep='1'>
+           <colspec align='center' colwidth='*' colname='Pin #'/>
+           <colspec align='center' colwidth='2*' colname='Pin Name'/>
+           <colspec align='left' colwidth='5*' colname='Description'/>
+           <thead>
+             <row>
+               <entry align='center'>Terminal #</entry>
+               <entry align='center'>Terminal Name</entry>
+               <entry align='center'>Description</entry>
+             </row>
+           </thead>
+           <tbody>
+             <row>
+               <entry>Top 1</entry>
+               <entry>Switch Input</entry>
+               <entry>Switch connection to positive battery terminal</entry>
+             </row>
+             <row>
+               <entry>Top 2</entry>
+               <entry>Switch Output</entry>
+               <entry>Switch connection to flight computer</entry>
+             </row>
+             <row>
+               <entry>Top 3</entry>
+               <entry>GND</entry>
+               <entry>Ground connection for use with external active switch</entry>
+             </row>
+             <row>
+               <entry>Top 4</entry>
+               <entry>Main -</entry>
+               <entry>Main pyro channel connection to pyro circuit</entry>
+             </row>
+             <row>
+               <entry>Top 5</entry>
+               <entry>Main +</entry>
+               <entry>Main pyro channel common connection to battery +</entry>
+             </row>
+             <row>
+               <entry>Top 6</entry>
+               <entry>Apogee -</entry>
+               <entry>Apogee pyro channel connection to pyro circuit</entry>
+             </row>
+             <row>
+               <entry>Top 7</entry>
+               <entry>Apogee +</entry>
+               <entry>Apogee pyro channel common connection to battery +</entry>
+             </row>
+             <row>
+               <entry>Top 8</entry>
+               <entry>D -</entry>
+               <entry>D pyro channel connection to pyro circuit</entry>
+             </row>
+             <row>
+               <entry>Top 9</entry>
+               <entry>D +</entry>
+               <entry>D pyro channel common connection to battery +</entry>
+             </row>
+             <row>
+               <entry>Bottom 1</entry>
+               <entry>GND</entry>
+               <entry>Ground connection for negative pyro battery terminal</entry>
+             </row>
+             <row>
+               <entry>Bottom 2</entry>
+               <entry>Pyro</entry>
+               <entry>Positive pyro battery terminal</entry>
+             </row>
+             <row>
+               <entry>Bottom 3</entry>
+               <entry>Lipo</entry>
+               <entry>
+                 Power switch output. Use to connect main battery to
+                 pyro battery input
+               </entry>
+             </row>
+             <row>
+               <entry>Bottom 4</entry>
+               <entry>A -</entry>
+               <entry>A pyro channel connection to pyro circuit</entry>
+             </row>
+             <row>
+               <entry>Bottom 5</entry>
+               <entry>A +</entry>
+               <entry>A pyro channel common connection to battery +</entry>
+             </row>
+             <row>
+               <entry>Bottom 6</entry>
+               <entry>B -</entry>
+               <entry>B pyro channel connection to pyro circuit</entry>
+             </row>
+             <row>
+               <entry>Bottom 7</entry>
+               <entry>B +</entry>
+               <entry>B pyro channel common connection to battery +</entry>
+             </row>
+             <row>
+               <entry>Bottom 8</entry>
+               <entry>C -</entry>
+               <entry>C pyro channel connection to pyro circuit</entry>
+             </row>
+             <row>
+               <entry>Bottom 9</entry>
+               <entry>C +</entry>
+               <entry>C pyro channel common connection to battery +</entry>
+             </row>
+           </tbody>
+         </tgroup>
+       </table>
+      </section>
+      <section>
+       <title>Using a Separate Pyro Battery with EasyMega</title>
+       <para>
+         EasyMega provides explicit support for an external pyro
+         battery. All that is required is to remove the jumper
+         between the lipo terminal (Bottom 3) and the pyro terminal
+         (Bottom 2). Then hook the negative pyro battery terminal to ground
+         (Bottom 1) and the positive pyro battery to the pyro battery
+         input (Bottom 2). You can then use the existing pyro screw
+         terminals to hook up all of the pyro charges.
+       </para>
+      </section>
+      <section>
+       <title>Using Only One Battery With EasyMega</title>
+       <para>
+         Because EasyMega has built-in support for a separate pyro
+         battery, if you want to fly with just one battery running
+         both the computer and firing the charges, you need to
+         connect the flight computer battery to the pyro
+         circuit. EasyMega has two screw terminals for this—hook a
+         wire from the Lipo terminal (Bottom 3) to the Pyro terminal
+         (Bottom 2).
+       </para>
+      </section>
+      <section>
+       <title>Using an Active Switch with EasyMega</title>
+       <para>
+         As explained above, an external active switch requires three
+         connections, one to the positive battery terminal, one to
+         the flight computer positive input and one to ground.
+       </para>
+       <para>
+         The positive battery terminal is available on Top terminal
+         1, the positive flight computer input is on Top terminal
+         2. Ground is on Top terminal 3.
+       </para>
+      </section>
+    </section>
     <section>
       <title>Flight Data Recording</title>
       <para>
@@ -1431,6 +1644,12 @@ NAR #88757, TRA #12200
              <entry>8MB</entry>
              <entry>40</entry>
            </row>
+           <row>
+             <entry>EasyMega</entry>
+             <entry>32</entry>
+             <entry>8MB</entry>
+             <entry>40</entry>
+           </row>
          </tbody>
        </tgroup>
       </table>
@@ -1444,7 +1663,7 @@ NAR #88757, TRA #12200
        Configuration data is also stored in the flash memory on
        TeleMetrum v1.x, TeleMini and EasyMini. This consumes 64kB
        of flash space.  This configuration space is not available
-       for storing flight log data. TeleMetrum v2.0 and TeleMega
+       for storing flight log data. TeleMetrum v2.0, TeleMega and EasyMega
        store configuration data in a bit of eeprom available within
        the processor chip, leaving that space available in flash for
        more flight data.
@@ -1538,7 +1757,7 @@ NAR #88757, TRA #12200
         The AltOS firmware build for the altimeters has two
         fundamental modes, “idle” and “flight”.  Which of these modes
         the firmware operates in is determined at start up time. For
-        TeleMetrum and TeleMega, which have accelerometers, the mode is 
+        TeleMetrum, TeleMega and EasyMega, which have accelerometers, the mode is 
        controlled by the orientation of the
         rocket (well, actually the board, of course...) at the time
         power is switched on.  If the rocket is “nose up”, then
@@ -1803,7 +2022,8 @@ NAR #88757, TRA #12200
        and beep out the maximum height until turned off.
       </para>
       <para>
-        One “neat trick” of particular value when TeleMetrum or TeleMega are used with 
+        One “neat trick” of particular value when TeleMetrum, TeleMega
+       or EasyMega are used with 
         very large air-frames, is that you can power the board up while the 
         rocket is horizontal, such that it comes up in idle mode.  Then you can
         raise the air-frame to launch position, and issue a 'reset' command 
@@ -2049,6 +2269,15 @@ NAR #88757, TRA #12200
        isn't displaying position information, it's possible that this
        is the cause.
       </para>
+      <para>
+       APRS packets include an SSID (Secondary Station Identifier)
+       field that allows one operator to have multiple
+       transmitters. AltOS allows you to set this to a single digit
+       from 0 to 9, allowing you to fly multiple transmitters at the
+       same time while keeping the identify of each one separate in
+       the receiver. By default, the SSID is set to the last digit of
+       the device serial number.
+      </para>
       <para>
        The APRS packet format includes a comment field that can have
        arbitrary text in it. AltOS uses this to send status
@@ -2095,15 +2324,20 @@ NAR #88757, TRA #12200
              <entry>M3.7</entry>
              <entry>Main Igniter Voltage</entry>
            </row>
+           <row>
+             <entry>6</entry>
+             <entry>1286</entry>
+             <entry>Device Serial Number</entry>
+           </row>
          </tbody>
        </tgroup>
       </table>
       <para>
        Here's an example of an APRS comment showing GPS lock with 6
        satellites in view, a primary battery at 4.0V, and
-       apogee and main igniters both at 3.7V.
+       apogee and main igniters both at 3.7V from device 1286.
        <screen>
-         L6 B4.0 A3.7 M3.7
+         L6 B4.0 A3.7 M3.7 1286
        </screen>
       </para>
       <para>
@@ -2166,6 +2400,18 @@ NAR #88757, TRA #12200
          mode.
        </para>
       </section>
+      <section>
+       <title>Telemetry baud rate</title>
+       <para>
+         This sets the modulation bit rate for data transmission for
+         both telemetry and packet link mode. Lower bit
+         rates will increase range while reducing the amount of data
+         that can be sent and increasing battery consumption. All
+         telemetry is done using a rate 1/2 constraint 4 convolution
+         code, so the actual data transmission rate is 1/2 of the
+         modulation bit rate specified here.
+       </para>
+      </section>
       <section>
        <title>APRS Interval</title>
        <para>
@@ -2176,6 +2422,14 @@ NAR #88757, TRA #12200
          recommend sending packets no more than once every 5 seconds.
        </para>
       </section>
+      <section>
+       <title>APRS SSID</title>
+       <para>
+         This selects the SSID reported in APRS packets. By default,
+         it is set to the last digit of the serial number, but you
+         can change this to any value from 0 to 9.
+       </para>
+      </section>
       <section>
         <title>Apogee Delay</title>
         <para>
@@ -2260,7 +2514,7 @@ NAR #88757, TRA #12200
       <section>
        <title>Pad Orientation</title>
        <para>
-         TeleMetrum and TeleMega measure acceleration along the axis
+         TeleMetrum, TeleMega and EasyMega measure acceleration along the axis
          of the board. Which way the board is oriented affects the
          sign of the acceleration value. Instead of trying to guess
          which way the board is mounted in the air frame, the
@@ -2275,7 +2529,7 @@ NAR #88757, TRA #12200
        <title>Configurable Pyro Channels</title>
        <para>
          In addition to the usual Apogee and Main pyro channels,
-         TeleMega has four additional channels that can be configured
+         TeleMega and EasyMega have four additional channels that can be configured
          to activate when various flight conditions are
          satisfied. You can select as many conditions as necessary;
          all of them must be met in order to activate the
@@ -2312,7 +2566,7 @@ NAR #88757, TRA #12200
          </listitem>
          <listitem>
            <para>
-             Orientation. TeleMega contains a 3-axis gyroscope and
+             Orientation. TeleMega and EasyMega contain a 3-axis gyroscope and
              accelerometer which is used to measure the current
              angle. Note that this angle is not the change in angle
              from the launch pad, but rather absolute relative to
@@ -3137,6 +3391,18 @@ NAR #88757, TRA #12200
          at all.
        </para>
       </section>
+      <section>
+       <title>Telemetry baud rate</title>
+       <para>
+         This sets the modulation bit rate for data transmission for
+         both telemetry and packet link mode. Lower bit
+         rates will increase range while reducing the amount of data
+         that can be sent and increasing battery consumption. All
+         telemetry is done using a rate 1/2 constraint 4 convolution
+         code, so the actual data transmission rate is 1/2 of the
+         modulation bit rate specified here.
+       </para>
+      </section>
       <section>
        <title>APRS Interval</title>
        <para>
@@ -3149,6 +3415,14 @@ NAR #88757, TRA #12200
          sending any other telemetry during that time.
        </para>
       </section>
+      <section>
+       <title>APRS SSID</title>
+       <para>
+         Which SSID to report in APRS packets. By default, this is
+         set to the last digit of the serial number, but can be
+         configured to any value from 0 to 9.
+       </para>
+      </section>
       <section>
         <title>Callsign</title>
         <para>
@@ -3211,8 +3485,8 @@ NAR #88757, TRA #12200
       <section>
         <title>Pad Orientation</title>
        <para>
-         Because they include accelerometers, TeleMetrum and
-         TeleMega are sensitive to the orientation of the board. By
+         Because they include accelerometers, TeleMetrum,
+         TeleMega and EasyMega are sensitive to the orientation of the board. By
          default, they expect the antenna end to point forward. This
          parameter allows that default to be changed, permitting the
          board to be mounted with the antenna pointing aft instead.
@@ -3261,7 +3535,7 @@ NAR #88757, TRA #12200
        </informalfigure>
        <para>
          This opens a separate window to configure the additional
-         pyro channels available on TeleMega.  One column is
+         pyro channels available on TeleMega and EasyMega.  One column is
          presented for each channel. Each row represents a single
          parameter, if enabled the parameter must meet the specified
          test for the pyro channel to be fired. See the Pyro Channels
@@ -3409,7 +3683,7 @@ NAR #88757, TRA #12200
        </mediaobject>
       </informalfigure>
       <para>
-        Select this button and then select a TeleDongle Device from the list provided.
+        Select this button and then select a TeleDongle or TeleBT Device from the list provided.
       </para>
       <para>
         The first few lines of the dialog provide information about the
@@ -3418,9 +3692,9 @@ NAR #88757, TRA #12200
         individual configuration entries.
       </para>
       <para>
-       Note that the TeleDongle itself doesn't save any configuration
+       Note that TeleDongle and TeleBT don't save any configuration
        data, the settings here are recorded on the local machine in
-       the Java preferences database. Moving the TeleDongle to
+       the Java preferences database. Moving the device to
        another machine, or using a different user account on the same
        machine will cause settings made here to have no effect.
       </para>
@@ -3472,15 +3746,23 @@ NAR #88757, TRA #12200
         </para>
       </section>
       <section>
-        <title>Radio Calibration</title>
+        <title>RF Calibration</title>
         <para>
           The radios in every Altus Metrum device are calibrated at the
           factory to ensure that they transmit and receive on the
-          specified frequency.  To change a TeleDongle's calibration, 
+          specified frequency.  To change a TeleDongle or TeleBT's calibration, 
          you must reprogram the unit completely, so this entry simply
          shows the current value and doesn't allow any changes.
         </para>
       </section>
+      <section>
+        <title>Telemetry Rate</title>
+        <para>
+          This lets you match the telemetry and packet link rate from
+          the transmitter. If they don't match, the device won't
+          receive any data.
+        </para>
+      </section>
     </section>
     <section>
       <title>Flash Image</title>
@@ -3488,7 +3770,7 @@ NAR #88757, TRA #12200
         This reprograms Altus Metrum devices with new
         firmware. TeleMetrum v1.x, TeleDongle, TeleMini and TeleBT are
         all reprogrammed by using another similar unit as a
-        programming dongle (pair programming). TeleMega, TeleMetrum v2
+        programming dongle (pair programming). TeleMega, EasyMega, TeleMetrum v2
         and EasyMini are all programmed directly over their USB ports
         (self programming).  Please read the directions for flashing
         devices in the Updating Device Firmware chapter below.
@@ -3540,9 +3822,9 @@ NAR #88757, TRA #12200
       <para>
        This listens for telemetry packets on all of the configured
        frequencies, displaying information about each device it
-       receives a packet from. You can select which of the three
-       telemetry formats should be tried; by default, it only listens
-       for the standard telemetry packets used in v1.0 and later
+       receives a packet from. You can select which of the baud rates
+       and telemetry formats should be tried; by default, it only listens
+       at 38400 baud with the standard telemetry format used in v1.0 and later
        firmware.
       </para>
     </section>
@@ -3825,12 +4107,12 @@ NAR #88757, TRA #12200
           In the rocket itself, you just need a flight computer and
           a single-cell, 3.7 volt nominal Li-Po rechargeable battery.  An 
          850mAh battery weighs less than a 9V alkaline battery, and will 
-         run a TeleMetrum or TeleMega for hours.
+         run a TeleMetrum, TeleMega or EasyMega for hours.
          A 110mAh battery weighs less than a triple A battery and is a good
-         choice for use with TeleMini.
+         choice for use with TeleMini or EasyMini.
         </para>
         <para>
-          By default, we ship flight computers with a simple wire antenna.  
+          By default, we ship TeleMini, TeleMetrum and TeleMega flight computers with a simple wire antenna.  
          If your electronics bay or the air-frame it resides within is made 
          of carbon fiber, which is opaque to RF signals, you may prefer to 
          install an SMA connector so that you can run a coaxial cable to an 
@@ -3884,8 +4166,8 @@ NAR #88757, TRA #12200
           if the rocket is hiding in sage brush or a tree, or if the last GPS position
           doesn't get you close enough because the rocket dropped into a canyon, or
           the wind is blowing it across a dry lake bed, or something like that...  Keith
-          currently uses a Yaesu VX-7R, Bdale has a Baofung UV-5R
-         which isn't as nice, but was a whole lot cheaper.
+          currently uses a Yaesu FT1D, Bdale has a Yaesu VX-7R, which
+         is a nicer radio in most ways but doesn't support APRS.
         </para>
         <para>
           So, to recap, on the ground the hardware you'll need includes:
@@ -3951,14 +4233,10 @@ NAR #88757, TRA #12200
       </section>
       <section>
         <title>Future Plans</title>
-       <para>
-         We've designed a simple GPS based radio tracker called TeleGPS.  
-         If all goes well, we hope to introduce this in the first
-         half of 2014.
-       </para>
         <para>
           We have designed and prototyped several “companion boards” that 
-         can attach to the companion connector on TeleMetrum and TeleMega
+         can attach to the companion connector on TeleMetrum,
+         TeleMega and EasyMega
          flight computers to collect more data, provide more pyro channels, 
          and so forth.  We do not yet know if or when any of these boards
          will be produced in enough quantity to sell.  If you have specific
@@ -4007,8 +4285,8 @@ NAR #88757, TRA #12200
       <orderedlist inheritnum='inherit' numeration='arabic'>
        <listitem>
          <para>
-           Make sure accelerometer-equipped products like TeleMetrum and
-           TeleMega are aligned precisely along the axis of
+           Make sure accelerometer-equipped products like TeleMetrum,
+           TeleMega and EasyMega are aligned precisely along the axis of
            acceleration so that the accelerometer can accurately
            capture data during the flight.
          </para>
@@ -4218,7 +4496,7 @@ NAR #88757, TRA #12200
   <chapter>
     <title>Updating Device Firmware</title>
     <para>
-      TeleMega, TeleMetrum v2 and EasyMini are all programmed directly
+      TeleMega, TeleMetrum v2, EasyMega and EasyMini are all programmed directly
       over their USB connectors (self programming). TeleMetrum v1, TeleMini and
       TeleDongle are all programmed by using another device as a
       programmer (pair programming). It's important to recognize which
@@ -4241,12 +4519,12 @@ NAR #88757, TRA #12200
       performance slightly.
     </para>
     <para>
-      Self-programmable devices (TeleMega, TeleMetrum v2 and EasyMini)
+      Self-programmable devices (TeleMega, TeleMetrum v2, EasyMega and EasyMini)
       are reprogrammed by connecting them to your computer over USB
     </para>
     <section>
       <title>
-       Updating TeleMega, TeleMetrum v2 or EasyMini Firmware
+       Updating TeleMega, TeleMetrum v2, EasyMega or EasyMini Firmware
       </title>
       <orderedlist inheritnum='inherit' numeration='arabic'>
        <listitem>
@@ -4327,6 +4605,20 @@ NAR #88757, TRA #12200
              </para>
            </listitem>
          </varlistentry>
+         <varlistentry>
+           <term>EasyMega</term>
+           <listitem>
+             <para>
+               Connect pin 6 and pin 1 of the companion connector. Pin 1
+               can be identified by the square pad around it, and then
+               the pins could sequentially across the board. Be very
+               careful to <emphasis>not</emphasis> short pin 8 to
+               anything as that is connected directly to the battery. Pin
+               7 carries 3.3V and the board will crash if that is
+               connected to pin 1, but shouldn't damage the board.
+             </para>
+           </listitem>
+         </varlistentry>
          <varlistentry>
            <term>TeleMetrum v2</term>
            <listitem>
@@ -4758,6 +5050,67 @@ NAR #88757, TRA #12200
        </listitem>
       </itemizedlist>
     </section>
+    <section>
+      <title>
+       EasyMega Specifications
+      </title>
+      <itemizedlist>
+       <listitem>
+         <para>
+           Recording altimeter for model rocketry.
+         </para>
+       </listitem>
+       <listitem>
+         <para>
+           Supports dual deployment and four auxiliary pyro channels
+           (a total of 6 events).
+         </para>
+       </listitem>
+       <listitem>
+         <para>
+           Barometric pressure sensor good to 100k feet MSL.
+         </para>
+       </listitem>
+       <listitem>
+         <para>
+           1-axis high-g accelerometer for motor characterization, capable of
+           +/- 102g.
+         </para>
+       </listitem>
+       <listitem>
+         <para>
+           9-axis IMU including integrated 3-axis accelerometer,
+           3-axis gyroscope and 3-axis magnetometer.
+         </para>
+       </listitem>
+       <listitem>
+         <para>
+           On-board 8 Megabyte non-volatile memory for flight data storage.
+         </para>
+       </listitem>
+       <listitem>
+         <para>
+           USB interface for battery charging, configuration, and data recovery.
+         </para>
+       </listitem>
+       <listitem>
+         <para>
+           Fully integrated support for Li-Po rechargeable batteries.
+         </para>
+       </listitem>
+       <listitem>
+         <para>
+           Can use either main system Li-Po or optional separate pyro battery
+           to fire e-matches.
+         </para>
+       </listitem>
+       <listitem>
+         <para>
+           1.25 x 1.25 inch board designed to fit inside 38mm air-frame coupler tube.
+         </para>
+       </listitem>
+      </itemizedlist>
+    </section>
     <section>
       <title>
        TeleMetrum v2 Specifications
@@ -5316,6 +5669,21 @@ NAR #88757, TRA #12200
        </mediaobject>
       </informalfigure>
     </section>
+    <section>
+      <title>EasyMega template</title>
+      <para>
+       EasyMega has overall dimensions of 1.250 x 2.250 inches, and
+       the mounting holes are sized for use with 4-40 or M3 screws.
+      </para>
+      <informalfigure>
+       <mediaobject id="EasyMegaTemplate">
+         <imageobject>
+           <imagedata format="SVG" fileref="easymega.svg"
+                      scalefit="0" scale="100" align="center" />
+         </imageobject>
+       </mediaobject>
+      </informalfigure>
+    </section>
     <section>
       <title>TeleMetrum template</title>
       <para>
@@ -5366,7 +5734,7 @@ NAR #88757, TRA #12200
       <title>Calibration</title>
       <para>
         There are only two calibrations required for TeleMetrum and
-        TeleMega, and only one for TeleDongle, TeleMini and EasyMini.
+        TeleMega, and only one for EasyMega, TeleDongle, TeleMini and EasyMini.
         All boards are shipped from the factory pre-calibrated, but
         the procedures are documented here in case they are ever
         needed.  Re-calibration is not supported by AltosUI, you must
@@ -5418,7 +5786,7 @@ NAR #88757, TRA #12200
        </para>
       </section>
       <section>
-        <title>TeleMetrum and TeleMega Accelerometers</title>
+        <title>TeleMetrum, TeleMega and EasyMega Accelerometers</title>
         <para>
           While barometric sensors are factory-calibrated,
           accelerometers are not, and so each must be calibrated once
@@ -5445,7 +5813,7 @@ NAR #88757, TRA #12200
         </para>
         <para>
          In the unlikely event an accel cal goes badly, it is possible
-         that TeleMetrum or TeleMega may always come up in 'pad mode'
+         that TeleMetrum, TeleMega or EasyMega may always come up in 'pad mode'
          and as such not be listening to either the USB or radio link.
          If that happens, there is a special hook in the firmware to
          force the board back in to 'idle mode' so you can re-do the
@@ -5465,12 +5833,19 @@ NAR #88757, TRA #12200
   <appendix>
     <title>Release Notes</title>
     <simplesect>
-      <title>Version 1.41</title>
+      <title>Version 1.4.1</title>
       <xi:include
          xmlns:xi="http://www.w3.org/2001/XInclude"
          href="release-notes-1.4.1.xsl"
          xpointer="xpointer(/article/*)"/>
     </simplesect>
+    <simplesect>
+      <title>Version 1.5</title>
+      <xi:include
+         xmlns:xi="http://www.w3.org/2001/XInclude"
+         href="release-notes-1.5.xsl"
+         xpointer="xpointer(/article/*)"/>
+    </simplesect>
     <simplesect>
       <title>Version 1.4</title>
       <xi:include
index 514db3eda660b98f93502aa021a311265384f4bb..09a83d16fa725574bc53dd9824939a5976ceb249 100644 (file)
Binary files a/doc/configure-altimeter.png and b/doc/configure-altimeter.png differ
index 9f836e710b88bc6881d212932fbd65530b4f3be7..9e3c98aaf0c350db8dd10583b8a7241f7d3e7266 100644 (file)
Binary files a/doc/configure-groundstation.png and b/doc/configure-groundstation.png differ
diff --git a/doc/easymega-outline.xsl b/doc/easymega-outline.xsl
new file mode 100644 (file)
index 0000000..5796f9c
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+  "/usr/share/xml/docbook/schema/dtd/4.5/docbookx.dtd">
+<article>
+    <title>EasyMega Outline and Hole Pattern</title>
+    <para>
+      This image, when printed, provides a precise template for the
+      mounting holes in EasyMega. EasyMega has overall dimensions
+      of 1.250 x 2.250 inches, and the mounting holes are sized for
+      use with 4-40 or M3 screws.
+    </para>
+    <informalfigure>
+      <mediaobject id="EasyMegaTemplate">
+       <imageobject>
+         <imagedata format="SVG" fileref="easymega.svg"
+                    scalefit="0" scale="100" align="center" />
+       </imageobject>
+      </mediaobject>
+    </informalfigure>
+</article>
+
+<!-- LocalWords: Altusmetrum
+-->
diff --git a/doc/easymega-v1.0-bottom.jpg b/doc/easymega-v1.0-bottom.jpg
new file mode 100644 (file)
index 0000000..be46f14
Binary files /dev/null and b/doc/easymega-v1.0-bottom.jpg differ
diff --git a/doc/easymega-v1.0-top.jpg b/doc/easymega-v1.0-top.jpg
new file mode 100644 (file)
index 0000000..4526f65
Binary files /dev/null and b/doc/easymega-v1.0-top.jpg differ
diff --git a/doc/easymega.svg b/doc/easymega.svg
new file mode 100644 (file)
index 0000000..6d9d766
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+
+<svg
+       xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   width="2.5in"
+   height="1.5in"
+   viewBox="0 0 250 150"
+   preserveaspectratio="none"
+   id="svg2"
+   version="1.1">
+  <g transform="translate(12.5,12.5)"
+     style="fill:none;stroke:#000000;stroke-width:1;stroke-linejoin:miter;font-size:24">
+    <!-- outline -->
+    <rect width="225" height="125" x="0" y="0"/>
+    <!-- holes -->
+    <path d="M12.5,12.5 m-6.25,0 a6.25,6.25,0,1,0,12.5,0 a6.25,6.25,0,1,0,-12.5,0 l12.5,0 m-6.25,-6.25 l0,12.5"/>
+    <path d="M212.5,12.5 m-6.25,0 a6.25,6.25,0,1,0,12.5,0 a6.25,6.25,0,1,0,-12.5,0 l12.5,0 m-6.25,-6.25 l0,12.5"/>
+    <path d="M12.5,112.5 m-6.25,0 a6.25,6.25,0,1,0,12.5,0 a6.25,6.25,0,1,0,-12.5,0 l12.5,0 m-6.25,-6.25 l0,12.5"/>
+    <path d="M212.5,112.5 m-6.25,0 a6.25,6.25,0,1,0,12.5,0 a6.25,6.25,0,1,0,-12.5,0 l12.5,0 m-6.25,-6.25 l0,12.5"/>
+    <!-- arrow -->
+    <path d="M50,62.5 l125,0"/>
+    <path style="fill:#000000;stroke:none" d="M175,57.5 l10,5 l-10,5 z"/>
+    <!-- label -->
+    <text x="112.5" y="57.5" style="fill:#000000;stroke:none" text-anchor="middle">EasyMega</text>
+    <g transform="rotate(90)">
+      <text x="62.5" y="-190" style="fill:#000000;stroke:none" text-anchor="middle">UP</text>
+    </g>
+  </g>
+</svg>
diff --git a/doc/release-notes-1.5.xsl b/doc/release-notes-1.5.xsl
new file mode 100644 (file)
index 0000000..50d83f7
--- /dev/null
@@ -0,0 +1,121 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
+"/usr/share/xml/docbook/schema/dtd/4.5/docbookx.dtd">
+
+<article>
+  <para>
+    Version 1.5 is a major release. It includes support for our new
+    EasyMega product, new features and bug fixes in in the flight
+    software for all our boards and the AltosUI ground station
+  </para>
+  <para>
+    AltOS New Features
+    <itemizedlist>
+      <listitem>
+       <para>
+         Add support for EasyMega boards.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+         Make the APRS SSID be configurable. This lets you track
+         different rockets on the same receiver without getting
+         things mixed up.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+         Report extra pyro channel continuity state on EasyMega and
+         TeleMega via the beeper. This lets you easily verify flight
+         readiness on these boards after powering up the electronics
+         on the rail.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+         Add lower telemetry data rates (2400 and 9600 bps) to
+         increase telemetry radio range. This reduces the amount of
+         data received as well as increasing battery consumption in
+         the transmitter.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+         Change TeleGPS to have only a single log, and append new
+         data to it rather than using seperate per-flight logs. This
+         avoids accidentally filling up log storage by turning
+         TeleGPS on/off several times.
+       </para>
+      </listitem>
+    </itemizedlist>
+  </para>
+  <para>
+    AltOS Fixes
+    <itemizedlist>
+      <listitem>
+       <para>
+         Increase the maximum range for altitude values from +/-32767m
+         to +/-2147483647m, allowing the flight computers to function
+         correctly above the 32km level.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+         Continuously test pyro firing conditions during delay stage,
+         inhibiting the pyro channel if the test fails. This prevents
+         firing pyro charges where the conditions were good before
+         the delay, but become bad before the delay expires.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+         Allow negative numbers in pyro configuration values. This
+         lets you specify things like descending speed or
+         deceleration.
+       </para>
+      </listitem>
+    </itemizedlist>
+  </para>
+  <para>
+    AltosUI and TeleGPS New Features
+    <itemizedlist>
+      <listitem>
+       <para>
+         Support telemetry baud rate selection. Adds menus to
+         the flight monitoring and configuration for baud rate
+         selection.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+         Support APRS SSID configuration.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+         Integrate with file managers. This provides icons for all of
+         our file types and associates our application with the files
+         so that using a file manager to open a AltOS data file
+         results in launching our application.
+       </para>
+      </listitem>
+    </itemizedlist>
+  </para>
+  <para>
+    AltosUI Fixes
+    <itemizedlist>
+      <listitem>
+       <para>
+         Make the 'Graph' button on the landed tab work again.
+       </para>
+      </listitem>
+      <listitem>
+       <para>
+         Make tests for Java on Windows a bit smarter, and also
+         provide the user with the option to skip installing Java for
+         cases where we just can't figure out what version is installed.
+       </para>
+      </listitem>
+    </itemizedlist>
+  </para>
+</article>
index bf6b6e53ea8f1d3e30d58e42fa464f1017140434..e45880cd9f10ddae5040843f8a38b82ec4a952f6 100644 (file)
Binary files a/doc/scan-channels.png and b/doc/scan-channels.png differ
index 8f519958ad350013671f0018fa0abae185ea7b6b..b9821a4237ab950caecebb6bac85defb30ccbff2 100644 (file)
  *
  *     M = 1, E = 3, bw = 75kHz
  *
- * 20.5 kHz deviation, 9.6kbps signal
+ * 5.125 kHz deviation, 9.6kbps signal
  *
- *     m = 41 / 9.6, which is < 5.5:
+ *     m = 10.25 / 9.6, which is < 5.5:
  *
- *     bw = 2.6 * 20.5 + 0.55 * 9.6 = 58.58kHz
+ *     bw = 2.6 * 5.125 + 0.55 * 9.6 = 18.6kHz
  *
- *     M = 2, E = 3, bw = 62.5kHz
+ *     M = 2, E = 3, bw = 53.6kHz
  *
- * 20.5kHz deviation, 2.4kbps signal
+ * 1.28125kHz deviation, 2.4kbps signal
  *
- *     m = 41 / 2.4, which is > 5.5:
+ *     m = 2.565 / 2.4, which is < 5.5:
  *
- *     bw = 2.1 * 20.5 + 1.9 * 2.4 = 47.61kHz
+ *     bw = 2.6 * 20.5 + 1.9 * 2.4 = 47.61kHz
  *
  *     M = 3, E = 3, bw = 53.6kHz
  *
@@ -84,7 +84,7 @@
  */
 
 #define CHANBW_M_384   1
-#define CHANBW_M_96    2
+#define CHANBW_M_96    3
 #define CHANBW_M_24    3
 #define CHANBW_E       3
 
  *
  * F = 24e6/2**17 * (8 + DEVIATION_M) * 2**DEVIATION_E
  *
- * So M is 6 and E is 3
+ * For 20.5kHz deviation, M is 6 and E is 3
+ * For 5.125kHz deviation, M is 6 and E is 1
+ * For 1.28125kHz deviation, M is 0 and E is 0
  */
 
-#define DEVIATION_M    6
-#define DEVIATION_E    3
+#define DEVIATION_M_384        6
+#define DEVIATION_E_384        3
+
+#define DEVIATION_M_96 6
+#define DEVIATION_E_96 1
+
+#define DEVIATION_M_24 0
+#define DEVIATION_E_24 0
 
 /*
  * For our RDF beacon, set the symbol rate to 2kBaud (for a 1kHz tone),
@@ -182,9 +190,6 @@ static __code uint8_t radio_setup[] = {
 
        RF_CHANNR_OFF,          0,
 
-       RF_DEVIATN_OFF,         ((DEVIATION_E << RF_DEVIATN_DEVIATION_E_SHIFT) |
-                                (DEVIATION_M << RF_DEVIATN_DEVIATION_M_SHIFT)),
-
        /* SmartRF says set LODIV_BUF_CURRENT_TX to 0
         * And, we're not using power ramping, so use PA_POWER 0
         */
@@ -284,8 +289,10 @@ static __code uint8_t fixed_pkt_setup[] = {
                                 RF_MDMCFG1_NUM_PREAMBLE_4 |
                                 (2 << RF_MDMCFG1_CHANSPC_E_SHIFT)),
 
-       RF_DEVIATN_OFF,         ((DEVIATION_E << RF_DEVIATN_DEVIATION_E_SHIFT) |
-                                (DEVIATION_M << RF_DEVIATN_DEVIATION_M_SHIFT)),
+#if !HAS_RADIO_RATE
+       RF_DEVIATN_OFF,         ((DEVIATION_E_384 << RF_DEVIATN_DEVIATION_E_SHIFT) |
+                                (DEVIATION_M_384 << RF_DEVIATN_DEVIATION_M_SHIFT)),
+#endif
 
        /* max packet length -- now set inline */
        RF_PKTCTRL1_OFF,        ((1 << PKTCTRL1_PQT_SHIFT)|
@@ -298,19 +305,34 @@ static __code uint8_t fixed_pkt_setup[] = {
 };
 
 #if HAS_RADIO_RATE
-static __code uint8_t packet_rate_setup[] = {
+static __code struct {
+       uint8_t         mdmcfg4;
+       uint8_t         deviatn;
+} packet_rate_setup[] = {
        /* 38400 */
-       ((CHANBW_E << RF_MDMCFG4_CHANBW_E_SHIFT) |
-        (CHANBW_M_384 << RF_MDMCFG4_CHANBW_M_SHIFT) |
-        (DRATE_E_384 << RF_MDMCFG4_DRATE_E_SHIFT)),
+       {
+               ((CHANBW_E << RF_MDMCFG4_CHANBW_E_SHIFT) |
+                (CHANBW_M_384 << RF_MDMCFG4_CHANBW_M_SHIFT) |
+                (DRATE_E_384 << RF_MDMCFG4_DRATE_E_SHIFT)),
+               ((DEVIATION_E_384 << RF_DEVIATN_DEVIATION_E_SHIFT) |
+                (DEVIATION_M_384 << RF_DEVIATN_DEVIATION_M_SHIFT)),
+       },
        /* 9600 */
-       ((CHANBW_E << RF_MDMCFG4_CHANBW_E_SHIFT) |
-        (CHANBW_M_96 << RF_MDMCFG4_CHANBW_M_SHIFT) |
-        (DRATE_E_96 << RF_MDMCFG4_DRATE_E_SHIFT)),
+       {
+               ((CHANBW_E << RF_MDMCFG4_CHANBW_E_SHIFT) |
+                (CHANBW_M_96 << RF_MDMCFG4_CHANBW_M_SHIFT) |
+                (DRATE_E_96 << RF_MDMCFG4_DRATE_E_SHIFT)),
+               ((DEVIATION_E_96 << RF_DEVIATN_DEVIATION_E_SHIFT) |
+                (DEVIATION_M_96 << RF_DEVIATN_DEVIATION_M_SHIFT)),
+       },
        /* 2400 */
-       ((CHANBW_E << RF_MDMCFG4_CHANBW_E_SHIFT) |
-        (CHANBW_M_24 << RF_MDMCFG4_CHANBW_M_SHIFT) |
-        (DRATE_E_24 << RF_MDMCFG4_DRATE_E_SHIFT)),
+       {
+               ((CHANBW_E << RF_MDMCFG4_CHANBW_E_SHIFT) |
+                (CHANBW_M_24 << RF_MDMCFG4_CHANBW_M_SHIFT) |
+                (DRATE_E_24 << RF_MDMCFG4_DRATE_E_SHIFT)),
+               ((DEVIATION_E_24 << RF_DEVIATN_DEVIATION_E_SHIFT) |
+                (DEVIATION_M_24 << RF_DEVIATN_DEVIATION_M_SHIFT)),
+       },
 };
 #endif
 
@@ -380,7 +402,8 @@ ao_radio_get(uint8_t len)
        RF_FREQ0 = (uint8_t) (ao_config.radio_setting);
        RF_PKTLEN = len;
 #if HAS_RADIO_RATE
-       RF_MDMCFG4 = packet_rate_setup[ao_config.radio_rate];
+       RF_MDMCFG4 = packet_rate_setup[ao_config.radio_rate].mdmcfg4;
+       RF_DEVIATN = packet_rate_setup[ao_config.radio_rate].deviatn;
 #endif
 }
 
index 1b907940f6f1d5104c13fa43da120f9dfc1b882e..3ea8b7044b4cecb25f1880f5be5a3b1bbfb066cd 100644 (file)
@@ -290,15 +290,32 @@ ao_radio_idle(void)
 }
 
 /*
- * Packet deviation is 20.5kHz
+ * Packet deviation
  *
  *     fdev = fosc >> 24 * (256 + dev_m) << dev_e
  *
+ * Deviation for 38400 baud should be 20.5kHz:
+ *
  *             32e6Hz / (2 ** 24) * (256 + 80) * (2 ** 5) = 20508Hz
+ *
+ * Deviation for 9600 baud should be 5.125kHz:
+ *
+ *             32e6Hz / (2 ** 24) * (256 + 80) * (2 ** 3) = 5127Hz
+ *
+ * Deviation for 2400 baud should be 1.28125kHz, but cc1111 and
+ * cc115l can't do that, so we'll use 1.5kHz instead:
+ *
+ *             32e6Hz / (2 ** 24) * (256 + 137) * (2 ** 1) = 1499Hz
  */
 
-#define PACKET_DEV_E   5
-#define PACKET_DEV_M   80
+#define PACKET_DEV_M_384       80
+#define PACKET_DEV_E_384       5
+
+#define PACKET_DEV_M_96                80
+#define PACKET_DEV_E_96                3
+
+#define PACKET_DEV_M_24                137
+#define PACKET_DEV_E_24                1
 
 /*
  * For our packet data
@@ -307,41 +324,55 @@ ao_radio_idle(void)
  *     Rdata = -------------------------------------- * fosc
  *                          2 ** 39
  *
+ * Given the bit period of the baseband, T, the bandwidth of the
+ * baseband signal is B = 1/(2T).  The overall bandwidth of the
+ * modulated signal is then Channel bandwidth = 2Δf + 2B.
+ *
+ * 38400 -- 2 * 20500 + 38400 = 79.4 kHz
+ *  9600 -- 2 * 5.125 +  9600 = 19.9 kHz
+ *  2400 -- 2 * 1.5   +  2400 =  5.4 khz
+ *
  * Symbol rate 38400 Baud:
  *
  *     DATARATE_M = 239914
  *     DATARATE_E = 9
- *     CHANBW = 74.42 (round to 100)
+ *     CHANBW = 79.4 (round to 100)
  *
  * Symbol rate 9600 Baud:
  *
  *     DATARATE_M = 239914
  *     DATARATE_E = 7
- *     CHANBW = 58.58 (round to 62.5)
+ *     CHANBW = 19.9 (round to 20)
  *
  * Symbol rate 2400 Baud:
  *
  *     DATARATE_M = 239914
  *     DATARATE_E = 5
- *     CHANBW = 47.61 (round to 50)
+ *     CHANBW = 5.0 (round to 8.0)
  */
 
 #define PACKET_DRATE_M 239914
 
 #define PACKET_DRATE_E_384     9
-#define PACKET_CHAN_BW_384     0x02    /* 200 / 2 = 100 */
+
+/* 200 / 2 = 100 */
+#define PACKET_CHAN_BW_384     ((0 << CC1120_CHAN_BW_CHFILT_BYPASS) | \
+                                (CC1120_CHAN_BW_ADC_CIC_DECFACT_20 << CC1120_CHAN_BW_ADC_CIC_DECFACT) | \
+                                (2 << CC1120_CHAN_BW_BB_CIC_DECFACT))
 
 #define PACKET_DRATE_E_96      7
-#define PACKET_CHAN_BW_96      0x42    /* 125 / 2 = 62.5 */
+/* 200 / 10 = 20 */
+#define PACKET_CHAN_BW_96      ((0 << CC1120_CHAN_BW_CHFILT_BYPASS) | \
+                                (CC1120_CHAN_BW_ADC_CIC_DECFACT_20 << CC1120_CHAN_BW_ADC_CIC_DECFACT) | \
+                                (10 << CC1120_CHAN_BW_BB_CIC_DECFACT))
 
 #define PACKET_DRATE_E_24      5
-#define PACKET_CHAN_BW_24      0x04    /* 200 / 4 = 50 */
+/* 200 / 25 = 8 */
+#define PACKET_CHAN_BW_24      ((0 << CC1120_CHAN_BW_CHFILT_BYPASS) | \
+                                (CC1120_CHAN_BW_ADC_CIC_DECFACT_20 << CC1120_CHAN_BW_ADC_CIC_DECFACT) | \
+                                (25 << CC1120_CHAN_BW_BB_CIC_DECFACT))
 
 static const uint16_t packet_setup[] = {
-       CC1120_DEVIATION_M,     PACKET_DEV_M,
-       CC1120_MODCFG_DEV_E,    ((CC1120_MODCFG_DEV_E_MODEM_MODE_NORMAL << CC1120_MODCFG_DEV_E_MODEM_MODE) |
-                                (CC1120_MODCFG_DEV_E_MOD_FORMAT_2_GFSK << CC1120_MODCFG_DEV_E_MOD_FORMAT) |
-                                (PACKET_DEV_E << CC1120_MODCFG_DEV_E_DEV_E)),
        CC1120_DRATE1,          ((PACKET_DRATE_M >> 8) & 0xff),
        CC1120_DRATE0,          ((PACKET_DRATE_M >> 0) & 0xff),
        CC1120_PKT_CFG2,        ((CC1120_PKT_CFG2_CCA_MODE_ALWAYS_CLEAR << CC1120_PKT_CFG2_CCA_MODE) |
@@ -361,6 +392,10 @@ static const uint16_t packet_setup[] = {
 };
 
 static const uint16_t packet_setup_384[] = {
+       CC1120_DEVIATION_M,     PACKET_DEV_M_384,
+       CC1120_MODCFG_DEV_E,    ((CC1120_MODCFG_DEV_E_MODEM_MODE_NORMAL << CC1120_MODCFG_DEV_E_MODEM_MODE) |
+                                (CC1120_MODCFG_DEV_E_MOD_FORMAT_2_GFSK << CC1120_MODCFG_DEV_E_MOD_FORMAT) |
+                                (PACKET_DEV_E_384 << CC1120_MODCFG_DEV_E_DEV_E)),
        CC1120_DRATE2,          ((PACKET_DRATE_E_384 << CC1120_DRATE2_DATARATE_E) |
                                 (((PACKET_DRATE_M >> 16) & CC1120_DRATE2_DATARATE_M_19_16_MASK) << CC1120_DRATE2_DATARATE_M_19_16)),
        CC1120_CHAN_BW,         PACKET_CHAN_BW_384,
@@ -368,6 +403,10 @@ static const uint16_t packet_setup_384[] = {
 };
 
 static const uint16_t packet_setup_96[] = {
+       CC1120_DEVIATION_M,     PACKET_DEV_M_96,
+       CC1120_MODCFG_DEV_E,    ((CC1120_MODCFG_DEV_E_MODEM_MODE_NORMAL << CC1120_MODCFG_DEV_E_MODEM_MODE) |
+                                (CC1120_MODCFG_DEV_E_MOD_FORMAT_2_GFSK << CC1120_MODCFG_DEV_E_MOD_FORMAT) |
+                                (PACKET_DEV_E_96 << CC1120_MODCFG_DEV_E_DEV_E)),
        CC1120_DRATE2,          ((PACKET_DRATE_E_96 << CC1120_DRATE2_DATARATE_E) |
                                 (((PACKET_DRATE_M >> 16) & CC1120_DRATE2_DATARATE_M_19_16_MASK) << CC1120_DRATE2_DATARATE_M_19_16)),
        CC1120_CHAN_BW,         PACKET_CHAN_BW_96,
@@ -375,6 +414,10 @@ static const uint16_t packet_setup_96[] = {
 };
 
 static const uint16_t packet_setup_24[] = {
+       CC1120_DEVIATION_M,     PACKET_DEV_M_24,
+       CC1120_MODCFG_DEV_E,    ((CC1120_MODCFG_DEV_E_MODEM_MODE_NORMAL << CC1120_MODCFG_DEV_E_MODEM_MODE) |
+                                (CC1120_MODCFG_DEV_E_MOD_FORMAT_2_GFSK << CC1120_MODCFG_DEV_E_MOD_FORMAT) |
+                                (PACKET_DEV_E_24 << CC1120_MODCFG_DEV_E_DEV_E)),
        CC1120_DRATE2,          ((PACKET_DRATE_E_24 << CC1120_DRATE2_DATARATE_E) |
                                 (((PACKET_DRATE_M >> 16) & CC1120_DRATE2_DATARATE_M_19_16_MASK) << CC1120_DRATE2_DATARATE_M_19_16)),
        CC1120_CHAN_BW,         PACKET_CHAN_BW_24,
index 5d24c49a4be946d84d1dfede605d07e827bda57f..943f344958fcf9337dc1daa6033d48c3733e55d4 100644 (file)
 #define CC1120_FREQ_IF_CFG     0x0f
 #define CC1120_IQIC            0x10
 #define CC1120_CHAN_BW         0x11
+#define  CC1120_CHAN_BW_CHFILT_BYPASS          7
+#define  CC1120_CHAN_BW_ADC_CIC_DECFACT                6
+#define  CC1120_CHAN_BW_ADC_CIC_DECFACT_20             0
+#define  CC1120_CHAN_BW_ADC_CIC_DECFACT_32             1
+#define  CC1120_CHAN_BW_BB_CIC_DECFACT         0
+
 #define CC1120_MDMCFG1         0x12
 #define  CC1120_MDMCFG1_CARRIER_SENSE_GATE     7
 #define  CC1120_MDMCFG1_FIFO_EN                        6
index b5103f9bec5edb5692f758062f37ce740eea7cc2..cf61acfe9c4ae45a6def0d88caf05c8d3d0dac96 100644 (file)
@@ -249,23 +249,41 @@ ao_radio_idle(void)
 }
 
 /*
- * Packet deviation is 20.5kHz
+ * Packet deviation
  *
  *     fdev = fosc >> 17 * (8 + dev_m) << dev_e
  *
+ * For 38400 baud, use 20.5kHz:
+ *
  *             26e6 / (2 ** 17) * (8 + 5) * (2 ** 3) = 20630Hz
+ *
+ * For 9600 baud, use 5.125kHz:
+ *
+ *             26e6 / (2 ** 17) * (8 + 5) * (2 ** 1) = 5157Hz
+ *
+ * For 2400 baud, use 1.5kHz:
+ *
+ *             26e6 / (2 ** 17) * (8 + 0) * (2 ** 0) = 1587Hz
  */
 
-#define PACKET_DEV_E   3
-#define PACKET_DEV_M   5
+#define PACKET_DEV_E_384       3
+#define PACKET_DEV_M_384       5
+
+#define PACKET_DEV_E_96                1
+#define PACKET_DEV_M_96                5
+
+#define PACKET_DEV_E_24                0
+#define PACKET_DEV_M_24                0
 
 /*
- * For our packet data, set the symbol rate to 38400 Baud
+ * For our packet data:
  *
  *              (256 + DATARATE_M) * 2 ** DATARATE_E
  *     Rdata = -------------------------------------- * fosc
  *                          2 ** 28
  *
+ * For 38400 baud:
+ *
  *             (256 + 131) * (2 ** 10) / (2**28) * 26e6 = 38383
  *
  *     DATARATE_M = 131
@@ -279,20 +297,33 @@ ao_radio_idle(void)
 #define PACKET_DRATE_E_96      8
 #define PACKET_DRATE_E_24      6
 
-static const uint16_t packet_rate_setup[] = {
-       [AO_RADIO_RATE_38400] = ((0xf << 4) |
-                                (PACKET_DRATE_E_384 << CC115L_MDMCFG4_DRATE_E)),
-
-       [AO_RADIO_RATE_9600] = ((0xf << 4) |
-                               (PACKET_DRATE_E_96 << CC115L_MDMCFG4_DRATE_E)),
-
-       [AO_RADIO_RATE_2400] = ((0xf << 4) |
-                               (PACKET_DRATE_E_24 << CC115L_MDMCFG4_DRATE_E)),
+static const struct {
+       uint8_t         mdmcfg4;
+       uint8_t         deviatn;
+} packet_rate_setup[] = {
+       [AO_RADIO_RATE_38400] = {
+               .mdmcfg4 = ((0xf << 4) |
+                           (PACKET_DRATE_E_384 << CC115L_MDMCFG4_DRATE_E)),
+               .deviatn = ((PACKET_DEV_E_384 << CC115L_DEVIATN_DEVIATION_E) |
+                           (PACKET_DEV_M_384 << CC115L_DEVIATN_DEVIATION_M)),
+       },
+
+       [AO_RADIO_RATE_9600] = {
+               .mdmcfg4 = ((0xf << 4) |
+                           (PACKET_DRATE_E_96 << CC115L_MDMCFG4_DRATE_E)),
+               .deviatn = ((PACKET_DEV_E_96 << CC115L_DEVIATN_DEVIATION_E) |
+                           (PACKET_DEV_M_96 << CC115L_DEVIATN_DEVIATION_M)),
+       },
+
+       [AO_RADIO_RATE_2400] = {
+               .mdmcfg4 = ((0xf << 4) |
+                           (PACKET_DRATE_E_24 << CC115L_MDMCFG4_DRATE_E)),
+               .deviatn = ((PACKET_DEV_E_24 << CC115L_DEVIATN_DEVIATION_E) |
+                           (PACKET_DEV_M_24 << CC115L_DEVIATN_DEVIATION_M)),
+       },
 };
 
 static const uint16_t packet_setup[] = {
-       CC115L_DEVIATN,         ((PACKET_DEV_E << CC115L_DEVIATN_DEVIATION_E) |
-                                (PACKET_DEV_M << CC115L_DEVIATN_DEVIATION_M)),
        CC115L_MDMCFG3,         (PACKET_DRATE_M),
        CC115L_MDMCFG2,         (0x00 |
                                 (CC115L_MDMCFG2_MOD_FORMAT_GFSK << CC115L_MDMCFG2_MOD_FORMAT) |
@@ -418,7 +449,8 @@ ao_radio_set_mode(uint16_t new_mode)
 
        changes = new_mode & (~ao_radio_mode);
        if (changes & AO_RADIO_MODE_BITS_PACKET_TX) {
-               ao_radio_reg_write(CC115L_MDMCFG4, packet_rate_setup[ao_config.radio_rate]);
+               ao_radio_reg_write(CC115L_MDMCFG4, packet_rate_setup[ao_config.radio_rate].mdmcfg4);
+               ao_radio_reg_write(CC115L_DEVIATN, packet_rate_setup[ao_config.radio_rate].deviatn);
 
                for (i = 0; i < sizeof (packet_setup) / sizeof (packet_setup[0]); i += 2)
                        ao_radio_reg_write(packet_setup[i], packet_setup[i+1]);
index d6c99cbd89defb62b07a2def1b7964f8be2f9df9..2354504981d6f09d3b51046d02fab1e300bc6b3a 100644 (file)
@@ -57,6 +57,12 @@ static __xdata uint16_t              ao_packet_master_time;
 #define AO_PACKET_MASTER_DELAY_LONG    AO_MS_TO_TICKS(1000)
 #define AO_PACKET_MASTER_DELAY_TIMEOUT AO_MS_TO_TICKS(2000)
 
+#if HAS_RADIO_RATE
+#define AO_PACKET_MASTER_RECV_DELAY    AO_MS_TO_TICKS(100) << (ao_config.radio_rate << 1)
+#else
+#define AO_PACKET_MASTER_RECV_DELAY    AO_MS_TO_TICKS(100)
+#endif
+
 static void
 ao_packet_master_busy(void)
 {
@@ -91,7 +97,7 @@ ao_packet_master(void)
                if (ao_tx_packet.len)
                        ao_packet_master_busy();
                ao_packet_master_check_busy();
-               ao_alarm(ao_packet_master_delay);
+               ao_alarm(AO_PACKET_MASTER_RECV_DELAY);
                r = ao_packet_recv();
                ao_clear_alarm();
                if (r) {