My own lightly modified Arduino Basic

January 4, 2012 | Arduino | By: Mark VandeWettering

I’ve received a couple of requests for my own Arduino Basic modifications. They are pretty straightforward and small, but might be of some use, and I probably won’t have a chance to do any significant work for a couple of more weeks, so I thought I’d just toss them out there for consumption. This is all based upon Mike Field’s Tiny BASIC, and all the real credit should go to him. I added a few new commands to allow you to do some simple digital and analog I/O, and added a couple of added functions, including one that could be used to figure out how much free space you have left for BASIC programs.

My lightly modified Tiny BASIC source code, for Arduino 1.0

Changes include:

  • MODE PIN,[0|1] works like pinMode(pin, INPUT|OUTPUT). Note: to specify analog pins, you need to add 14 to the analog pin number (for the traditional Arduino, I have no idea what the MEGA does).
  • DWR pin,value and AWR pin, value act like digitalWrite and analogWrite.
  • Two additional functions (ARD(pin) and RD(pin), which should really have been DRD to match DWR) act like digitalRead and analogRead.
  • DELAY ms works like, well, delay(ms), duh.
  • The FREE(0) function returns how many bytes of program storage are left.
  • For reasons which aren’t clear to me, I modified the code to convert all lower case letters to upper case. Change it back if you like.

If you swipe this code and use it for something, let me know below: if someone makes use of my work, it gives me incentive to work on it harder. 🙂

Building a distributed satellite ground station network (or not…)

January 3, 2012 | Amateur Radio, Amateur Satellite, Hacking, Rants and Raves | By: Mark VandeWettering

My twitter intro says that I am an “enthusiast for enthusiasm”. When I wrote that, it was simply because there are some questions that I really think aren’t helpful at all. Questions like:

  • Why didn’t you just buy X instead of building your own?
  • Didn’t somebody do that years ago? Why are you playing with that old technology?
  • Why are you writing a program to do that, when you could just use Y, some program/framework/application that I use.

I hate questions like this because they aren’t really questions at all: they are simply trying to tell you that what you are doing is stupid or pointless. Here’s the thing: I mostly understand why I do the projects that I do, and I’m perfectly okay with you not understanding my rationale, or agreeing with it even if you do understand. The proper answer is “why climb a mountain?” isn’t “because it was there”. It’s not even “because no one has before”. The proper answer is “because I’ve not done it, and I enjoy mountain climbing.” Interestingly, most people won’t try to convince you that you shouldn’t like mountain climbing, but all sorts of people will try to tell you that your technical projects are a waste of time. This kind of conversation actually irritates me.

And with all this introduction, I’m going to now criticize a project, which is going to seem a bit hypocritical. Hang with me to the end, and I’ll try to resolve the apparent hypocrisy, at least partially.

The topic is the plethora of news stories about a talk given at the Chaos Communication Congress (28c3) recently held in Berlin. Some links to news stories:

Hackers aim to launch Internet satellite network, moon mission
Hacker satellite grid to counter Internet censorship??
Hackers Plan Satellite Network to Fight Internet Censorship

So, what’s my beef? After all, any reader to this blog knows that I’m interested in amateur satellite and communications, surely this is right up my alley?

And indeed it is. But the motivation is just… well… it’s stupid. Not stupid because fighting censorship is a bad idea: it’s a very, very good idea. Even essential. But the idea that satellites constructed by amateurs can play any role (much less any significant role) in fighting censorship is fantasy.

First of all, launching satellites is expensive. Really expensive. While the hardware of cubesats can be constructed quite economically, launches have costs which are multiples of ten thousand dollars, for masses which are less than 1kg launched into low earth orbit. Currently AMSAT has a project called FOX to develop a communication satellite that fits the cubesat form factor, but it’s capacity and power are very limited, mostly by the physical size and weight limitations imposed by available launch opportunities. To launch a satellite into MEO or HEO would require costs measured in the millions of dollars.

Secondly, you can’t get spectrum to operate a satellite network like they imagine. Amateur radio frequencies are subject to regulation and treaties just like any other spectrum, and the uses of such frequency are dictated by regulation and treaty. The governing international body is the IARU (the International Amateur Radio Union) and member nations enact local regulations to enforce treaty restrictions to comply with the regulations of the IARU. The purpose of amateur radio satellites must be to “(1) provide communication for the general amateur radio community and/or (2) self training and technical investigations relating to radio technique”. While these topics are fairly broad, they are not broad enough to provide a general replacement for the Internet. In fact, in the U.S. amateur radio is specifically prohibited from carrying “communications, on a regular basis, which could reasonably be furnished alternatively through other radio services.” You can’t get the frequency allocations. Nobody will launch a satellite without frequency coordination.

Third, if your concern is to bypass the censorship of governments, it seems odd to do it by launching a satellite, because governments tend to have very strict and tight controls over satellites and satellite technology. For instance, in the U.S. ITAR regulations essential prohibit the transfer of dual use technologies to other countries, even to our allies. This isn’t just a theoretical concern: American participation in the amateur satellite projects of other countries have been significantly stifled But even more basic than these issues are the fact that access to space is currently under the control of the very governments we are concerned about. While increasing commercialization is eroding that to a certain degree, we cannot rely on commercial entities to operate in defiance of the governments of the countries in which they operate. There is some possibility that an organization such as Copenhagen Suborbitals might be able provide launches, but these operations must operate within the regulations of the countries from which they operate as well, so I think the idea of access to space independent of governmental interference is a fantasy.

Here’s the bottom line though: if your goal is to prevent government censorship, every dollar that you spend could do orders of magnitude more benefit using more conventional earth-bound technology. Funding projects like the FreedomBox Foundation, HTTPS Anywhere or The Tor Project, or working to generate a mesh based Wifi capability in your area are much, much stronger ways to work to combat Internet censorship.

If you want to build satellites, it’s a perfectly reasonable thing to do. But to try to sell the idea by saying that it provides a way to combat Internet censorship? That’s misleading at best.

Addendum: Here’s the actual talk at the Chaos Communication Conference. It’s actually got some cute stuff in it, mostly because it leaves behind the fantasy that a satellite communication network will provide a hedge against censorship in the first five minutes.

Lunch with Ken Boak, the Nanode, and the evolution of the Arduino platform

January 3, 2012 | Arduino, Hacking, Microcontrollers, My Projects | By: Mark VandeWettering

Today, through a bit of serendipity involving twitter and the web, I managed to have lunch with Nanode designer Ken Boak, who happened to be on an unrelated visit to the Bay Area this week. We exchanged brief messages for the first time a couple of weeks ago, as I was intrigued with his idea of making a version of BASIC that ran on the Arduino/Nanode. He was kind enough to leave me with a couple of his latest version to experiment with. Compared to the v5 version that I got as a gift (purchased from wickeddevice.com) and assembled last week, these have a few cool new additions:

  • The screw terminals have been removed, and a small wireless module put in their place.
  • The board has a 32K static SRAM for storage.
  • It has a micro SD card slot on the bottom for long term storage.
  • It has a real time clock on the bottom.

Pretty darned cool! The new version seems better to me in every way., and I thank Ken for dropping some of them off for me (and also for a couple of coworkers who are interested in Arduino programming). I’ll be working to use them in a future project for sure, and if you are interested in having a highly interconnected Arduino compatible board to play with at a reasonable cost, I can recommend the Nanode (although I’d wait until Wicked Device starts carrying the new variety, the old V5 design lacks some of these cool features).

I see the Nanode as a cool evolution of the basic Arduino platform. The Arduino does a lot right, but there are a few things that bother me.

  • Cost.. Yeah, they are cheap. But let’s face it, they aren’t that cheap. The Uno (around $30) is just an ATmega328 (about $2 in quantity), an ATmega16u2 (again about $2) to provide USB, and then a handful of discrete components. You get a bunch of pins broken out, but no actual peripherals or connectors. No switches. No (or maybe one) LED. No additional memory or RTC. No SD card socket. My rather silly Arduino n’ Gameduino Satellite Tracker costs nearly $100 in parts, which makes the entire project less interesting, because it could be done as cheaply with more capable technology. The Nanode makes it a bit more tractable: it has a real time clock, and can even do NTP to set the time and fetch new elements over Ethernet. Thus, I think the nanode gives you some added value.
  • Flexibility in development environment. When I first started with the Arduino, it bothered me a little that I needed a sixty megabyte download of a programming environment to program this little controller with maybe just 16K of memory. Even if you just wanted to blink an LED, you had to compile and reflash code. Back in the days of my youth, we didn’t have the benefit of cool optimizing compilers, but we DID have the benefit of cool interactive programming environments. Ken’s idea of creating a Tiny BASIC programming environment brings some of that back. Sure, it’s not for everyone, but for simple experiments and education, the interactivity is useful. The technology that enables this for the Nanode is the inclusion of a 32K serial SRAM: we can store programs in this RAM and interpret code directly out of them.
  • Cheap, flexible peripherals. I have some Xbees to play with, but they are a bit spendy really. An Xbee costs about $22 or so last I checked, and to interface them with an Uno, you’ll need another shield which costs around $20 by itself. Tacking $45 onto a $30 board just to get wireless seems excessive. Ditto for Ethernet: the Ethernet Shield costs around $30-$40 (or even more) and basically doubles the cost of the Arduino. The Nanode includes Ethernet (using the rather inexpensive and easy to get ENC28J60 by Microchip) and uses some small and inexpensive RF modules. While these modules are perhaps not as capable as a full Xbee implementation, their cost and benefits are much lower, and their standard deployment on the Nanode board makes them convenient to use.
  • Compatibility with both shields and breadboards. Let’s face it: the Arduino Shield form factor is idiotic. Had the pins been laid out on a 0.1″ grid, you could have made shields with just ordinary 0.1″ proto board. Or, you could put pins on the bottom, and plug it directly into a standard solderless breadboard. The original design was a mistake. Let’s get over it, shall we? The Nanode does a good interim compromise: you can put headers in either position, which is awesome. But shields are already a bit of a compatibility nightmare: depending on what pins your shield uses and/or what voltages, it already may not work with a variety of seemingly compatible Arduino variants. The Nanode also wins on this case, because many of the most common shields that you would add are simply not necessary on the Nanode.

Don’t get me wrong: I don’t think that the Nanode will kill the market for other Arduino variants and form factors. In fact, I don’t think that it should: I like the fact that I can get Arduino Nanos, Arduino Pros, and Arduino Megas, but program them all from the same environment. But I think that peripheral additions that the Nanode provides gives added value, and if the Arduino is to compete in a world where things like the Raspberry Pi exist, I think we need to figure out how to add some additional value to the Arduino platform. I thank Ken and the other Nanode users for thinking about this stuff, and taking Arduino evolution in an interesting direction.

WA0UWH experiments with the Propeller/QRSS.

January 1, 2012 | Amateur Radio, QRSS | By: Mark VandeWettering

This link will make my various Propeller loving readers happy: Eldon, WA0UWH received a Propeller microcontroller board for Christmas, and decided to try to use it to create a QRSS beacon. With other microcontrollers you generally just program it to generate a keying signal that passes into a FSK input on some other transmitter/oscillator. But Eldon used a unique feature of the Propeller: it can directly synthesize frequencies using an on chip 80Mhz oscillator and a PLL. In theory all you really need to make a QRSS beacon is a low pass filter (which Eldon also created). There are some potential problems (phase noise, temperature stability) but the idea is very cool. Check it out!

The blog of Eldon, WA0UWH: check out his recent posts on QRSS/Propeller

K6HX QRSS Beacon ON AIR…

December 31, 2011 | Amateur Radio, QRSS | By: Mark VandeWettering

Well, this morning I did a bit more work on my G0UPL beacon kit. As I mentioned yesterday, I got was having difficulty with the frequency swing: despite a very tightly wound gimmick, I was getting just a little over 1Hz or frequency shift. Late last night I decided to just try a new one: there obviously had to be a fault there. Sure enough, I wound a new one, installed it, and was suddenly getting 30Hz of frequency shift! Feast or famine, isn’t that the way of it? I trimmed it down, and unwound it a bit, and now am getting a nice, reasonable 4Hz or so swing, which is clearly visible in Argo, but also narrow enough to be tidy.

I had also noticed during testing that the QRSS beacon controller was powering up in 15s/dit mode, which is a tad too slow even for the patient. I then decided to take notice of the “Important Notice” on Hans’ documentation, and grounded pins five and six with a small jumper on the bottom of the board. It now powers up reliably in six second per dit mode.

I then decided to try to measure the output power. And… on the antenna terminals, I was measuring, well, nothing! That’s not good. I then backtracked to the 2N7000 FET, and found that there was indeed a signal on the Gate, and it was modulating (although the waveform looked pretty wonky). Probing various places along the filter chain quickly discovered the bad solder joint, and I had power.

I then tried to do some adjustment of the output power. I wired up a 2W 47 ohm resistor as a dummy load, and hooked up my scope. I found that if I peaked the output power with just under six volts peak-to-peak (a little less than 100mw) the 2N7000 got fairly toasty hot. I backed off the power to just 4 volts peak to peak (around 40mw) and the transistor seems fairly calm. I thought I should be able to do a bit better, but 40mw isn’t all that bad, so… I decided to get it on the air.

And here it is, appearing on KK7CC’s grabber (click to get it live), right around 10.140040 Mhz:

It works! KK7CC is in Las Vegas, which is around 560 miles from my location. Not bad for 40mw output power.

I’ll leave this up for a while, I’m interested in getting reception reports and screen grabs at my ARRL mailbox. I will eventually take it down, get it mounted inside a nice little Altoids box, and perhaps figure out why the output power is well short of the 100mw that I should be able to pull out of it.

In the mean time, I hope everyone has a safe and happy New Year’s Eve!

QRSS Beacon assembled, but not quite right…

December 31, 2011 | Amateur Radio, QRSS | By: Mark VandeWettering

I ordered myself one of Hans Summers’ QRSS beacon kits before Christmas, and it arrived a few days ago. Yesterday, I started tinkering it together, and today got it hooked up and began testing.

First, the good news:

  1. The oscillator is running.
  2. I was able to adjust it with the trimmer to get it into the MEPT portion of the 30m band.
  3. The AVR is alive and running.
  4. Tone output works, and it is detecting the 6s per dit QRSS mode properly.

But… all is not well. Here’s an example output recorded with Argo on my FT-817 placed adjacent, without any antenna at all. The QRSS beacon is transmitting into a 1W 47 ohm resistor that serves as a dummy load.

As you can see, the output is a bit wavy, and looks a bit unclean as well, with lots of spurs. But the primary thing is the deviation is only about 1.5 Hz (I recorded this in 10 second dit mode on Argo). I tried adding some additional twists to the gimmick cap, but that didn’t seem to help much.

I suspect the general poor quality of the output may be because I’m using a 5v power supply of unknown quality (perhaps some additional filter caps across the power leads may be helpful?). I’ll probably try to make a longer gimmick tomorrow. I also am going to get it hooked up to the scope to adjust the power properly as well. It’s also not in a box yet, and my dining room table is a bit drafty, so thermal drift is a distinct possibility.

Anyone else have any ideas on how to tame the ragged castle walls?

Addendum: I couldn’t let it sit: it’s one o’clock in the morning and I decided to make a new gimmick and try it out. And, of course, it worked a lot better, giving about 30Hz of swing! Ouch. I trimmed the length down, and unwound it a bit more, and now it’s down to a more respectable 8 or 9 Hz. I’ll probably unwind it a bit more when I get it in the case and setup for final operation.

But here’s an odd thing: I jumpered it for 6 second dits by jumpering the 2-5 connection at the top of the AVR, but it’s acting as if is set to 15s dits. Do I need to ground pins 5 and 6 as well? Perhaps they are floating?

Addendum2: I suppose I should have read the Important note on this page.

Nanode on the Web!

December 30, 2011 | Arduino | By: Mark VandeWettering

Well, to test my nanode‘s Ethernet capability, I put it on the web! Check it out by clicking this link. Hurrah! Not too impressive, but consider: it is dynamically generated on an eight bit microcontroller that costs about $35, Ethernet included. Perhaps not as cool as the Raspberry Pi, but unlike the Raspberry Pi, you can get a nanode.

But all is not well in the nanode/Ethernet universe either. There appears to be a veritable Pandora’s box of different libraries for Ethernet on the Arduino. This appears to have happened in part because the “official” Ethernet shield is based upon Wiznet W5100, while the nanode (and other inexpensive shields) appear to be based upon the Microchip ENC28J60. I can understand that to a certain degree (the Microchip part is less than $4 in unit quantities from Digikey, and is available in a through-hole PDIP package) but there appears to have been a bit of fragmentation of development even within the ENC28J60 code development. The nanode folks appear to be working with Jeelabs, so I used their EtherCard library which was available via git, and that seems to work pretty well (no changes, worked straight out of the box). The TCP/IP implementation limits HTTP responses to a single packet, so pages have to be small, but is probably sufficient to web-enable a great deal.

I was wondering: is there a more capable implementation that implements multiple packet responses? It seems like it would be helpful for many applications. Any experienced Arduino/Ethernet programmers can respond below. Does the official Ethernet shield provide that capability?

Christmas Kit: The Nanode

December 28, 2011 | Arduino | By: Mark VandeWettering

My wife is the best. She listens to me even when I yammer on about the most boring and geeky of topics, and does so with patience and grace. What’s more, she even remembers what I talk about, and I reap the benefits at Christmas time. I mentioned Nanode about a month back, because I thought it was cool: it’s an Arduino compatible kit that sells for about $35. “That’s not so good”, think you. But the cool thing is that it includes Ethernet. It also has a couple of other improvements. It has a double row of pin headers. The inner set are compatible with the (incredibly annoying) irregular Arduino shield spacing, while the outer set are on standard 0.1″ headers which allows you to solder in pins and use it easily on a breadboard. It also includes a space to solder an external SPI memory (SRAM, FRAM, or EEPROM) for additional expansion. Nifty.

Here is my assembled (and functional) nanode:

The instructions say 1.5 hours, it took me a little over two, because I went very slowly and methodically. It’s not difficult, but it’s a fair amount of soldering, and it’s easier to make sure that you do a good job as you go along, rather than spend it debugging later. There were only a couple of minor problems with the instructions: the 22pf ceramic caps shown in the pictorial are actually blue caps in my kit, and the what the instructions showed as blue were in fact little yellow caps. The later required a bit of lead manipulation to get them to fit tidily (their natural spacing was a bit wider than what the PCB has). I didn’t see where they specified to insert the LED’s current limiting 270 ohm resistor, but it was obvious to me at the end where it went. Getting the Ethernet socket in place took a little careful manipulation of the pins. But in the end, it all worked out okay, and when I powered it up, the LED blinked to indicate all was well. I moved my Tiny BASIC interpreter over, and after fixing a minor bug that I introduced the day before but didn’t catch, had it running basic programs to blink LEDS. Huzzah!

It seems like a good kit, really. But there are a few things I thought were odd. The place to solder the SOIC memory expansion is on the bottom. And, in spite of the fact the rest of the kit is entirely through hole, this one is surface mount. That’s not a big deal, but there is something that kind of bugs me: it requires other board modifications to make it work for most of the memory chips I’ve looked at. The problem is that there aren’t any level converters wired to it. The board itself is mixed voltage: 5v for the ATmega328, and 3.3v for the Microchip Ethernet, but this isn’t carried over to the memory expansion. To really make this work, you need to convert the board to run on 3.3V, and that requires hardware mods (replacing the regulators). And frankly, I wish they had. Yes, I understand that some shields need 5v, but the precedent of 3.3v Arduino Pro boards has already been set, and I suspect that much of the complexity of the existing board is in the resistive dividers that it needs. As it is, I think it will actually be simpler to do memory expansion via a small data board that rides on the headers, and includes the necessary level conversion. It also means I can use the PDIP version of the 23K256 chip, which is more breadboard friendly.

I was also surprised that they didn’t include an SD card slot. If you have an Ethernet, one of obvious ideas is to serve webpages, and you need some space to store them. The obvious thing would be a small SD card. I recognize that the board space is at a premium (especially since this kit uses through hole packages for ease of assembly), and this kit is inexpensive, but it still would have been nice. There is a spiffy Arduino-compatible but looks nice: the EtherTen by Freetronics, but to be fair, it costs twice as much and uses surface mount technology.

One other minor gotcha that I encountered was with the “FTDI cable” that came with my order from Wicked Devices. While it is described as an FTDI cable, when I plugged it into my MacBook that I use for Arduino development, it wasn’t recognized, in spite of the fact I’ve used other FTDI cables. It turns out that it’s not actually an FTDI cable: it’s based upon a USB UART converter made by Silicon Labs. Once I dug out the proper drivers, it worked fine, but it might have caused more confusion for beginners.

I will probably use this for more Tiny BASIC experimentation, and/or serving a simple website. If you’d like to get a kit that you can assemble that includes Ethernet, it’s hard to do better at the price point. You can also order them preassembled.

Addendum: I think I see what the problem was, and while I was confused about the specifications: my wife ordered this from Wicked Devices, who are listed as the US distributor for the Nanode. But Wicked Devices only carries the Nanode V5, which is not the most recent revision of the board. The “Nanode Classic” includes most of the changes that I thought the one I have should carry, as well as including an expansion board for RF, but is apparently not available from their US distributors (yet).

Mineways

December 27, 2011 | Link of the Day, Links | By: Mark VandeWettering

Okay, I’ll confess: I’ve spent a bit too long playing Minecraft, both on a shared server, and even by myself in single player. I find it kind of soothing to create models, rather like playing with blocks or legos. But Eric Haines (a long time friend, and one of the people who was most influential in getting me started in computer graphics) has done one better: he’s written a program that allows you to export portions of your Minecraft world, and get them printed as a 3D model. He calls the resulting program Mineways. Check it out:



Merry Christmas!

December 25, 2011 | Merry Christmas | By: Mark VandeWettering

I’d like to thank each and every follower and friend of the brainwagon blog for their encouragement, for their attention, and for their continued participation in my little stream of consciousness experiment on the Internet. To all you, and your friends and family, I’d like to extend my best wishes for a Happy Holiday and a very Merry Christmas.

Extending Tiny BASIC on the Arduino

December 24, 2011 | Amateur Radio | By: Mark VandeWettering

I was intrigued by @monsonite’s challenge to extend Tiny BASIC for the Nanode. I don’t have a Nanode, but I do have some Arduinos, and extending Mike Field’s Tiny BASIC port to include some additional Arduino functionality seemed pretty straightforward. An hour or so staring at the code told me pretty much all I need to do, so I went ahead and added a DELAY statement to duplicate the Arduino delay() call, a MODE keyword (duplicating pinMode()) and WR (duplicating digitalWrite()).

If you put all these together, you can write simple LED blinking programs entirely in BASIC. Check it out:

I might see how far I can take this idea during my vacation.

Addendum: Why does YouTube always choose a frame where my eyes are closed as the default marquee image?

Tiny Basic running on Nanode – Christmas Challenge

December 24, 2011 | Arduino | By: Mark VandeWettering

As a followup to my post yesterday regarding Arduino BASIC, here’s a contest challenge to extend the Arduino basic to drive the Nanode, an Arduino compatible microcontroller board that extends the conventional Arduino with Ethernet and other cool features. The challenge is to make a good hack using Tiny BASIC: perhaps by extending the BASIC interpreter to include commands for accessing all the additional peripheral devices that the Nanode has. Neat!

Sustainable Suburbia: Tiny Basic running on Nanode – Christmas Challenge

Addendum: It only took me a few minutes of staring at the code to figure out how to add a “DELAY” command that can pause execution. It wouldn’t be hard to add equivalents to the digitalRead, digitalWrite, analogRead and analogWrite. Maybe I’ll give this a try myself over the next few days.

Arduino Basic

December 23, 2011 | Arduino, Computer Science, Programming Languages | By: Mark VandeWettering

Edsger Dijkstra, Dutch computer scientist and winner of the 1972 Turing Award wrote:

It is practically impossible to teach good programming to students that have had a prior exposure to BASIC: as potential programmers they are mentally mutilated beyond hope of regeneration.

While I have respect for his great contributions to the field, in my opinion, this claim falls a bit far afield. In particular, nearly everyone who learned about computers in my generation seemed to through the path of BASIC. BASIC was the lingua franca of the microcomputer revolution, and while I now see it as rather quaint and ridiculous, it provided a step into computing for many people who found that they could indeed regenerate their brain cells in spite of their early exposure.

But does BASIC have any place in the modern world? Well, I must admit, the answer might be “maybe”. Little microcontrollers like the BASIC Stamp have been overshadowed a bit by the Arduino, but I still think that having an interactive interpreter that you can use to access a small computer makes some sense. Having a small language like Tiny BASIC, augmented by a few small additions to (say) allow you to generate sounds or control I/O pins makes a great deal of sense. Thus, without further justification, take a look at this project:

Arduino Basic – User's Wiki!

The code looks pretty nice and tidy, and should be easy to extend. It allows programs of up to 1.4K to be loaded into RAM, which sounds like a trivial amount, but it’s certainly enough to blink some leds, read and write some serial data, and generally exercise some of the capabilities of the chip. Neat project!

Nice article on making an Arduino DDS…

December 23, 2011 | Amateur Radio | By: Mark VandeWettering

My experiments with generating RTTY signals yesterday made me begin to think about generating RTTY signals with an Atmel/Arduino setup. The obvious way is to use PWM and a low pass filter to approximate a sine wave. While doing a bit of research, I found the following link which seemed to be nearly ideal: it even included an amateur radio application that uses an Arduino to generate the tones necessary to transmit WSPR. It also has a very nice lowpass filter design that can be pressed into service to smooth the PWM output. Stashed for future reference:

Arduino DDS, with WSPR applications

More on the crazy ITA2 encoding…

December 22, 2011 | Amateur Radio | By: Mark VandeWettering

So, this morning, I was trying to test my understanding of the ITA2 code used in amateur radio teletype communications. I wrote up an encoder, generated some test audio files, and tried decoding them with fldigi. It mostly worked, but I had some difficulty with certain punctuation marks. I was curious what the problem should be, so I dug into the code in fldigi that does this stuff. I found this interesting chunk of code:

[sourcecode lang=”cpp”]

#if 0
/*
* ITA-2 version of the figures case.
*/
static unsigned char figures[32] = {
‘\0’, ‘3’, ‘\n’, ‘-‘, ‘ ‘, ‘\”, ‘8’, ‘7’,
‘\r’, ‘\xb7’, ‘4’, ‘\a’, ‘,’, ‘\xb7’, ‘:’, ‘(‘,
‘5’, ‘+’, ‘)’, ‘2’, ‘\xb7’, ‘6’, ‘0’, ‘1’,
‘9’, ‘?’, ‘\xb7’, ‘\xb7’, ‘.’, ‘/’, ‘=’, ‘\xb7’
};
#endif
#if 1
/*
* U.S. version of the figures case.
*/
static unsigned char figures[32] = {
‘\0’, ‘3’, ‘\n’, ‘-‘, ‘ ‘, ‘\a’, ‘8’, ‘7’,
‘\r’, ‘$’, ‘4’, ‘\”, ‘,’, ‘!’, ‘:’, ‘(‘,
‘5’, ‘"’, ‘)’, ‘2’, ‘#’, ‘6’, ‘0’, ‘1’,
‘9’, ‘?’, ‘&’, ‘\xb7’, ‘.’, ‘/’, ‘;’, ‘\xb7’
};
#endif
#if 0
/*
* A mix of the two. This is what seems to be what people actually use.
*/
static unsigned char figures[32] = {
‘\0’, ‘3’, ‘\n’, ‘-‘, ‘ ‘, ‘\”, ‘8’, ‘7’,
‘\r’, ‘$’, ‘4’, ‘\a’, ‘,’, ‘!’, ‘:’, ‘(‘,
‘5’, ‘+’, ‘)’, ‘2’, ‘#’, ‘6’, ‘0’, ‘1’,
‘9’, ‘?’, ‘&’, ‘\xb7’, ‘.’, ‘/’, ‘=’, ‘\xb7’
};
#endif
[/sourcecode]

Odd. It seems to differ significantly from the “official” ITA2 code. So, I modified my RTTY encoder to use the same encoding. I also discovered that fldigi implements “unshift-on-space”, regardless of what mode you are in, sending a space drops you back into the letter mode. This caused some things to decode improperly until I fixed it.

Now, it seems to work. If you are bored, you could download this overly long and verbose RTTY message (note, you may have to reverse mark and space frequencies, I’m not sure I got that right yet).

An RTTY message, encoded by my RTTY encoder (2.2M WAV file)