Phillip Pearson: Web / Electronics Blog

tech notes and web hackery from someone who was vaguely useful on the web back in 2002 (see: bzero, python community server, the blogging ecosystem, the new zealand coffee review, the internet topic exchange)


Serial Wire Debug - properly wiring up a Cortex-M debug connector, and debug adapter/software thoughts

One of the things that confused me the most when moving between the AVR and ARM Cortex-M worlds was what debug/flash interfaces to support. The LPC11U1x series has a UART based flash download method (shared with the LPC810, according to this Adafruit tutorial), and the LPC11U2x/3x chips add in various USB options. STM32F chips have their own method, and I've seen an I2C downloader for WLCSP (very small) versions of Freescale Kinetis chips.

All of these are red herrings! The only interface you need is SWD, an ARM standard that gives you a connection right into the processor bus -- i.e., pretty much full control of the chip. It's active all the time unless you've disabled the SWDIO and SWCLK pins or assigned them to other duties, and has very good open and closed source support across the board.

This PDF from ARM explains the connector you need. It's a 2x5 header with 1.27mm (0.05") pitch. One row of pins for power/ground, another for data. There are some gotchas in there, and here is what I've figured out through trial and error. First, the power row:

1 - VCC - connect this to your MCU power net to get convenient power right from the debug adapter. You might want to put a jumper in series if you'll sometimes want to self-power the board, or leave this disconnected entirely if you'll *always* have the board self-powered.

3 and 5 - GND - connect to your ground net.

7 - KEY - leave this unconnected

9 - GNDDetect - this is for target boards to detect the presence of a debugger. I always leave it unconnected, but if knowing a debugger is connected is useful to you, put a pullup to VDD and feed this into a GPIO.

Now, the data row:

2 - SWDIO - connect this to your MCU's SWDIO pin. Pull-up/down resistors are usually unnecessary here, although check your datasheet to be sure.

4 - SWCLK - connect this to your MCU's SWCLK pin. Add a pull-down resistor to ground, between 10-100k.

6 - SWO/TDO - connect this to SWO on your MCU if you're using a Cortex-M3/M4. Cortex-M0/M0+ chips don't implement SWO, so I like to connect it to TXD on a spare UART in that case, which gives me a convenient serial console over the debug connector (I have a board that breaks out the UART pins separately so they don't go to the debugger).

8 - NC/TDI - either leave this unconnected, or connect it to RXD on a spare UART if you like my UART multiplexing trick.

10 - nRESET - connect to your MCU's /RESET pin. This usually needs a 10-100k pullup to VDD.

That's the electrical side of things sorted. Now, the physical. You'll find that SMD and thru-hole 0.05" pitch connectors are surprisingly expensive compared to 0.1" headers. After buying a bunch of $0.70 SMD 2x5 connectors and $0.30 thru-hole ones, I found a vendor on Aliexpress who was selling 10-packs of 2x50 connectors (of either type) for about $8, which can easily be chopped up into whatever length you like. This brings the cost of a 2x5 connector down to about $0.10, which seems much more reasonable.

Finally, debug connectors and software. Each chip family, and sometimes each chip, has a different flash controller, so you'll find that you need software for your particular device before you can erase, flash, or debug it. Here's what I've gathered so far:

- The SEGGER J-Link is a very very flexible debug adapter, that supports pretty much any Cortex-M chip, and is supported by pretty much every IDE. It will save you a ton of time to buy one of these, but you'll be paying $400 for a commercial-licensed version if you're doing anything other than educational/hobbyist work (in which case the $60 "EDU" version will do).

- CMSIS-DAP is ARM's standard for SWD over USB. Any CMSIS-DAP compliant adapter should work with any CMSIS-DAP compliant tool. As of now, there aren't a ton of these, but if you buy a development board, there's a good chance you'll be able to reflash the debug connector side of it with CMSIS-DAP firmware, and use it as a CMSIS-DAP dongle for any chip you can find software for (i.e., you're not limited by processor family any more). The firmware is open-source, available on GitHub.

- Free IDEs exist for most chip families. For Atmel ATSAM chips, there's the Visual Studio based Atmel Studio (which requires a J-Link, or the $50 ATMEL ICE adapter, to program chips). For Freescale Kinetis chips, you want the Kinetis Design Studio (which supports J-Link out of the box, or you can hack up a Freescale Freedom dev board and program it with the USBDM firmware). For NXP LPC chips, there's LPCXPresso (which supports CMSIS-DAP, J-Link, and NXP's $20 LPC-Link2, or you can hack up an LPCXPresso dev board).

- I'm a little confused about the STMF32 chips from STMicroelectronics. They have super cheap ~$10 "Discovery" dev boards, which come with an on-board ST-LINK/V2 debug adapter (available separately for ~$20), but as far as I can tell, don't have a vendor-supported free toolchain. However, there's a ton of open-source support, and you can put together a free toolchain without too much trouble. For flashing/debugging your chips, you'll want OpenOCD, which supports pretty much any debug adapter under the sun.

While we're talking about OpenOCD... it is an awesome open source project that I would love to use/contribute to if I find time. It seems like the Right Thing to do, allowing you to debug many kinds of chips with many kinds of adapter. I see it has support for some members of the Freescale Kinetis family, and it was able to connect to a MKE04Z8VTG4 using my LPC-Link2 with CMSIS-DAP firmware, but doesn't have support for the FTMRE flash controller there. Porting the flash code from USBDM into OpenOCD would be an excellent project, and would enable OS X support for more Kinetis devices. Both projects are licensed under the GPLv2.

That said, I'm probably going to buy myself a J-Link soon, because I really like the look of the Atmel ATSAM4S16B -- $5 in single quantities, 120 MHz Cortex-M4 with 1MB flash and 128k sram -- and I want to use Atmel Studio. So far I've been using a Freescale FRDM-KE04Z board with USBDM to debug my MKE04Z8VTG4 and MKE02Z64VLD2 based boards, and an LPC-Link2 to debug my LPC11U14 and LPC11U12 based boards.

... more like this: []


Getting back into electronics - playing with ARM Cortex-M chips

... and shaking the cobwebs off this blog, apparently. It's been a LONG while.

So I used to be an electrical engineer, until I joined the social media dev world in 2005, and I've been meaning to get back into electronics ever since. I finally half did it in 2012, making my matrix display, which was super fun, and keeps giving back -- I've brought it to Burning Man twice, the Lunacy festival, the Lucidity festival, and SF's Sea of Dreams NYE party twice. I've been meaning to do more microcontroller work since then, however, and I only really got into that in late 2014.

Since then I've been pretty busy... I counted up something like 17 circuit boards that I've designed between Nov 2014 and now. A bunch of random trivial boards to make connectors easier to work with (AVR ISP breakout, ARM SWD breakout, ARM SWD+UART multiplexer, FPC breakout for mini TFTs, etc), a couple of breakout boards for microcontrollers (Freescale MKE04Z8VTG4 and MKE02Z64VLD2), and a few actually interesting ones (an LED heart pendant, an 8x8 sparse - modifiable at solder time - matrix of LEDs to make a light-up birthday present for my girlfriend, a 20-LED ring, an ATMEGA328P based PWM controller for LED strips, and finally an LPC11U14 USB board, designed with Philip Lindsay).

Some of the boards I've designed since late 2014.

This all started when Philip mentioned to me that he'd been playing with NXP's LPCXPresso LPC11U14 eval board, and I took a look at the specs and pricing on the microcontroller in question. How had I not managed to find out that ARM now made microcontrollers?! In 2012, the hobbyist world was going nuts over Arduino, which is a kinda ugly looking board combining an Atmel AVR (ATMEGA328P) MCU, a USB-to-serial adapter, and basic power stuff. Snotty EE that I am, I dismissed it out of hand due to how little it appeared to offer (why use one when I could just solder up the same thing on veroboard and use a real AVR programmer?!), failing to realize that the software support and amazing community behind the platform actually made it into the nicest hardware platform I'd ever worked with. I think I realized this after basing every custom hardware project for the next year on ATMEGA328P and ATTINY85 chips and building against the Arduino libraries... but anyway. So last year I found out that ARM made micros, and they were cheap and super high spec. Unfortunately, the "scene" seems super fragmented, unlike the AVR world, where there are basically only three chips worth considering, due to how well supported they are: ATMEGA328P (Arduino), ATTINY85 (Adafruit Trinket), and ATMEGA32U4 (Teensy).

So... for the last few months, I've been reading and reading and reading, and designing boards, buying chips, hacking around, and learning about the ARM Cortex-M system and its licensees by trial and error. Here's a quick braindump:

- For actual chips you can buy, there's the ARMV6-M based Cortex-M0 (NXP LPC 11Uxx, Cypress PSoC 4), the slightly quicker/lower power Cortex-M0+ (Freescale Kinetis E), ARMv7 Cortex-M3 (I don't care), and ARMv7+DSP Cortex-M4 (Freescale Kinetis K, STMicro STM32F3/4, Atmel ATSAM4, and a bunch of others). CM0/CM0+ typically run at 20-50 MHz (although the flash maxes out at 24 MHz so you end up with a lot of wait states when running the core fast), whereas CM3/CM4 parts can get up to 72-180 MHz.

- If you want to get up and running with a Cortex-M chip *fast*, don't need single-step debugger access, and don't want to have to care about the internals, go buy a Teensy 3.1 from PJRC. With 256k program space, 64k ram, USB, and a super user-friendly dev environment and bootloader, it's a dream to work on. Creator Paul Stoffregen puts a ton of time into the community and making sure that Arduino libraries work on Teensy as well, so it's highly likely to be the most compatible chip if you're coming from that platform. I used a Teensy 3.1 for the aforementioned birthday present, and I wish all development was that easy.

- If you're controlling LEDs, consider FadeCandy, which is based around a similar MCU to Teensy 3.1, but is a bit more open and slightly less convenient, and has convenient 5V output for driving LED strips.

Those are my pre-built recommendations. Now onto actual chips that I've been working with.

- If you like tiny (fan of the ATTINY85?), try the Freescale Kinetis MKE04Z8. It's under a dollar, and has 8k of flash and 1k of ram. This seems to fill up quick, but it runs my LED pendants just fine. I cannot for the life of me get the UART to work (more on that later). And it can run on 5V, unlike many Cortex-M parts. I think it's designed for the automotive industry. The official debug/program adapter is expensive, but you can hack their $13 "Freedom" board to work as a programmer, and that's been working fine for me.

- Slightly bigger (physically and flash/ram-wise) is the Freescale MKE02Z64. Still around a dollar, but with 64k of flash and 4k of ram. This is the ATMEGA328P-killer. 44 pins, 20-40 MHz, 3 UARTs (which actually work for me). I bought 20 of these right off the bat, and expect them to become a standard workhorse for when I have enough board space for a 44-pin 0.8mm LQFP and don't want to spend much.

- Cypress has combined CPLD and MCU functionality into its PSoC series. I'm still learning about it, but PSoC 4 chips like the CY8C4245 appear to have magical powers like being able to run PWM on every pin -- when configured properly. Also 5V-tolerant (albeit with a slightly odd regulator setup requiring quite a few capacitors). 32k flash. Seems to require an expensive debugger... but the CY8CKIT-049 eval boards are $4. The high end CY8C4247 chips (not available yet) will do Bluetooth LE. I can't wait.

- NXP's LPC series has built-in USB, and 16 kB of ROM that apparently implements useful routines. LPC11U12 (16k flash) is about a dollar, LPC11U14/24 (32k flash) are more like $3-4, and the LPCXPresso IDE is nice. Plus there's an excellent programmer/debugger, the LPC-Link2, which only costs $20. These require 3v3.

- I haven't tried this out yet, but Atmel has the ATSAM4 series, which seems to be one of the more affordable high-spec CM4 lines. has some ATSAM4 chips with 1M flash for ~$5. They have a debugger (Atmel ICE) for $30-50, which also gives you single-step debug on AVRs (for all your old Arduino/AVR projects). Also 3v3.

- Also in my shopping cart right now are some STMicro STM32F372 chips. No idea about them just yet, but not only are they the most affordable CM4 chips that don't have 100 pins, they're actually CM4F, which means they have a proper FPU. Suspect tool support will be awful, but I'm starting to roll my own SWD hardware now, so these can sit around until that's ready. Also 3v3.

Blog comments still aren't up and running, but if you're reading this and have something to add, drop me a line! I'll probably set up Disqus or something soon.

... more like this: []


DEAL_WITH_IT_LATER logging severity

Here's an idea I've had a few times but never gotten around to implementing: when an application encounters a correctable data consistency error, or does something that's likely to fail, it should log something to a table so that another process (which may not be written until years later) can double-check that nothing messed up, or clean up after the operation. User (spammer?) deletion is a good one -- as in a large application, it's easy to forget to implement all the cleanup logic when adding new features.


Electronic component part library standardization

This year I've been getting back into electronics, after an absence of about 10 years. Some advances are amazing (microcontrollers with built-in USB for $4! High quality PCBs for $5/sq in and free shipping, with no minimum size! Low quality PCBs at $14 for ten 5 cm x 5 cm boards!)... but some things don't seem to have changed. It looks like there's still no standard part library format or converter. Perhaps a project like Homebrew or RubyGems, with a minimal built-in part library and an easy way to locate more parts, would be nice to have here? Also some shortcuts for generating parts. I would really like to be able to run 'partlib install SN65HVD12P' and have it download and install symbol/footprint info into my schematic/PCB editor.


Music festival logistics - camping at Lightning in a Bottle

This year I've started feeling like writing in public again, and it turns out my blogging code hasn't rotted *too* badly, so here goes (continuing a post I started in May...).

Since moving to the USA, one thing I've done a lot of is go to [music] festivals. Most notable, I've done Burning Man three times, but I've also been to Coachella twice, the Treasure Island Music Festival, Outside Lands, my Burning Man camp's private campout, False Profit's Priceless campout, undoubtably some more I've forgotten, and Lightning in a Bottle. The latter is what spurred me to write this post, because it seems to have a much smaller web presence than the others. It seems that it's a fairly young event, vaguely connected to Burning Man (it's been described as "Burning Man with training wheels"), and pretty strongly connected to Coachella (the group that puts it on -- the Do LaB -- is responsible for much of the large scale art each year at Coachella).

My take on it: LIB is beautiful. It's probably the best looking festival I've ever been to. The location and decorations are amazing. It's tranquil but colourful, with a fun neo-hippie vibe -- I was really impressed. The seminars and such weren't really up my alley, but I can't deny that the crowds of enthusiastic listeners and serene meditators set the atmosphere well. The overall feel of the festival was such that I had a great time even when hanging out at camp, and wandering around the campground -- I certainly didn't feel the need to spend the whole weekend down at the dance stages.

On to why I wrote this post: to get some info out onto the web about the details and logistics of camping at LIB.

LIB has two areas: the 'lower festival' and 'upper festival'. The lower festival is where you'll arrive. The big parking lots are down there, along with the main stages, art, and vending areas, plus some camping. The stages, art, and vending are mostly on grassy areas, and most of the camping is on dirt. If you're not one of the first to arrive, you'll be sent up Lumi Hill, to the upper festival, which has similar ground cover -- grass for the vending and yoga/meditation areas, and dirt for camping.

Setting up your tent is a little reminiscent of pitching camp on playa (although without the crazy winds!) -- the dirt is just about as hard and dry. I highly recommend bringing alternate tent pegs -- go to Home Depot and pick up some 10 inch nails, one of the big orange 45 oz deadblow hammers, and a pair of vise grips. They'll go in easy, and come out easy. You can probably scale down a bit from there, but anything will be better than the fragile little pegs that come with most tents.

It's HOT. Baking hot during the day, but not awfully warm at night, so bring your airy summer outfits, but also some way to wrap up well at night. The style is more hippie than raver or postapocalyptic -- beads, tie-dyes, muted colours, scraps of cloth, faux-Japanese (with plenty of mystical symbols: sacred geometry and the like), and just-out-of-the-circus outfits dominate over gold bikinis, day-glo, cowboy hats, and utilikilts.

The heat makes sleeping just about as difficult as at Burning Man, so Springbar/Kodiak Canvas tents, and any form of shade possible, will be just as useful. The camping area gets pretty crowded, so you might not have enough room for a hexayurt, but a shade structure will make your life a lot easier. We took a tent that was barely big enough for a twin air mattress, plus one of Costco's little $40 easy-up shade structures, and it was okay, but the heat was still pretty ridiculous even in the shade. If I keep going to festivals like this, I'll probably blow $500 on a Kodiak Canvas 6010 (deluxe flex-bow 10x10) and some Aluminet, which should make worrying about shade a thing of the past. Bring some lighting for the outside of your tent, as the "blocks" are large, and unless you're lucky enough to camp near someone else with distinctive lighting, you may have a hard time getting back home. Cheap battery powered Christmas lights are probably the way to go here.

Along those lines, if you buy early enough, you'll be able to get a car camping pass that will let you bring your car all the way into the campground, which will save you many hours hauling gear back and forth between the parking lot and camping area. There are shuttles, but they're patchy late at night and miserably full when you're trying to get back to your car to leave. I'm guessing a car camping pass would have saved us about three hours of busywork and waiting around when it was time to leave -- I'm definitely getting one next year.

There are showers, but they are not free, and the line is long. Water is free, but the dusty ground makes it difficult to just string up a sunshower somewhere, because the runoff will flow downhill and soak someone's tent. If you have a proper shower enclosure (and some way to catch the runoff so you can dispose of it somewhere it won't be a nuisance), bring it!

There are security checkpoints within the festival, but they only care about checking your wristband; you can bring food and alcohol from your campsite to the main stages, as long as it's not in a bulky cooler. That said, there's plenty of great food and drink for sale everywhere, although it's pricey, and vegetarian (vegan, even?). Next time I'm bringing a supply of red meat, and a little tabletop BBQ unit. I was very jealous of the neighbours and their bacon breakfasts.

Not much point bringing a bike; there are a few there, but the whole space is small enough that walking isn't a problem, and the hills are quite steep.

If you're into yoga, bring your mat! I tried doing it on a beach towel, and failed miserably.

... more like this: []


Anyone sending out notification emails or messages to a mailing list: put the recipient's name in the To field

Gmail's spam filter is pretty good, but sometimes it misclassifies messages. These are normally messages from commercial mailing lists -- I'm guessing other Gmail users have reported messages as spam rather than figure out how to get off the list, and this has resulted in Gmail deciding the list is spam. I've found one pretty good indication that something labelled 'spam' is actually real: it includes my name. So I have a gmail filter that forces anything with my full name in it to go into the inbox. So - if you're sending out notifications or mailing list messages and you have the recipient's name, please put it in the message! Ideally in the 'To' field, but it would be a good idea to stick it in the message body too.

... more like this: [, ]


SF apartment bureaucracy

So, I'm in this temporary apartment, which is amazing, but way too expensive to live in for more than a couple of months. In the same building there's a much larger and nicer unit, which is also cheaper (by virtue of being unfurnished and requiring a 6-month rental). I'd like to move into the other unit, except that (a) I need to give 30 days notice to vacate my current rental and (b) the management company has an immediate move-in policy, which means that you have to start paying rent as soon as you sign a lease -- and the leasing agents seem to be very adamant that they never bend this rule. They also seem to be big fans of raising the rent between when you tour a unit and decide you want it, and three weeks later when your notice period at your old place is up.

As such, saying "I'd like to move into that other unit - how about I move right now but keep paying the higher rent until my notice period is up, so you get the same amount of money out of me except have a pricier unit free to re-lease earlier?" appears to be pointless, and so instead I'm going to have to go apartment hunting in a few weeks so that I'm not at the mercy of whatever random price increase they decide to enact. More work for me, less certainty for them. Yay big company policy.


Recruiter storm!

Wow. So, I moved to San Francisco in February, and the company I work for just did a round of layoffs. This isn't my first such experience (and thankfully I wasn't affected this time, which was a bit of a relief as my right to stay in the country is tied to me being continuously employed here), but what's different this time is that I'm actually living in the Bay Area, which means I come up when recruiters do LinkedIn searches for hiring leads. So far I've received 41 messages from recruiters - 23 on Thursday, 9 on Friday, 5 over the weekend, and 4 today. Crazy!

This is really interesting, because it's the opposite of the usual situation, where you put out a job offer and get a bunch of resumés. Now I see where people are coming from with their job application advice posts; there are some things you can do to really make your e-mail stand out a lot. Several recruiters have sent me vague "Job Opportunities in the Bay Area!" posts, including one who wrote today asking for a phone number where he can call me about some undisclosed position. These probably work OK when generally fishing for people to shop around to companies, but at times like this when everyone's getting dozens of messages, putting specific information in your messages would make it much more likely to get responses. If I'm ever sending out recruiting messages, they'll be titled something like "Web Developer (PHP/JS/CSS) opportunity at Fictional Software Company, Palo Alto, CA". Title, tech, company name and location. That sort of thing would seriously stand out.

(Just to be clear, I'm staying at Ning for now. Recruiters, thanks for your e-mails, though; they would have been great if things had turned out differently! Keep 'em coming; I won't be replying myself, but I'll summarise them and pass them on to the people I know who are on the job market.)


2009 - 2010

Well. I've resurrected my old blogging tool and blog data from my last laptop, so, prompted by Ben Ward's 2009 retrospective, here goes the first post of the new year. 2009's been... interesting. This time last year, I was interviewing with Ning, after Yahoo! closed the Brickhouse team/project/experiment that I'd been part of for just over a year, since late 2007. Brickhouse (and Fire Eagle, the project I spent most of my time working on there) was an incredible environment, where I met some very cool people and made a couple of close friends. I'm glad I had the chance to be part of it.

So, Ning offered me the job, and my priorities abruptly switched from trying to extend my Yahoo! contract to trying to wrap up and hand over Friends On Fire, the Fire Eagle Facebook app that I'd been working on, before taking off for the year's first trip over the Pacific, to meet my new coworkers and learn about the software I'd be working on, in late January. That all worked out well, and I had a great time in Palo Alto.

I returned home, had a crazy week trying to be productive on this codebase I'd barely scraped the surface of at the same time, after which my appendix gave up the ghost, putting me in hospital for the next three weeks, then off work for another three!

The rest of the year has been a bit of a blur. I've travelled a lot: Wellington, Auckland, Adelaide, San Francisco, Munich and London, plus a couple of smaller trips inside Canterbury: Peel Forest, Loburn, Hanmer Springs, Arthur's Pass. Reconnected with a bunch of old friends, and made many new ones. Spent a lot of time at the Christchurch Creative Space and with the people who hang out there. Visited almost all of my family living outside Christchurch; in five different cities: my brother, two cousins, an aunt, and an uncle and his family!

At some point in August, I mentioned to my boss that I'd just booked flights for a visit to San Francisco, and was planning to drop by once every few months, and she asked "well, how about moving here instead?". I slept on it, and took her up on the offer the next day. The process of getting a working visa was surprisingly smooth, and in November I found myself the proud holder of a passport with a US H1B visa sticker, and a whole set of new things to do to tidy up my life in New Zealand for easy transport (or storage).

Another notable thing to mention is that I picked up an old hobby: DJing. I dragged my turntables, mixer, stereo and records down to the Creative Space every week for a little while, then took the whole rig out to the Melting Man outdoor dance party, where I met the Mystiq Catalysts, who introduced me to drum & bass and the Serato line of digital DJ equipment. Since then, I've played several times at their Thursday night jam sessions, and have started running my own dance music club night, "Midweek Mix", on Wednesday nights at Foam, the same club. I suppose you could call it my first DJ residency? Now, with the move date getting closer, I've been spending the last few weeks trying to digitize as many of my 12" vinyl records so I can take the music with me and DJ in America without having to carry the (rather heavy) physical media. It appears that the type of music I used to DJ (or "spin", which seems to be what people in SF call it) from 1999-2002, trance and progressive trance, has fallen out of favour at home but still has a bit of a following in SF, so it'll be interesting to see how things go when I make it over.

So, now, all the Christmas and New Year celebrations are over, and it's back to work! 2009's been a transition year for me -- between one stage of my life that ended with the hospital stay, and another, that'll start when I arrive in California -- and the best year I've had in a long while. I'm excited to see what 2010 will bring ...

Some more 2009 retrospectives from friends: Laurie, Greg, Soo, Marc.

(No comments here any more, but you can comment on this on Facebook, if you're my friend there.)


Fixing backspace when ssh'ing to Linux servers in OS X 10.5

For some reason the default OS X terminal program,, sets TERM=xterm-color but doesn't send the correct keycode that a colour xterm would send when you hit backspace. The solution is to set TERM=rxvt.

The instructions at the end of that link are a bit out of date; here's how to do it on OS X 10.5.6:

- Open Terminal.

- Hit Cmd-, or select Terminal > Preferences from the menu, to bring up the Preferences.

- Click Settings (the second icon from the left in the bar along the top).

- Click Advanced (rightmost tab).

- Select 'rxvt' after 'Declare terminal as'.

- Uncheck 'Delete sends Ctrl-H'.

... and you're done. You might also want to click through to the Keyboard pane and select 'Use option as meta key', which is useful (although I wish I could use Command as the meta key).