2008-04-27
I've added PWM support for generating the baseband and envelope signals to the code base. This generates much cleaner looking signals, but I've run into a timing jitter problem.
Experiments with my new DSO and some pin-toggling code under cli(); has shown the internal clock of the ATtiny13V is hopelessly unstable and has pretty extreme phase noise - typical of an HF RC oscillator. The ATtiny13 also lacks a second timer, so I am busy-waiting to generate the baudrate and using the only timer to drive the two PWM channels. This means the code is a bit of a kludge and can't use interrupts to generate the baudrate without a major rewrite and probably dropping to assembler and cycle counting (adding NOPs) to balance out the delay in various execution forks. It would be much easier to produce well-timed PSK-31 from a xtal locked MCU that has at least two independent timers, the ATtiny85 comes to mind, and it has a lot more space for messages or even a varicode table.
In an attempt to xtal lock the MCU I changed its low fuse bits to run off an external clock. At the time I knew this would break my simplistic programmer, but to work around this I wired up a simple pierce oscillator on a solderless breadboard and simply held the output wire against pin 2 while programming. This worked fine - ONCE. Upon the second attempt I must have slipped while it was programming and glitched the heck out of the clock - programming the RSTDISBL fuse - BUGGER! (Although at the time I likely used more colourful language.) This naturally rendered the device unprogrammable via SPI even with a clock source!
Time to build a HV programmer...
I did get a lot further with the RF hardware side of things. I built a buffered xtal oscillator and a cascaded feedback amplifier pair to bring the output of the DBM up into the 10-100 mW region. The xtal oscillator is buffered and then padded very severely giving a very stable signal, but at less than -10 dBm. The modulation happens at this rather low level - probably a problem if I add more power gain later, so I may put an amplifier between the LO source and the modulator. The "power amplifier" currently implemented still has plenty of headroom, but I may change the output device (currently a BD139) to something with more gain at 20 metres.
Note that while I am generating the phase and amplitude signals, I am currently only using the baseband one with the DBM modulator.
Experiments will continue once I unbrick the microcontroller.
Here is a video of the MCU blinking some LEDs at about 1 baud. I slowed it down so the phase relationships between the three signals could be clearly seen. What you are seeing here is a few of the "0" transitions in the preamble/idle before the actual message is sent.
Note that the "phase" line transitions as the "amplitude" signals hits its minimum, and the "baseband" signal crosses through half-rail at the same point. Graphically it looks like this:
I wouldn't recommend using this code for anything but a rough starting point, but I've attached it for your amusement.
2 comments.
title | type | size |
---|---|---|
PSK-31 Modulation Diagram Source | application/postscript | 9.481 kbytes |
Parent article: PSK-31 Beacon Mark 1.