Updates to the build instructions, including programming, configuration and troubleshooting.

m17
Rob Riggs 2019-06-23 14:42:04 -05:00
rodzic e33bfef43b
commit 49a7d1f5ee
5 zmienionych plików z 169 dodań i 20 usunięć

Wyświetl plik

@ -6,10 +6,14 @@
"source": [
"# Nucleo TNC\n",
"\n",
"The Nucleo TNC is a breadboard implementation of the Mobilinkd TNC3 using a STM32L432KC Nucleo32 board. This TNC faithfully implements the audio section and EEPROM storage of the TNC3. It omits the battery charging and Bluetooth components of the TNC3. It presents as a KISS TNC over a USB serial port.\n",
"The Nucleo TNC is a breadboard implementation of the [Mobilinkd TNC3](https://store.mobilinkd.com/collections/frontpage/products/mobilinkd-tnc3) using a STM32L432KC Nucleo32 board. This TNC faithfully implements the audio section and EEPROM storage of the TNC3. It omits the battery charging and Bluetooth components of the TNC3. It presents as a KISS TNC over a USB serial port.\n",
"\n",
"The Nucleo TNC is a 1200 baud KISS TNC built using an inexpensive microcontroller board with great digital signal processing capabilities and very low power consumption. It's an open implementation of our commercial product, the TNC3, designed to encourage experimentation and learning in electronics and software engineering. It's a more advanced version of a [similar project we designed for the Arduino Nano](http://www.mobilinkd.com/2014/09/11/arduino-kiss-tnc/), which was based on our TNC1/TNC2 product.\n",
"\n",
"The Nucleo TNC can be assembled for about $25 in parts, assuming you already have a breadboard and hookup wire. The bill of materials and the equipment needed to build and use the TNC are provided below in the *Bill of Materials* and *Equipment* sections, respectively.\n",
"\n",
"Please joing the [Mobilindk Community](https://groups.io/g/mobilinkd) on groups.io to share your builds and for help troubleshooting and using it. Send us pictures of your breadboards. We would love to see your builds!\n",
"\n",
"This project is intended for amateur radio operators from beginners to advanced. If you want to just dive in to building it without understanding the theory of operations, start at the overview and skip to the BOM and Assembly Instructions. For those who wish to understand the theory of operation from an electrical perspective, we start with the *Schematic* and *Theory of Operation* sections after a brief overview.\n",
"\n",
"And for those who wish to understand the digital signal processing involved in this project, please refer to the [AFSK Demodulator](https://github.com/mobilinkd/afsk-demodulator/blob/master/afsk-demodulator.ipynb) tutorial which outlines the basics of how the demodulator is constructed. You can also refer to the source repository for the firmware.\n",
@ -85,6 +89,7 @@
"APRS - Automatic Packet Reporting System. A packet radio system invented by Bob Bruninga, WB4APR.\n",
"BBS - Bulletin Board System. An online interactive computer system common before the advent of the Internet.\n",
"DAC - digital to analog converter. An electronic component that converts digital numbers to analog voltages.\n",
"DMM - digital multimeter. A piece of test equipment used to check voltage, current, resistance, continuity, and possibly other electrical characteristics of electronic components and circuits.\n",
"EEPROM - electrically-erasable programmable read-only memory. An integrated circuit for semi-permanent data storage.\n",
"I2C - a two-wire digital communications bus used by integrated circuits for inter-chip communication. It contains a clock line (SCL) and a data line (SDA). https://en.wikipedia.org/wiki/I%C2%B2C\n",
"KISS - Acronym for *Keep it Simple, Stupid*. A type of TNC defined by a minimal control interface. This is in contrast to other modems that have a full human-readable command language.\n",
@ -112,6 +117,8 @@
" * Audio output processing.\n",
" * The STM32 microcontroller board.\n",
" \n",
"A KiCAD project for the Nucleo TNC used to generate this schematic can be found at the [Nucleo TNC GitHub repository](https://github.com/mobilinkd/NucleoTNC) in the `KiCAD` directory.\n",
"\n",
"## Theory of Operation\n",
"\n",
"In this section we will discuss all of the section at least briefly, but will focus most of the attention on the audio input and output sections and the PTT circuitry.\n",
@ -200,7 +207,7 @@
"\n",
"The audio input circuit starts with a DC-blocking capacitor and a programmable DC-offset section required to set the proper DC bias for the audio section. This programmable DC offset is required because there is an additional component of the audio input circuit that is not apparent in the schematic. There is a built-in programmable gain amplifier (PGA) in the MCU that is used and this requires varying DC offsets depending on the gain selected. The gain is selectable from 0dB, 6dB, 12dB, 18db, & 24dB.\n",
"\n",
"The input voltage is limited via two Schottkey diodes and then fed into a buffer. The audio is fed through a 3-pole Bessel anti-aliasing filter with a cut-off of 7200Hz. This is then fed into the PGA and ADC of the MCU.\n",
"The input voltage is limited via two Schottky diodes and then fed into a buffer. The audio is fed through a 3-pole Bessel anti-aliasing filter with a cut-off of 7200Hz. This is then fed into the PGA and ADC of the MCU.\n",
"\n",
"There are a number of components in this subsection:\n",
"\n",
@ -250,6 +257,10 @@
"\n",
"The microcontroller can run at up to 80MHz. For this project we will run the MCU at 48MHz, which is still more than we really need.\n",
"\n",
"The source code for the firmware running on the board can be downloaded from the [Nucleo TNC GitHub repository](https://github.com/mobilinkd/NucleoTNC).\n",
"\n",
"A detailed discussion of the demodulator implementation can be found here: [AFSK Demodulator Tutorial](https://github.com/mobilinkd/afsk-demodulator/blob/master/afsk-demodulator.ipynb) \n",
"\n",
"## Bill of Materials\n",
"\n",
"To build this project, you will need the following items:\n",
@ -311,9 +322,10 @@
"\n",
"In order to build and test the Nucleo TNC, you will need:\n",
"\n",
" * A digital multimeter (DMM).\n",
" * An amateur radio license.\n",
" * A 2-meter VHF amateur radio.\n",
" * A computer running Linux.\n",
" * A computer (preferably running Linux).\n",
" * Either a home-made cable to connect the radio to the TNC or a cable from https://store.mobilinkd.com/collections/tnc-cables\n",
" * A dummy load and a cable to connect the radio to the dummy load.\n",
" * An external antenna, that can be mounted well away from the breadboard.\n",
@ -327,7 +339,6 @@
"\n",
" * An extra 2M radio.\n",
" * An RTL-SDR (Ultra-cheap SDR).\n",
" * A digital multimeter (DMM).\n",
" * An oscilloscope.\n",
" * A signal generator.\n",
"\n",
@ -354,6 +365,8 @@
"\n",
"Note that the breadboard is labelled with rows 1-63 and columns a-j. We will be using these to align the parts to the board.\n",
"\n",
"If you or anyone else may have used the breadboard for other projects before, take the time now to verify that all of the components and jumper wires have been removed from the board.\n",
"\n",
"<DIV style=\"background-color: #ffffce\">\n",
"Assemble the Nucleo TNC on a well-grouned anti-static mat and wear a grounding wrist strap when assembling the board. The Nucleo board, the ICs and the MOSFETs are static-sensitive devices and can be damaged by static discharge from your body that you cannot feel.\n",
"</DIV>\n",
@ -369,6 +382,8 @@
"\n",
"Install the Nucleo board, EEPROM and quad op-amp as shown. Note the orientation of the components.\n",
"\n",
"Before inserting the Nucleo board into the breadboard, plug the Nucleo board into your computer with the USB cable that you will be using and verify that it powers on. Verify that you see both a serial port and a mass storage device on your computer. And verify that the red LED labelled LD2 is on. Do not proceed until this is working. Once the Nucleo board, USB cable and your computer configuration is confirmed to be working, disconnect the TNC from the USB device and proceed with the build.\n",
"\n",
" * The Nucleo board starts at row 1. Insert the board pins into columns *d* and *h*. Orient the board so that the USB port is nearest row 1, so that it is easily accessible.\n",
" * Insert the 24LC32 EEPROM into rows 21-24, columns *e* and *f*, with pin 1 on row 21.\n",
" * Insert the MCP6004 quad op amp into rows 32-38, columns *e* and *f*, with pin 1 on row 38. Note that this is the opposite orientation of the EEPROM.\n",
@ -414,6 +429,29 @@
"![Step 3](AssemblyStep3.png)\n",
"The NucleoTNC with the power and ground rails connected.\n",
"\n",
"----\n",
"\n",
"<DIV style=\"background-color: #ffffce\">\n",
"Be gentle with the Nucleo board's USB connector. It can be damaged if too much force is used to insert or extract the USB cable, or if the USB cable is forcefully moved when it is plugged into the device.\n",
"</DIV>\n",
"\n",
"You will need a DMM to verify that the board is powered correctly. If any of the diagnostic steps below fail, verify all of the above steps.\n",
"\n",
"While the USB cable is disconnected:\n",
"\n",
" * Verify that there is continuity between upper and lower ground rails.\n",
" * Verify that the upper power rail and the ground rails are not shorted.\n",
"\n",
"Plug in the USB cable to the Nucleo board.\n",
"\n",
" * Verify that the red LED labelled LD2 on the Nucleo board is on.\n",
" * Verify that there is at least 4.5V on the 5V pin of the Nucleo board (refer to the board layout above).\n",
" * Verify that there is at least 3.2V on the 3.3V pin of the Nucleo board.\n",
" * Verify that there is at least 3.2V on the upper power rail.\n",
"\n",
"When complete, disconnect the USB cable from the Nucleo board. It is helpful to run through this diagnostic process after each of the steps below. That way if a power fault is introduced, you know where it happened and can limit the search area for the cause.\n",
"\n",
"\n",
"### LEDs\n",
"\n",
"**Parts Required:**\n",
@ -433,11 +471,6 @@
"\n",
"Test the LEDs by connecting the Nucleo to USB power and use a jumper wire to connect the cathode of each LED to ground. Verify that the LED lights up. When done, disconnect the USB cable from the Nucleo board and remove the jumper wire used in the test.\n",
"\n",
"----\n",
"<DIV style=\"background-color: #ffffce\">\n",
"Be gentle with the Nucleo board's USB connector. It can be damaged if too much force is used to insert or extract the USB cable, or if the USB cable is forcefully moved when it is plugged into the device.\n",
"</DIV>\n",
"\n",
"![Step 4](AssemblyStep4.png)\n",
"The NucleoTNC with the LEDs assembly complete. The LEDs provide visual indication of transmit and receive.\n",
"\n",
@ -486,6 +519,8 @@
"![Step 6](AssemblyStep6.png)\n",
"The NucleoTNC with the PTT assembly complete.\n",
"\n",
"Run through the [Power and Ground](#Power-and-Ground) diagnostics again.\n",
"\n",
"### EEPROM Connections\n",
"\n",
"**Parts required:**\n",
@ -511,11 +546,13 @@
"\n",
"The next two steps are the most involved, as we will be constructing the audio input and output filters.\n",
"\n",
"Run through the [Power and Ground](#Power-and-Ground) diagnostics again.\n",
"\n",
"### Audio Input Circuitry\n",
"\n",
"**Parts required:**\n",
"\n",
" * 2 BAT85S Schottkey diodes.\n",
" * 2 BAT85S Schottky diodes.\n",
" * 1 220nF capacitor.\n",
" * 1 33nF capacitor.\n",
" * 1 1nF capacitor.\n",
@ -546,6 +583,8 @@
"![Step 8](AssemblyStep8.png)\n",
"The NucleoTNC with the audio input section assembled.\n",
"\n",
"Run through the [Power and Ground](#Power-and-Ground) diagnostics again.\n",
"\n",
"### Audio Output Circuitry\n",
"\n",
"**Parts required:**\n",
@ -584,6 +623,8 @@
"![Step 9](AssemblyStep9.png)\n",
"The NucleoTNC with the audio output section assembled. Note that there is a jumper from *d37* to *d38* hidden underneath the 100kΩ resistor.\n",
"\n",
"Run through the [Power and Ground](#Power-and-Ground) diagnostics again.\n",
"\n",
"### Wiring\n",
"\n",
"This is the final step in wiring up the breadboard TNC. For this step, we are simply using jumper wires to connect the Nucleo board to the various inputs, outputs and control likes of the circuitry we just built.\n",
@ -602,13 +643,20 @@
"![Step 10](AssemblyStep10.png)\n",
"The completely assembled NucleoTNC.\n",
"\n",
"Run through the [Power and Ground](#Power-and-Ground) diagnostics again.\n",
"\n",
"## Programming\n",
"\n",
"Programming is fairly simple. When you plug the Nucleo board into your computer, a new drive (mount point) will appear. Programming is done by simply copying the firmware file into this new mount point.\n",
"\n",
"## Testing & Troubleshooting\n",
"Connect a USB cable from your computer to the Nucleo board. Be careful with the USB connector on the Nucleo board. When connected, it should enumerate a number of devices including a removable storage device and a serial port. For programming, we care about the removable storage device. On Windows this should appear as a drive letter. On Linux, this should be mounted somewhere like `/run/media/{USER}/NODE_L432KC`. And it should appear as a folder on your MacOS desktop.\n",
"\n",
"Download the `firmware.bin` file from the Mobilinkd GitHub site: https://github.com/mobilinkd/NucleoTNC/releases/tag/v1.0.0\n",
"\n",
"Copy the `firmware.bin` file to the Nucleo removable storage device. You should see the multi-color LED near the USB connector on the Nucleo flash while it is programming.\n",
"\n",
"That's all there is to it. The Nucleo TNC is now operational!\n",
"\n",
"After the TNC starts up\n",
"\n",
"## Operation\n",
"\n",
@ -617,18 +665,119 @@
"----\n",
"<DIV style=\"background-color: #ffffce\">\n",
"<span style=\"font-weight: bold\">Do not tranmit RF near the Nucleo TNC.</span> Use a dummy load when testing and use an external antenna that is mounted well away from the TNC when operating the TNC on the air. The long wires used in the assembly of the TNC, and the breadboard itself can act as antennas and will conduct RF energy into the TNC components and any equipment you have attached to it, including your computer. This may cause the TNC to misbehave and can potentially damage your equipment.\n",
" \n",
"Also, when not using a dummy load, it is your responsibility to avoid interfering with others and to announce your callsign. Use an unused channel, announce that you will be testing, perform the tests, then announce that you are done using the frequency.\n",
"</DIV>\n",
"\n",
"----\n"
"----\n",
"\n",
"The Nucleo TNC presents as a serial port and must be used with the following serial parameters:\n",
"\n",
" * 38400 baud, 8N1\n",
"\n",
"### Radio Configuration\n",
"\n",
"The configuration of your radio is important. If you are using an HT, go through the settings and turn everything off that can be turned off. Power saver settings and VOX must be turned off. If you are using a Baofeng or other cheap Chinese radio, turn off dual receive, squelch tail elimination, etc. In general, everything that can be turned off should be turned off.\n",
"\n",
"A note about cheap radios. Most of the cheap radios flooding the market as of late do not work well for general packet use. The problem is turn-around time -- the time it takes from turning off the transmitter to until the receiver can hear anything. A good radio has a turn-around time in the 10s of milliseconds. To be useful for packet radio, it cannot be much more than 100ms. Most of these cheap radios have turn-around times in the hundreds of milliseconds. Most Boafeng radios are in the 300ms range, which is unusable. You will miss the response from the remote end.\n",
"\n",
"These radios are adequate for running an APRS tracker, where you just want to beacon your position. The radio will probably miss the first digipeated response but you may not care about that.\n",
"\n",
"\n",
"### TNC Configuration\n",
"\n",
"For this step you will need a computer running Linux (preferrablY), MacOS or Windows.\n",
"\n",
"Plug the Nucleo board into the computer. Note the serial port address (/dev/tty device or COM port) assigned byt the operating system. On Linux this is often /dev/ttyACM0. On MacOS you should see /dev/cu.usbmodemXXXXX (where the X's are some number). On Windows it will be a COM port.\n",
"\n",
"#### Download Config App\n",
"\n",
"Download the Mobilinkd Config App for Linux/MacOS/Windows (TncConfigApp) for serial port.\n",
"\n",
"There is a Windows installer here: https://mobilinkd.s3.amazonaws.com/TncConfigApp-1.0.2-amd64.msi\n",
"\n",
"Note that on Windows, this installation may interfere with the RFCOMM version of the Mobilindk Config app for the Mobilinkd Bluetooth TNCs.\n",
"\n",
"Otherwise, for Linux and MacOS, download the source from our GitHub repository: https://github.com/mobilinkd/tnc1-python-config/archive/v1.0.1.tar.gz and follow the build instructions in the README.md file.\n",
"\n",
"\n",
"#### Connect to the TNC\n",
"\n",
"Run the Config App. Ensure you are running the *Serial Port Variant* of the app. Select the serial port from the dropdown menu and press \"Connect\".\n",
"\n",
"![TncConfigApp Connect](TncConfigApp-Connect.png)\n",
"\n",
"#### Check the TNC Information\n",
"\n",
"Once connected, go to the *TNC Information* screen and verify that you are connected to the breadboard TNC. If you do not see any information here, go to the [Testing and Troubleshooting](#Testing-and-Troubleshooting) section.\n",
"\n",
"![TncConfigApp Info](TncConfigApp-Info.png)\n",
"\n",
"#### Adjust the Audio Input Levels\n",
"\n",
"Connect the radio to the TNC. Tune to an unused frequency. Open the squelch on the radio.\n",
"\n",
"Go to the *Audio Input* section and configure the audio. An unused channel should have static noise on it. For an HT, the audio gain on the TNC should be set to 0, and the audio volume on the radio should be adjusted so that the right-most element in the bar graph flickers.\n",
"\n",
"If you are connecting the TNC to a mobile radio's data port and the output level is too low to cause the last LED to flicker, adjust the input gain until the desired level is reached. If it is still down a few bars, it should still work fine.\n",
"\n",
"If you do not see any activity in the bar graph, go to the [Testing and Troubleshooting](#Testing-and-Troubleshooting) section.\n",
"\n",
"The audio input twist should generally be set to 6 for an HT and most mobile radios. If connected to the discriminator input of a radio (no de-emphasis), set the twist to 0.\n",
"\n",
"![TncConfigApp Input](TncConfigApp-Input.png)\n",
"\n",
"#### Adjust the Audio Output Levels & PTT\n",
"\n",
"For this, you will need another radio (a receiver) tuned to the same frequency as the radio connected to the TNC. An RTL-SDR is inexpensive and works well for this.\n",
"\n",
"Go to the *Audio Output* section of the config app to configure the PTT style and output levels.\n",
"\n",
"Select the correct PTT signalling method. Mobile radios and hand-held radios with a Kenwood connector use Simplex PTT signalling. Most other hand-held radios use Multiplex PTT signalling. If you don't know, experiment to find the right one. Select the PTT signalling method and press the *Transmit* button. The radio should transmit a test tone. You should see the transmit indicator on the radio light up and you should hear the test tone in the other radio.\n",
"\n",
"If one PTT style does not work, try the other.\n",
"\n",
"To set output volume level, set the tone to 2200Hz and adjust the volume until the tone no longer increases in volume. For most hand-held radios this will be pretty low (in the 30s or 40s). Drop the volume level another 10%. \n",
"\n",
"In general, the output twist should be set to \"50\", the midway point.\n",
"\n",
"If you cannot trigger PTT or do not hear any audio, go to the [Testing and Troubleshooting](#Testing-and-Troubleshooting) section.\n",
"\n",
"![TncConfigApp Output](TncConfigApp-Output.png)\n",
"\n",
"\n",
"## Testing & Troubleshooting\n",
"\n",
"The most common cause of problems with any such project is that a part is not placed correctly, either in the wrong breadboard location or reversed if polarized, or the miswired. Review all of the build steps. Verify component and wiring placement.\n",
"\n",
"Please joing the [Mobilindk Community](https://groups.io/g/mobilinkd) on groups.io tfor help troubleshooting and using your Nucleo TNC.\n",
"\n",
"We are going to walk through the fault tree to narrow down the location of the problem.\n",
"\n",
"The Nucleo32 board has three LEDs on it which will be used for diagnostics.\n",
"\n",
" * USB communication (LD1)\n",
" * Power LED (LD2)\n",
" * User LED (LD3)\n",
"\n",
"The first step is always to check power and ground.\n",
"\n",
"### Power and Ground Troubleshooting\n",
"\n",
"**Does the board have power?**\n",
"\n",
"Refer to the board layout here: https://os.mbed.com/platforms/ST-Nucleo-L432KC/\n",
"\n",
"Run through the [Power and Ground](#Power-and-Ground) diagnostics again.\n",
"\n",
"Given the number of times we ran through this process in the build, there should be no problem with the power and ground rails. If there is, it is generally because something has shorted out. Check the two areas of concern in the input and output circuitry.\n",
"\n",
"Verify that your USB port is capable of delivering 500mA.\n",
"Verify that your USB cable is still in good condition. If in doubt, try another one.\n",
"\n",
"\n"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 24 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 35 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 31 KiB

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 35 KiB