PSK31 Audio Beacon Kit

Build this programmable single-chip generator of PSK31-encoded audio data streams and use it as a signal generator, a beacon input to your SSB rig — or as the start of a single-chip PSK31 controller!

Version 2, July 2001

Created by the New Jersey QRP Club

The NJQRP “PSK31 Audio Beacon Kit” 1 PSK31 Audio Beacon Kit OVERVIEW Here’ an easy, fun and intriguingly use- ting at a laptop equipped with DigiPan Thank you for purchasing the PSK31 phase relationships at bit transitions, and ful project that has evolved from an on- software. Zudio Beacon from the New Jersey QRP the schematic has been augmented with going design effort to reduce the complex- Club! We think you’ll have fun assem- Construction is simple and straightfor- helpful notations. ity of a PSK31 controller. bling and operating this inexpensive-yet- ward and you’ll have immediate feedback For the very latest information, software flexible audio modulator as PSK31-en- A conventional PC typically provides on how your Beacon works when you updates, and kit assembly & usage tips, coded data streams. the relatively intensive computing power plug in a 9V battery and speaker. please be sure to see the PSK31 Beacon required for PSK31 modulation and de- This project was first introduced as a kit Beacon Features website at http://www.njqrp.org/ modulation. at the Atlanticon QRP Forum in March psk31beacon/psk31beacon.html . Visit Single-chip implementation of 2001, and then published in a feature ar- soon and often, as it’s guaranteed to be With this Beacon project, however, the PSK31 encoding and audio waveform gen- ticle of QST magazine in its August 2001 helpful! PSK31 modulation computations have eration. issue. Since these initial public exposures, been designed to fit into a small PIC-like We really hope you find this Manhattan- several new capabilities have been added microcontroller that can serve as the ba- n Audio PSK31 tones presented to an style Homebrewing Starter Kit useful in in “version 2” of the microcontroller soft- sis for the transmit half of a standalone audio amp for use with a user-supplied getting started in your first copper-clad ware. This kit embodies this new soft- PSK31 controller. speaker for use in group activities. board project. It’s a fun, quick and flex- ware and describes how to use the new ible way to bring your favorite designs to A fast and inexpensive microcontroller n Lower level signal available from chip features. has been programmed to generate an au- life! suitable for input to an SSB transmitter And lastly, there were a few typographi- dio data stream using the PSK31 algo- George Heron, N2APB for operation as an RF beacon. cal errors in the QST article that have been rithms. The data-driven audio waveform email: [email protected] corrected in this kit. Most notably, the is fed to an amplifier IC that drives a n Scenix SX28 RISC microcontroller for the NJQRP Club graphics depicting the PSK31 waveform speaker - and voila, the familiar and me- operating at 50 MHz with 20ns instruc- at http://www.njqrp.org encoding now properly indicate waveform lodious PSK31 warble is able to be heard! tion cycle time provides computing power When presented as input to a PSK31 re- necessary for accurate implementation of PARTS LIST ceiving system such as DigiPan, these the PSK31 modulation algorithm. The SX U1 SX28AC/DP Scenix microcontroller, 50 MHz modulated audio tones are decoded and chip is similar to Microchip’s popular PIC U2 LM386 amplifier the programmed beacon string is dis- U3 MAX232CPE Dual RS232 transceiver microcontroller, containing the same soft- Y1 50 MHz ceramic resonator, Murata 250-05060 played. ware instruction set but operating over SKT-1 28-pin IC socket A keyboard or data terminal may also 40 times faster. SKT-2 8-pin IC socket serve as the input of real-time textual data n SX28 microcontroller is programmed SKT-3 16-pin IC socket to the PSK31 Audio Beacon. A standard VR1 7805V voltage regulator, 1A with a unique beacon string, or accepts RS-232 serial interface is provided in the C3 0.1 uF ceramic (“104”) real-time text input from an RS-232 serial hardware and software to allow a more C4,C5,C6,C24,C26 .01 uF ceramic (“103”) interface. C20,C21,C22,C23,C25 1 uF electrolytic, 25V (longer lead is positive) dynamic “signal generator” use of the C7 10 uF electrolytic, 25V (longer lead is positive) project. n Configuration jumpers provide for se- C8 47 uF electrolytic, 25V (longer lead is positive) The project can be electrically con- lection of three base carrier frequencies C9 100 uf electrolytic, 25V (longer lead is positive) nected to the input of an SSB transmitter (500 Hz, 1 KHz, or 2 KHz), and choice R1,R2 10-ohm of 8 sub-variations around the selected R4 10K potentiometer to create an RF PSK31 beacon. base frequency. This allows the user to R5,R6,R7.R8,R9,R10,R11,R12,R13 10K This project is also ideally suited for operate the Beacon on any of 24 distinct R14,R15,R16,R17,R18,R19,R20,R21,R22 20K groups wishing to have some “audio bea- R3,R4 100K audio frequencies. con” fun during meetings. A number of R23 470K J1 9V battery terminal clip club members would operate their audio n Configuration jumper provides for J2 9-pin RS232 -style serial connector beacons while someone attempts success- Beacon operation in a continuous loop or PC Board ful copy of the beacon strings while sit- as a single pass when a pushbutton is

2 The NJQRP “PSK31 Audio Beacon Kit” The NJQRP “PSK31 Audio Beacon Kit” 3 actuated. tance between the Beacon and the laptop, signals up and down the band. You will in the beacon operates at 50 MHz clock adjacent QRM (other Beaconers), etc. quickly learn the wrath of others seeing rate, providing an instruction cycle time Source code and inexpensive devel- n “Points” are awarded to all Beacons for your callsign and email address transmit- of 20 nanoseconds. This fast operation opment tools allow custom modification the degree of solid copy captured to the ted over and over. enables precise control of signal genera- of the beacon string and/or software op- DigiPan log during that 15 minute period. tion and phase reversals to produce stable eration. Secondly, even in the case of perfect (You can see a photo of this excitement in signal quality, very careful attended op- and accurate carrier modulation at the au- n Construction may be done Manhat- the “Up Front” section of July QST. The eration needs to be done when using this dio baseband frequencies. A 50 MHz ce- tan-style (a form of ugly-style construc- photo was taken at the Atlanticon QRP Beacon project with an RF transmitter. ramic resonator is used with the on-board Forum held last spring.) oscillator to provide a fast and simple tion) for freedom of desired implementa- There should be no interference whatso- tion. A printed circuit board is also avail- This all may may sound complex, but ever to any other communication on the controller solution to the generation of PSK31 encoding. able for this project when purchased as a it’s really quite simple — build the Bea- band, and even while in the CONTINU- kit from the NJQRP Club. con, turn it on and see how well it can be OUS mode of operation, the Beacon Carrier Generation: “-2R DAC” copied by DigiPan. Each contestant could should be stopped periodically to deter- There are numerous ways to generate a “What Can I Do with a PSK31 Audio Beacon? actually do this during the test phase at mine if other signals are present. sine wave suitable for use in communica- As mentioned, the Beacon may be used home prior to the club event. Never leave the beacon on for continu- tions systems, and each has advantages and trade-offs. A discrete chip sine wave as the basis for a fun group “contest” ac- Putting the Beacon on the Air ous, unattended operation! Unattended tivity for your club. All contestants would Projects can be fun in a group activity, beacon operation is illegal in the FCC’s generator or a separate digital to analog converter (DAC) could have been used, turn their beacons on and gather around a but the PSK31 Audio Beacon has lasting eyes, and you would not be able to deter- laptop running the DigiPan application. value for the PSK31 enthusiast. The au- mine if other signals are present in the but it was desired to keep both hardware complexity and cost to a minimum. Laptops generally have built-in micro- dio tones generated by the Beacon can be area of you transmissions. phones that would be used to decode the presented as input to any SSB transmit- Another popular method used in gen- audio PSK31 tones “in the air” ... and ter — a Warbler, PSK-20, PSK-40, or even CIRCUIT DESCRIPTION erating a sine wave is to pulse width modu- with over 100 beacons warbling simulta- a Yaesu FT-1000MP. Thus, a PSKer can late (PWM) a square wave on an output neously, there will certainly be audio tones easily put a beacon signal on the air for all Refer to the Schematic at the center of bit of the microcontroller and then low in the air! the same reasons that CW beacons are this manual for the following discussion. pass filter the signal with an R/ network. Recall that each Beacon’s used (.., studies of propagation, power This method requires too much use of levels, antenna characteristics, etc.) DC Power Input precious interrupt time in the processor. microcontroller is customized with a The kit provides a standard battery clip callsign and is run on slightly different Special care must be exercised on two with which the user can connect a 9V bat- A simple technique was ultimately cho- frequencies. One Beacon may have its counts, however. tery. Any DC voltage from about 9-12V sen to generate the carrier - the “R-2R tones centered at 978 Hz, while another First, the audio level driving an SSB may be used, as the 3-pin regulator VR1 DAC”. This digital to analog converter may have it’s tones at 1050 Hz. This transmitter needs to be extremely low drops the input voltage down to the re- incorporates a ladder network of 15 re- spreading out of Beacon signals will help compared to the output levels provided quired 5V for the microcontroller. sistors whose nodes are fed by an 8-bit when multiple beacons are placed in ser- by the Beacon Kit. Most certainly, the parallel output port of the microcontroller. vice at the same time within close geo- Current consumption of the Beacon The values of the resistors in the network LM386 audio amplifier output that drives circuitry is nominally about 80ma, so the graphic proximity. the Beacon’s speaker should not be used are 10K- and 20K-ohms, hence the R-2R regulator will naturally get a little warm nomenclature. The cumulative weighting Okay, so you’ve got the picture of a when feeding a transmitter. One should whole bunch of club members amassed take the output of the R-2R DAC and Note: If an SX-Key programmer is con- of these R-2R resistors in the ladder ulti- mately produces an output voltage at the around a table with an operator sitting at put it through a voltage divider pad (or nected to the Beacon (allowing the laptop running DigiPan, right? Within potentiometer) to bring the 0-to-4.5V sine reprogrammability of the microcontroller) top of the ladder corresponding to the desired analog voltage. Thus all the soft- a specified period of time, the idea is to wave signals down to the millivolt range a TO220-packaged 1A voltage regulator see how many of the Beacons can be cop- required by an SSB transmitter. The lower such as the LM7805 should be used due ware needs to do is present the desired sine wave values in sequence to the out- ied (callsign & code word), as captured the better! If the transmitter is over- to the overall higher current demands of put port at precise time intervals. When by DigiPan. Factors involved in success- driven, all sorts of problems occur with the programmer. smoothed with a capacitor, the resultant ful reception include the settings of the the transmitted RF spectrum – terrible Scenix SX28 microcontroller waveform at the top of the resistive lad- audio amp, the type of speaker, the dis- IMD, distortion, and interference to other The Scenix SX28 microcontroller used

4 The NJQRP “PSK31 Audio Beacon Kit” The NJQRP “PSK31 Audio Beacon Kit” 5 der is a clean sine wave. tinuous transmit mode, or in One-Time string that was put there initially at Audio Amplifier transmit mode. SOFTWARE DESCRIPTION power-up time. But since RAM data The output of the R-2R DAC is ac- a) Continuous transmit is selected by memory is volitile (i.e., contents are lost coupled to the input of a common LM386 installing configuration jumper X7, thus Beacon String Construct when board power is removed), the cus- audio amplifier through a potentiometer instructing the beacon software to auto- The Beacon software is programmed tom-entered text string is only present to provide continuous adjustability of the matically restart the beacon transmit se- to transmit two types of data in sequence: while the power is applied. If power is audio volume. quence (idle and pre-programmed data 1) Idle Stream - Upon transmit initia- cycled, the custom text string must be string), tion, the Beacon sends a series of 64 ze- applied again to overwrite the pre-pro- This amplifier provides significant gain grammed string. and quite nicely drives a small speaker. ) One-Time transmit is selected by ros to allow the PSK31 receiving system and decoder to synchronize for the data The way to initiate the entry of a cus- Configuration Jumpers removing the configuration jumper from X7. The transmit sequence is initiated reception that follows. In some PSK31 tom text string is by having the X7 (CON- Five user-installable configuration applications this idle stream time allows TINUOUS) jumper in place and holding jumpers (X2-X6) instruct the software by manual actuation of the STARTpushbutton, upon which the idle the decoding software to measure signal down the START pushbutton when ap- to produce one of 24 distinct carrier fre- “IMD”, an indication of energy present plying power to the board. You also must quencies that will ultimately be phase- stream and pre-programmed data string are sent. The beacon stops transmitting in adjacent sidebands and somewhat of a have the X0 jumper in place to signify modulated at 31 baud. Input pins of the figure of merit for the received signal. use of the serial COM port. A convenient SX microcontroller are used to read the at the end of the data string and awaits either another STARTpushbutton actua- 2) Data String - Immediately following way to switch the Beacon into this serial- status of these configuration jumpers. entry mode is to wire the X7 and START These input pins have weak internal pull- tion. the idle stream of zeros, the Beacon be- gins sending the data string that will ulti- lines to a DPDT toggle switch that would up resistors and float “high” when un- Serial Input Mode ground the respective input lines when connected. However, when grounded by Jumper X1 instructs the software to mately be displayed on the receiving side of the communications channel. This is this mode is desired. The X0 input line putting a jumper in place, the pin reads use a fixed-time interrupt loop, thus al- could also be put to a SPDT switch to be “low” and signals the software to take lowing the UART routine send and re- the custom-programmed sequence of ASCII characters. The data string may be grounded for use of the serial port. (Two specific action in configuring the Beacon’s ceive serial data with the external termi- separate switches are recommended for frequency. nal/computer. It may be convenient to use of any length, and is limited only by avail- able memory. reasons explained in the section concern- Another jumper (X1) instructs the soft- a SPST toggle switch for this configura- ing Direct Character Transmission mode.) tion line, as it would only be used when The SX chip provided in this kit comes ware to set a specific interrupt timing that Interrupt Timing permits the software UART in the SX inputting a custom beacon string or when pre-programmed wih the information transmitting keyboard data character-by- specified in the inital ordering process. For this part of the discussion, it will chip to communicate over the RS232 se- be assumed that the configuration jump- rial line with an external computer. This character. The switch would be open other This beacon string is “burned” into the times during automatic Beacon transmis- program memory and is tranferred to in- ers are set to produce a 500 Hz carrier mode is used for custom beacon string frequency, with a nominal interrupt vari- entry or character-by-character sending sion. ternal RAM memory when power is ap- plied. Whenever the START pushbutton ability of 4 (X2 jumper in place for an of data. Custom String Entry Mode RTCC reload value of 197.) is actuated or the CONTINUOUS jumper Carrier Frequency Selection The way to initiate entry of a custom text string is by having the X7 (CON- put in place, the string in RAM memory The PSK31 Audio Beacon software is a) Base Carrier Selection Jumpers - Two is encoded and audibly transmitted. completely interrupt-driven, based on the jumpers allow user to configure beacon TINUOUS) jumper in place and holding down the START pushbutton while ap- Entering Custom Beacon Strings timeout settings of the real time clock carrier signal to any of three frequencies: (RTCC). The default setting of the RTCC 500 Hz, 1 KHz, or 2 KHz. plying power to the board. (You also must One may alternatively enter a different have the X0 jumper in place to signify text string directly to RAM memory over counter produces an interrupt every b) Carrier Offset Jumpers - Three ad- use of the serial COM port, as described the RS-232C serial COM port provided 3.94us and the Interrupt Service Routine ditional jumpers allow user to select one above). A convenient way to switch the on the Beacon board. A separate com- (ISR) counts two of these interrupts and of 8 closely-spaced frequencies around Beacon into this serial-entry mode is to puter would typically be used to send then signals the presence of a 7.88us in- terval by setting the SYNC7US software the chosen base carrier wire the X7 and START lines to a DPDT this new text string to the Beacon. The flag. This flag is inspected in a tight loop Transmission Mode: Continuous toggle switch that would ground the re- new text is entered character-by-charac- at the MAIN starting point of the pro- or One-Time spective input lines when this mode is ter into RAM data memory, effectively gram, and when detected as being set, the The Beacon may operate in either Con- desired. overwriting the pre-programmed text

6 The NJQRP “PSK31 Audio Beacon Kit” The NJQRP “PSK31 Audio Beacon Kit” 7 whole program sequence begins. much more spectrally clean. Creating the Carrier Sine Wave A cosine wave look-up table is used to Every 4th time the 7.88us window modulate (or “scale”) the carrier wave, starts (i.e., at the 31.25us boundaries), sample by sample at the 31.25us rate. the software gets the next 8-bit value from The cosine table pointer is advanced as the sine wave look-up table and outputs each cycle of the carrier is generated. it to the DAC output port RB. When If the “next bit” of the varicode charac- this process happens 64 times (i.e., when ter to be processed is a “0”, the scaling 64 instances of the 31.25us windows have process is turned on at mid-bit position occurred) a single sine wave will have been and the remaining 7 carrier cycles of wave- constructed within a 2ms time period, form construction occurring in the bit- creating a 500 Hz carrier. processing window get scaled per the co- The software keeps track of how many sine look-up table. This effectively brings carrier cycles have been generated, and the amplitude of those seven sine waves when the count reaches 15 (i.e., at the progressively down to zero, at which 31ms interval), the PSK bit window is point the phase of the carrier is reversed present and the PSK bit processing be- (by changing to a different sine wave look- gins. up table — one that is 180-degrees out of Actually, the recurring 31ms window phase from the other one.) starts at mid-position of one bit cycle and After the phase reversal, the carrier Figure 1: Oscilloscope trace of 31.25 ms timing window (square wave on channel 1) superimposed on the modulated 500 Hz carrier wave on channel 2. goes to mid-position of the next bit cycle. continues to be constructed at every Note phase shifts at the zero-crossings, indicating two successive logical 0’s in It’s done this way so the software can 31.25us interval, and the cosine scaling is the digital bitstream. inspect the current / next bit relationship still engaged in sync with the carrier and command a zero-power phase rever- cycles. For the next seven cycles, the co- cur. The power is then raised in the fol- oscilloscope properly synchronized at the sal condition at the next end-bit time pe- sine look-up table routines scale up the lowing 7 cycles of the next window. start of the character sequence. riod, if required. carrier such that the carrier is back to full Encoding a “” It’s useful at this point to mention that power (no scaling) by mid-bit position. Creating the Phase Reversals Using the PSK31 encoding algorithm two (or more) consecutive “zeros” con- The bits constituting the Varicode char- All this can be more easily understood for phase reversals (i.e., insert a phase stitute a letter gap, thus instructing the acter being sequentially presented for by considering the oscilloscope screen reversal whenever encountering a “0” in decoding engine on the receiving side to modulation are inspected on a bit-by-bit photo in Figure 1 on the next page. the bit stream), we can begin to consider start another character processing cycle. basis at each 31ms bit processing win- what a composite sequence of bits will Here we see 15 cycles of the 500 Hz In the diagram below, a letter gap of 0- dow. When a “1” is encountered, nothing look like for an entire character. carrier constituting a 31ms bit-process- 0 starts off the “T” sequence of bits. is done in that window. The sine wave ing window. The sequence of characters In this example, we’ll look at the letter Upon encountering each “0”, the power construction continues processed were two sequential zeros – “T”, which has a Varicode equivalent bit level is brought down to zero and the However when a “0” is encountered, the first being encoded in the phase rever- pattern of 1101101. The sketch in Figure phase is reversed. The power level is then the rules of PSK31 modulation state that sal seen zt the zero-power point on the 2 illustrates what one would see with an a phase reversal must be forced in the left, and the second on the right. These carrier. points are where the sine wave look-up The processing gets a little more com- tables are changed, resulting in the obvi- plicated at this point because we want to ous phase reversals. It can also be seen reduce the power of the carrier at the time that the cosine “scaling” of the carrier of phase reversals. This action greatly starts at mid position in the bit-process- reduces the “glitch” energy at the time of ing window and proceeds to zero at the the reversals and makes the resultant tones end of the cycle where the reversals oc- Figure 2: Varicode “T” waveform

8 The NJQRP “PSK31 Audio Beacon Kit” The NJQRP “PSK31 Audio Beacon Kit” 9 raised back up to 100% by mid-next po- Achieving the 16 frequency variations speaker, the START pushbutton, the J1 sition, whereupon the “next bit” is in- around each of the three base carrier fre- BASIC ASSEMBLY battery clip, spected to see if another reversal will be quencies is achieved by slightly varying Before inserting the IC’s to their sock- needed. the basic underlying interrupt timing There’s really not too much to assem- ets, apply power to the circuit and en- Upon encountering the first “1”, the mechanism. bling this project – it’s really just a couple sure that the “” (output) pin of VR1 algorithm dictates that no phase reversal The Real Time Clock Counter (RTCC) of IC’s and a handful of resistors and ca- reads 5V DC. occurs, so the power level remains at 100$ is clocked by the master 50 MHz oscilla- pacitors mounted on a printed circuit card. Turn off power and insert the ICs to (no cosine scaling). tor internal to the microntroller. Interrupts All you’ll need to do is to assemble the their respective sockets. Ensure that pin The same happens again upon encoun- are generated when the RTCC “rolls over” circuits according to the Schematic and 1 of each IC corresponds to the Layout tering the second “1”, but the next bit upon a countdown from a preset value, Parts Layout diagrams, plug the chips into diagram. after that is a “0” and the power level is and the governing mechanism for inter- the sockets, connect a DC power source rupt timing is to preset the RTCC counter and a speaker, and the Beacon should With all off board components con- reduced in anticipation of the coming nected, you can apply DC power again phase reversal. at the end of each interrupt cycle. The work. No dreaded toroids to wind, no nominal value of the RTCC preset is alignment … no muss, no fuss! and depress the START pushbutton (or One can easily see these principles in place the CONTINUOUS jumper in “200”, and we can go as much as +/- 8 The top of the actual pc board is noted action in the oscillosope trace in figure 3. counts before receiving systems lose syn- place). You should hear a relatively loud The phase reversals can be seen at the “Component Side”. Start by inserting the PSK31 warble tone coming from the chronization with the master 31 baud IC sockets into their respective holes. point where the power is reduced to zero, system timing in the Beacon. speaker for the duration of the beacon which is at the bit-processing intervals Carefully solder all pins in pace on the transmission. Adjust R4 for an accept- (31ms). The square wave superimposed Therefore, RTCCvariable is set to a bottom side of the pcb. able volume level. above and below the carrier is the 31ms value between 194 and 209 within the Next solder the J2 DB-9 connector in setRTCC routine based on the state of The “acid test” of your success will be sync signal present on the Test Point of place.Be sure to solder the heavy tabs to power up a computer running DigiPan the processor (bit 3 of port RA.) It can the configuration jumpers X0-through- that will protrude through the two large X3. These four bits give 16 different or other PSK31 program and present the be clearly seen how the current/next bit holes in the pcb, as this will give the con- Beacon audio as input to the computer. processing is actually done at the mid-bit RTCC preset values that modify the ba- nector strength. sic system timing of the beacon, which Many computers and most laptops have position, halfway through the 31ms pe- Next install the resistors. All resistors a built-in speaker that allow the tones to riod window results in an ability to more precisely position the base carriers within about +/ will be mounted in the “upright” posi- be “heard” by the program. Your beacon’s Producing Different Frequency - 60 Hz around their nominal values. tion, as noted in the sketch on the Layout warble should be visible on-or-around one Carriers diagram. Although there is no silkscreen of the base frequencies on the waterfall The preceding discussion assumed a The last comment about the software de- on the pcb to denote precise location of display: 500 Hz, 1 KHz or 2 KHz. Place 500 Hz carrier and a core interrupt time sign is that I make extensive use of the components, carefully matching up the the cursor on that displayed signal and of 3.94us. With a little software magic, look-up table (LUT) capabilities of the hole patters to the Layout diagram should you should see your Beacon’s pro- some variability was placed into the pro- SX microcontroller. Using the LUTs, we allow an easy install of the resistors. grammed sequence displayed in the text are able to easily generate two 64-point gram in order to produce two more base Install the 3-terminal voltage regulator, portion of the display. Experiment with carrier frequencies, and 16 sub-variations sine waves — a positive-going one the jumpers to see and hear the flexibility SINETBP and a negative going one VR1. This component should be around each base frequency. mnounted so it can be bent over parallel available in your Beacon’s frequency set- (SINETBN) – and a 64 point half cosine tings. The interrupt structure and timing is waveform (COSTBL). Using a pointer to to the pcb and about 1/8” off the board. actually designed to produce a 2 KHz travel through each table allows easy re- Although it will get a little warm during In Case of Trouble carrier as the highest base frequency, us- trieval of the waveform values which rep- operation, no heatsink will be required. If you had any problems in the Check- ing a 7.88us sine wave construction. Then, resent a 0-to-1 percentage of the 5 bit Install all remaining components: ca- out step, you should first re-check for based on the state of the configuration values represented in the tables. pacitors, the 3-terminal resonator Y1, and proper voltages, proper IC orientations jumpers, we’re able to sample at half-rates the potentioment R4. in the sockets, and good solder joints. to get the 15.75us rate for 1 KHz carrier When the Beacon is running, the Test generation, and 31.25us rate for 500 Hz Carefully wire all off-board compo- Point will be a continuous 15 Hz square carrier generation. nents to their respective pads, following wave (31ms high, 31ms low) that can be the Layout diagram. This includes the seen as a voltage bouncing around between

10 The NJQRP “PSK31 Audio Beacon Kit” The NJQRP “PSK31 Audio Beacon Kit” 11 2-to-3 volts on a DC voltmeter. If you you entered is “volitile” and will be lost panion to this Beacon modulator chip, example photos, etc … http://www/ have an oscilloscope, you should see the upon removal of board power. In this which will then serve as a complete mo- njqrp.org/psk31beacon/ PSK31 waveforms at the output of the event, the Beacon will revert back to the dem for a standalone PSK31 controller! psk31beacon.html DAC, as indicated on the schematic. You pre-programmed string. REFERENCES 7. See the Official PSK31 website for a will also see a relatively constant 2.4V Using the Serial COM Line for 1. Scenix programming tools, manuals, robust listing of PSK31-related articles, reading at this same point when using a Character-by-Character Trans- parts and other technical information: technology descriptions, etc. Located DC voltmeter. The PTT pad will be at 5V mission 2. Parallax — http:// at http://www.psk31.html during transmission and at 0V when the Whenever the Beacon is quiet, it is www.parallaxinc.com … tools, eval Special thanks are due to our club techni- Beacon is stopped. Current consumption waiting for an event at the “top” of the boards, programmers, parts cal advisors Joe Everhart N2CX and Dave of the Beacon is nominally about 80ma. program. Normal events are the START Benson NN1G, for their generous sup- Using the Serial COM Line for button being actuated or the CONTINU- 3. Ubicom (formerly Scenix) – http:// port during the development of this Custom Beacon String Entry OUS jumper X7 being put in place. www.ubicom.con project. You can next check out the capability Another event that triggers transmis- 4. SXTECH – http://www.sxtech.com Copyright - The PSK31 Audio Beacon of entering a custom beacon string. sion is data coming over the RS232 serial 5. SX Forum – http://www.sx- hardware and software was designed by The serial channel is set for 19,200 bps, COM line. In this case the character re- forum.com George Heron, N2APB. Copyright 2001, no parity, 8 bits of data, and 1 stop bit ceived is immediately encoded and trans- 6. Beacon Kit online information all rights reserved. Any portion of the (“N-8-1”). Your external computer ter- mitted out to the speaker/MIC. hardware or software may be reproduced minal should be set in this way also. website, containing source code, manual Buffering of characters is not accom- revisions, kit notes, tips & techniques, for personal and non-profit use provided As described previously, put the X1 plished in the current version of Beacon this credit is included in derivative work. jumper in place to signal Serial Mode. software - you must be careful to type Put the X7 (CONTINUOUS) jumper slowly so as to not send a keyboard im place and hold down the START characeter before the current character is pushbutton while turning on the power completely transmitted. This 31 baud rate to the board. will seem slow at first but one is quickly able to adjust the typing speed. Future The terminal program running on the versions of the Beacon software will pro- computer will display a “:” () char- vide a buffering of input characters to acter to prompt you to begin string data enable “type-ahead”. entry. Again, as in the case of the Custom You may enter up to 64 characters from Beacon String Entry mode, you must en- the keyboard, or you may terminate the sure that the computer terminal program string with the ENTER key before 64 is set for 19,200 bps, no parity, 8 bits of characters have been entered. data, and 1 stop bit (“N-8-1”). The upon string entry completion, the You must also ensure that the Serial software will immmediately start trans- Mode jumper X1 is in place. mitting the new beacon string (because the CONTINUOUS jumper is in place). Summary You may remove that jumper and use the Even if you haven’t yet made the START puhsbutton to initiate another plunge into on-the-air PSK31 operation, Here’s one of the prototype PSK31 Beacon printed circuit boards in the process of being programmed with the “SX Key” cable connected to the string transmit. this project gets you in the air with audio warbles that can be used for club fun as development PC. Note the DB9 serial connector and MAX232 driver chip at You may also set or remove any jump- well as for test and alignment purposes the left of the board providing serial communication with the PC during Beacon use. An electrolytic is mounted in an unusual manner over the ers to shift the carrier frequency of the on the workbench. Beacon as previously described. LM386 audio amp on the right - the final layout of the pcb provided in the kit Stay tuned for a single-chip demodu- brings this cap down to the board. Don’t forget that the new beacon string lator design in progress to serve as a com

12 The NJQRP “PSK31 Audio Beacon Kit” The NJQRP “PSK31 Audio Beacon Kit” 13 This is how the DigiPan screen looks when receiving an audio PSK31 Bea- This is a view of a typical “development environment”, simply consisting of an con signal via the computer’s sound board (e.g., through the laptop’s built- integrated editor/assembler/programmer/debugger from Ubicom, the supplier of in microphone). Note the characteristic dual-tone “railroad track” signal the SX chips. Once the program is entered or modified, the user selects the Run during the leading zeros sent for synchronization, and its relatively clean menu option as shown which initiates the assembly operation. If there are no indication of -36 dB IMD. DigiPan displays the incoming PSK31 signal in the errors in the program, an automatic chip programming sequence is initiated with receive window, showing the pre-programmed data string used in the the target board through the SX Blast or SX Key cable, and the program is then run auhor’s prototype. on the target. Overall time for this assemble/program/run operation is about 15 seconds.

14 The NJQRP “PSK31 Audio Beacon Kit” The NJQRP “PSK31 Audio Beacon Kit” 15 do want them to be heard by someone. ate frequency for the class of the Beacons may simply be an unwelcome operator’s license. Abuse of this will be very evident to any government monitor- APPENDIX A intruder to others. Only shorts periods ing station or ARRL Official Observer. Programming the SX28 Microcontroller of operation should be limited to only that short period of time when it will do Another important consideration in cou- some good without being and annoyance. pling this PSK31 Audio Beacon with an Developing software programs for the To use this simple development environ- Similarly, it is extremely impolite to just SSB transmitter is the audio drive level Ubicom/Scenix SX-xx series of ment, just connect the serial cable and SX plop it on the air willy-nilly and let it feeding the transmitter. The design of this microcontrollers is a fun and relatively Blitz combo to your project board, and transmit for extended periods when band project accommodated a high level audio simple process. The only tool needed is enter your assembly language source code activity is high. Its use to judge propaga- power amp in order to drive a speaker, called the “SX Blitz Programmer”, which of your program (or load the supplied tion is questionable when a band is highly however this speaker drive level is far in is a small 1" 1/2" board that fits on the source code file audiopsk31v1.src” from populated; simply “reading the mail” on excess of the proper drive level for a trans- end of a standard DB-9 serial cable com- the ARRL website). Then select the menu existing signals gives much the same in- mitter. You should at least use the direct ing from a PC. The other end of the SX item “Program” which assembles your formation. output of the R-2R DAC as the input to Blitz plugs into the a 4-pin header on the source code file and programs the target Then, too, at least on the HF bands, run- the transmitter, and your will likely even target project board (i.e., our PSK31 Au- SX chip all in one quick operation. The need to pad it further with a potentiom- dio Beacon). The CD-ROM that comes SX Blitz board sells for $79 from Paral- ning a long duration beacon is not a legal activity. Only on VHF and higher (in the eter. The “splash” caused by overdriving with the SX Blitz contains a combined lax, and full details can be seen on their US) can one run a full-time beacon and an SSB transmitter with these audio tones editor/Assembler/programmer applica- SXTECH web page at then only under certain conditions. To causes severe side channel energy and in- tion that is used to “burn” your custom www.parallaxinc.com/html_files/sxtech/ remain legal one has to constantly moni- terference to others near your frequency. software into the flash memory of the sxtech_home.htm. Other SX tools are tor the operating frequency to ensure that Either use an oscilloscope (looking at the SX device. also available that provide valuable in-cir- no interference is caused by the beacon RF signal) to determine if you are over cuit debugging capabilities (using the SX- modulating the transmitter, or get on-the- Key) as well as demo and evaluation and operation must cease if such interfer- ence is likely to occur. This means that air reports from others while backing off boards. there must be a full-time operator moni- the drive level until an acceptable signal is toring the frequency for the duration of being transmitted. beacon operation. Continuous or unat- While you want your beacon to be re- APPENDIX B tended operation is clearly illegal and will ceivable, you really should not interfere likely gain the FCC’s attention in addi- with normal operations on a given fre- Warbler’s Guide to Considerate Beaconing tion to arousing ire on the part of other quency. It is in extremely band form (as by Joe Everhart, N2CX band occupants. some CW beacon operators have found) Operating a beacon can truly be fun. One bands are like limited access parkland to To ensure legality the beacon must use a to run a beacon exactly on a frequency can determine antenna performance, which we are granted access so long as we valid callsign for operation and any trans- commonly in use for other purposes. This propagation characteristics, effects of dif- use them properly. Other licensed hams missions must take place on an appropri- ferent power levels, etc. However it’s not want to enjoy them too and we must keep something done every day and many will that in mind so that we don’t lessen their never use a beacon on the air. But if you pleasure by our use of the bands. After do couple your PSK31 Audio Beacon all, you wouldn’t play baseball in the with an SSB transmitter, here are some middle of a picnic ground and picnickers guidelines for considerate beacon usage. are unlikely to spread their lunch out on a ball field! Any use of a transmitter to radiate a sig- nal should be done with courtesy in mind. As mentioned, beacons are not an every- The electromagnetic spectrum is like real day tool. When they are put on the air estate – it’s a limited resource that we it’s for a specific purpose — often to gauge share with others. And the radio amateur signal propagation. This means that we

16 The NJQRP “PSK31 Audio Beacon Kit” The NJQRP “PSK31 Audio Beacon Kit” 17 mastered instruction set which has only EPROM technology and can only be pro- 33 commands. These devices are so pow- grammed once in the normal molded plas- APPENDIX C erful and flexible that they can be used to tic package (called OTP, for one time pro- Scenix SX Microcontroller – An Overview perform logic and control functions that grammable). Development parts use a would be literally impractical to do with ceramic package with quartz windows for A comparison of Microchip PIC to the Scenix SX microcontroller with discrete components and logic arrays. At erasing the program memory with UV some historical details the same time, the smaller parts can be light energy. As each new version of the by Allan Owen, WA3OWT easily programmed to perform simple software is written, it is assembled or control logic that can cost effectively re- compiled and the written into the pro- Many people know of Microchip’s and complexity in the line of parts from place the same capability of a handful of gram memory to test and evaluate. To PIC16xx series of chips, but not as many Microchip, beginning at the low end with TTL or CMOS logic IC’s. The parts are change it then, you must erase the old are aware of the heart of this project — the 16 series, the intermediate 17 series made with a modern CMOS semiconduc- code from memory, by flooding the chip the Scenix SX microcontroller (MCU). and the high end 18 series. These devices tor process which provides the designer with UV light energy for 20 to 30 min- Very similar in internal construction, fea- had different internal control word lengths with many choices of operating condi- utes, and then electrically writing in the tures and software instruction set, the and memory array sizes, but in general, tions. One being high speed operation, new program, referred to as “burning” the “SX” offer tremendous speed improve- the low end 16 series had smaller memory by using a fast clock oscillator for system EPROM memory. This software devel- ments over the PIC – the SX is about 40 available for both the control program timing, to obtain fast logic signal response, opment method has been used with small times faster! Because of this speed ad- ROM (read only memory) and the inter- or conversely, very low power operation, micro-controllers in embedded systems vantage, the SX is able accomplish real nal stored data RAM (random access by using a slow clock oscillator, where since the early days of microprocessors time control and signal processing that memory). this option would offer a low current drain, about 30 years ago, and it is still face- begins rivaling the domain of DSP chips. and long battery life in portable applica- tiously referenced as the “burn and learn” A typical early low end device, such as tions. method. But first, since so many of us are familiar the popular 16C54 had, for example, an with the PIC series of MCUs, let’s ap- Electrically Programmable Read Only But now we come to some of the impor- Flash memory of today’s MCU’s has proach the Scenix SX overview in the form Memory (EPROM) size limit of 512 tant differences between the MCUs of become very useful in rapid development of a comparison to the PIC. words of 12 bits each. So the control Microchip and Scenix. Most notably, the projects where frequent software changes program would be limited to 512 words. 50-, 75- and even 100-MHz clock speed require lots of reprogramming. The flash Microchip has provided us with a vari- The internal RAM for storing data was capability of the Scenix SX far exceeds parts allow very quick reprogramming, ety of very useful programmable MCU limited to 25 bytes. The I/O port lines that of the Microchip PIC, which will actually writing over the old program us- that can be used to design or replace elec- available to connect signals to the outside run at most at 20 MHz. (The original ing electrical signals, and then electrically tronic logic and other kinds of control cir- “flash” memory version of the PIC, the reprogramming the data into EPROM cuits. An MCU is an integrated control- world, numbered 12 in total. The part was mounted in an 18 pin Dual In-line Pack- 16C84 and later revised into a 16F84, can memory. All of the Scenix parts are made ler plus memory and I/O peripherals. For only be run as high as 10 MHz.) Newer with easily reprogrammed flash memory, many applications in electronic logic and age (DIP) or the smaller surface mount equivalent. Higher capacity parts with versions of PICs, having larger flash which is electrically erasable or controls the computational requirements more resources were offered in larger pack- memory have become available, and they rewriteable, for the program as well are not extensive and the MCU, will do ages, such as the 16C55 with 20 I/O lines do run up to 20 MHz, but both the origi- as turning on or off many other chip fea- just fine — this is where the small PIC in a 28 pin DIP. Also more program and nal ‘C84 and ‘F84 versions are still very tures such as the oscillator speed, code devices really excel. data memory is available in the 16C56 popular. protection, brown out detection and other In fact the “PIC” name that Microchip and ’57, with 1K words of program space, Programming internal memory and load- items. This is the same EEPROM or flash has given to their parts is an acronym for 25 bytes of data, and 2K words of pro- ing program can be accomplished using a memory technology available in the Mi- the words Programmable Interface Con- gram, 72 bytes of data, respectively. serial data loading mode supported by a crochip ’84 and most later parts. troller, a suitable title if ever there was Larger memory arrays became available few IC pins, so it is possible for both The Parallax company in Rocklin, Cali- one. These devices are small 8 bit self- in later series parts. manufacturers to use a special in-circuit fornia, developed an amazing product contained microcomputers with CPU, Even though memory resources are quite programming circuit design, allowing fast called the Basic Stamp using these early program memory, data storage and Input/ limited, a lot of control can be done with and easy program loading. The PIC pro- PIC MCUs as the control device. In fact Output (I/O) functions built in. There these small controllers using the easily gram memory of these original parts is they made a small single in-line (SIL) pc were originally three levels of capability

18 The NJQRP “PSK31 Audio Beacon Kit” The NJQRP “PSK31 Audio Beacon Kit” 19 board with voltage regulator, micro-con- tecture is Von Neuman which has one Then a few years ago, we hear from Scenix there are almost no differences of signifi- troller with clock oscillator, memory and combined memory that freely mixes the in Santa Clara California. They announce cance between the two manufacturers’ I/O lines. This self-contained board had program commands with the data. In fact availability of a new MCU that is com- parts. everything built and ready to use and at a everything looks like one big memory ar- patible with the Microchip PIC but op- The software code is compatible too, as very attractive price of around $30. It ray. This computer architecture may ap- erates faster, at up to a 50 MHz clock, the new Scenix parts will run the same op operated from a 9 volt transistor radio pear to be simpler than Harvard type, and even for a time, they advertised a 100 codes and commands as the correspond- battery for hours. You could communi- because the CPU treats everything includ- MHz clock speed version of the part. ing Microchip PIC. The same instruction cate directly with it by using a special ing I/O in the same way, just like memory, This grabs the interest of circuit and em- execution speed is available up to 20 MHz cable connected to your PC and it was and in fact most mainframes and mini- bedded system designers and some pc clock, in “compatibility mode”. The SX programmed to respond to a specialized computers are structured this way, with board designers quit and run off to Mexico. parts will run at the much faster clock and limited version of Basic. This popu- claims that cost reduction is afforded by But Parallax likes it and uses it to increase oscillator speeds too, or down to the low lar and easy to use, high level language this approach. The penalty of course, is the performance of the Basic Stamp prod- speed clock, in power saving mode. In was stored in a separate non-volatile that the CPU needs to unscramble the ucts. The Scenix parts are so much faster addition to the fast clock, the SX can run memory IC, outside the micro-controller code from the data. So it must do some and care relatively compatible with the in Turbo mode, where most op codes ex- on the Basic Stamp. The very successful de-multiplexing while performing those Microchip PIC that Scenix and Parallax ecute in one instruction time cycle, speed- Stamp product is still in production and sequential op code fetches. For this rea- are sued by Microchip for collusion and ing up program execution considerably has seen many improvements including a son, the computer probably cannot run theft of intellectual property. The suit has from the same code running in a PIC at big brother version providing more func- as fast in this form and commands are not been settled and Scenix was bought by the same clock speed, where most instruc- tions, and features such as more I/O lines often simplified, since the system must Ubicom, a company focusing on IC de- tions take 3 clock cycles. The internal and memory for the stored program. Dur- be able to do many kinds of data manipu- velopment for internet connectivity of memory space is the same for both parts, ing the development of these products, lation directly into and out of memory computer equipment and embedded sys- with the same size program and data Parallax apparently got technical infor- and so you now have the complex instruc- tems. Today the Scenix parts are doing memory arrays being used. There are some mation and architectural details from Mi- tion set computer (CISC type). well in production, have had some up- differences however, mostly to the good. crochip about the internal features of the grades, and are well supported in terms The microchip PIC controllers are RISC The program memory is all electrically MCU, a factor which undoubtedly helped type and all of have Harvard type archi- tools needed to develop products. Paral- eraseable or flash type, and can be repro- them develop better products, but also tecture, with separate internal program lax actually makes the “eval”, program- grammed with software changes or up- came back to haunt them in the future. and data memory. These are in fact of ming and demo boards for most Scenix dates, up to thousands of times. Soft- Computer Science teaches that there are different bit lengths or widths, as the data customers. These are very inexpensive ware design, testing and revision efforts two fundamental architectures used in memory is 8 bits wide and the program and include good technical documentation are improved in the Scenix parts, due to early computers and likewise in many our memory is 12 bits wide in the 16C series for the new user. some built-in debugging hardware placed microprocessors and MCUs today. The of parts. As far as the performance of the Similarities and Differences inside the IC, and this works well with first type is the Harvard architecture which PIC micro-controllers is concerned, the The new Scenix micro-controllers are sig- simple and inexpensive external hardware uses at least two separate memory arrays early parts could operate with up to 20 nal-for-signal compatible with the origi- and software debugging tools provided for for storing the control program informa- MHz clock oscillator, by using either an nal Microchip PIC MCUs. In some cases, custom development by the designer. tion and the internal data that is being external crystal or ceramic resonators. The the package is mechanically different, as The in-circuit programming (ISP) feature processed. This has a potential speed processor internal hardware uses a four shown on the data sheets. One package is accomplished more simply with the advantage when the memory can be made phase clocking scheme, and the result is difference to watch out for is the use of Scenix parts than with the PIC, and the from fast RAM and ROM, and also if the that using the maximum external clock the narrow “skinny dip” with 28 pins two programming methods are not com- instruction set that must be decoded from speed of 20 MHz, for example, the inter- arranged as a dual row of 14 pins spaced patible. They are both highly effective in the program memory by the processor nal processor clock is running at one fourth only 0.300 inch apart instead of the more being able to make ISP changes after the can be reduced in complexity. This is called this rate, or 5 MHz. The micro-controller standard 0.600 inch spacing. The use of micro-controller IC is mounted onto the a RISC processor for reduced instruction would execute most of the program com- this package type saves board space, pc board. With most PIC processors, set computer, and most DSP chips being mand instructions in one or two instruc- material and cost, and has very little down you can add a 5 pin header to bring sig- used today owe their performance to fac- tion cycles, so the parts had fairly high side. Scenix also makes the MCUs in the nals out directly from the board to the tors such as those described here. The performance rating of several MIPS, or standard molded surface mount packages. programming device. These include second type of popular computer archi- machine instructions per second. Other than package type and dimensions,

20 The NJQRP “PSK31 Audio Beacon Kit” The NJQRP “PSK31 Audio Beacon Kit” 21 ground, 5Vdc, MCLR* (master reset line) the smaller 18/20 and 28 pin Microchip and two I/O port lines, RB6 and RB7. A parts. These offer much faster execution 5 wire cable can connect your board to an times and they are not much more in cost. external programming device. With the Both Microchip and Scenix have new Scenix part, adding ISP is also easy to do. higher capacity MCUs with larger Similar to the PIC, you can add a 4 pin memory, more internal features and ex- header to bring out the signal lines needed ternal I/O pins. These of course, require to program the parts. These include larger packages offering 40, and 48/52 pins. ground, 5Vdc, and both oscillator pins These new parts and the tools needed to (Osc1 and Osc2). The external program- use them are available from Microchip ming device operates through these lines, and their authorized electronic distribu- and again by using a special cable to an tors. Scenix also provides support tools, external program device, you can change development boards and kits, from dis- your control program easily after the tributors and the Parallax Company. For equipment is built. example, a complete development includ- Some specific differences between the PIC ing a sample MCU from Scenix is only MCUs and the Scenix SX28 include sev- around $149. A programming and de-bug- eral new programmable features in the ging tool is $99 and just a programming SX28. For example, the clock oscillator tool is available for $79 or less. has a programmable gain to help use the Both companies a free and highly inte- device with a wide range of external reso- grated development software for PIC de- nators and crystals. Also, internal circuits signers. The Microchip version, called to provide the I/O port lines with certain MPLAB, includes an integrated assem- electrical attributes, such as triggering in- bler, linker and loader for the program- terrupts on change of state, pull up resis- ming device. Scenix takes the same ap- tors and Schmitt inputs to give clean logi- proach to helping the designer to use these cal signal response to analog inputs are parts. Scenix provides development soft- offered. Other hardware differences in- ware that includes an assembler, loader clude the option to use a deeper 8 level and programming tools that work well stack instead of the two level stack avail- with inexpensive external hardware for able in the PIC. In software, significant programming and debugging all of the mi- differences exist with the Scenix parts that cro-controllers in the family. allow certain software changes to give high Visit www.scenix.com, or performance capabilities in the program www.ubicon.com for engineering appli- that cannot be done easily with a PIC. cation notes, data sheets and code listings Ten additional instructions are available for popular functions of the Scenix MCUs in the Scenix parts, allowing easy bank used by other developers. And make sure and memory page switching, and inter- to check out the tools, development kits, rupts with context save/restore, making educational boards and devices at possible faster data table look-ups with www.parallaxinc.com. Other technical less code, and direct control code access support and information can be found at which has advantages in fail safe software www.sxtech.com and www.SX- checking and a few other applications. forum.com . Today the Scenix family of micro-con- trollers includes several replacements for

22 The NJQRP “PSK31 Audio Beacon Kit” The NJQRP “PSK31 Audio Beacon Kit” 23 24 The NJQRP “PSK31 Audio Beacon Kit” The NJQRP “PSK31 Audio Beacon Kit” 25