G4USP

Page last updated: 01/09/2009

Resultant software design:

    The software for the beacon controller was developed using MPLAB, a propriety integrated development environment (IDE), which can be downloaded free of charge from Arizona Microchip. I found MPLAB to be an invaluable tool, intuitive in use, and with its simulator, I believe hours if not days, or even weeks were shaved off the development time of the software.

    The assembly listing for G4USP-beacon-PIC12F509.asm can be found here, simply follow the link.

            Software description

    Open G4USP-beacon-PIC12F509.asm with MPLAB, or any text editing tool i.e. NOTEPAD if MPLAB is not available, however it is worth downloading and installing MPLAB as it formats the file in a way that makes it much easier to read.

    The assembly listing is organised and set out in a logical order, but a little further explanation of some sections / sub routines is in order:

include P12F509.inc: when MPLAB compiles and assembles G4USP-beacon-PIC12F509.asm the contents of P12F509.inc is included.  P12F509.inc simply contains the definitions for the ports and commonly used registers associated with the PIC12F509 microcontroller used for this beacon controller. Its contents could just as easily have been cut and pasted into G4USP-beacon-PIC12F509.asm but using the command include and the file name P12F509.inc makes for a less cluttered assembly listing.

INITIALISE: as its name suggests system initialisation takes place here. Interrupts are disabled, timer and prescaler is set up, I/O ports are configured, all software defined timers are cleared / reset, ident, alarm, & pip generators are initialised, and finally the system is armed.

MAIN_LOOP: once initialised the system proceeds to the main loop, from this point onwards everything is accessed from within the main loop. Operating in this manor means should any routine freeze the HEARTBEAT LED will stop flashing.

CW_ROUTINES: this section checks the cw timing marker, pip, and ident status, and then calls for either pips or ident as required.

IDENT_MORSE, IDENT_RESET, & IDENT_DATA: these three routines are associated with CW identification. ident_init initialises / restarts the identification process, idend_dat contains the data array, whilst ident_send processes the data array and keys the piptone generator.

With the CW timing marker set for a Morse code dot time of 100mS which equates to a Morse code rate of 12 words per minute (12WPM). A dash equates to three dots, the pause between a dot and a dash in time equates to one dot, pause between letters equates to three dots, and pause between words equates to three dashes or nine dots.

G4USP is thus encoded:

      111010100010000000001110111010001010101011100010101110001010100010111011101

With suitable pauses both prior to and post sending, and split into eight bit bytes, the data array becomes:

00000000
00000000
11101000
00101110
00101010
10101110
10111000
00101010
10111010
00000011
10001000
00111010
00000000
00000000

PIPS_MORSE, & PIPS_RESET: these routines are associated with pips, and generate a train of 40 pips.

TX_CONTROL: this routine controls the PTT line.

SOFT_TIMING: this routine generates the various timing markers required by the system. The primary timing markers are at 100mS for Morse code timing, 1S for the heartbeat LED and, 10m for identification cycle timing.

 

BACK  HOME