Going on my second week in California and I'm already ready to go home. The weather in California is beautiful, and driving around in a convertible kicks some serious ass. But nothing can beat being surrounded by circuit boards, ICs, and my equipment.

I actually got a lot of stuff done on this trip like visiting my sister's family, seeing my parents, visiting the SF hackerspace, catching up with live Zigbee members, hanging out with old friends, ordering export controlled 2.4 GHz radios and MCUs, and of course, work. By far, the two most stressful events were work and seeing my parents. I'd have to say it was a tie.

The parents are still complaining about my lack of a job and wondering why I don't pursue a nice, stable corporate career. I tried to explain to them that such a thing doesn't exist anymore, but unfortunately, they didn't buy it. At least they've eased up on pressuring me for a grandchild.

I'm excited about the chips I ordered while I was here. When I first came, I tried to order a bunch of CC2520's since those radios are conspicuously missing from my parts inventory. The problem is that Digikey and Mouser don't ship them outside the US due to the onboard encryption engine which puts them in an export controlled category. That restriction only penalizes people with non-terrorist ambitions since any self-respecting terrorist wouldn't let that stop them from getting a chip. Hey, if they can get nuclear weapons...

Anyways, after about a week, Mouser suddenly got 400 of the CC2520s in stock so I immediately grabbed 200 of them. Just got the tracking number today so I should be receiving them before I leave. 

Another interesting chip I got was the ATXMega128 which is one of the newer AVRs. Yes, I'm an Atmel fan and no, I'm not sponsored by them. The interesting thing about the XMega is that it has an onboard AES security engine which should alleviate the vulnerability found by Travis Goodspeed when the keys are transported across the SPI bus. I'll probably be testing it out to see if it can be used for the Zigbee Security Manager. 

And finally, I found a cute little chip in the ATMega32U4 which seems to be quite new. It's got 32kB flash, 2kB RAM, and integrated USB. It has fairly perfect proportions of RAM/flash for a fun project chip, plus integrated USB which I can port my stack to. I grabbed a bunch of those as well and will be playing with them more in the near future. 

Anyways, until next time...*smooches*...

A strange phenomenon occurred where many people started posting very interesting software on Twitter. The attraction is that Twitter limits posts to 140 characters and so it's a challenge to see what type of functionality you can implement within that 140 character limit. I've been completely astounded by the quality, functionality, and creativity of these twitcodes and I've decided to archive them here. I hope you can enjoy them as well.

I just did a massive purge on the blog of 75% of the users. All deleted users were checked against the botscout database for matching spambot signatures (ip and email address). Nevertheless, if anyone has any problems with logging in, please send me an email through the site. Or you can also PM me.

I've been getting a lot of emails on the status of the Zigbee stack recently and its probably because it looks like nothing is going on. Actually, there is a lot of stuff going on but its pretty much behind the scenes and the details don't make it on to the blog. So I finally gave in and created a Twitter account, in case there's any curious souls that want to know the mundane trivialities that I'm doing battle with on a daily basis. Well, that and apparently, all the cool people in the WSN industry seem to be on Twitter.

Here's the Twitter link: 


Just saw an article mentioning that Peter Alfke from Xilinx is retiring . He's a legend in the FPGA community and was an FPGA guru on the Usenet group: comp.arch.fpga . I remember when I was just starting out designing with FPGAs back in another life, I was completely clueless about how to use the devices. His posts were my textbook and I gradually got the hang of taming the wild beasts. Back then, the FPGA compilers were complex and bug-ridden, the chips were completely cryptic, and it would take a whole day to compile a design on a Pentium 100 MHz PC. At least the PCs are faster now :)

Goodbye Peter, and if I ever get a chance to work on FPGAs again, I'm going to google your posts on the Usenet archives. Although I didn't know you personally, I felt like I did...

Along with working on the RF hardware for the Zigbee development platform, I've also been pretty busy with helping get the Tokyo Hackerspace up and running. This past Saturday, I co-taught a class on basic electronics for members of the hackerspace as well as the Tokyo 2.0 crowd.

The Tokyo 2.0 group is mostly a bunch of IT people in Tokyo that get together once a month to talk about all things tech/IT/internet. The meetings are semi-networking events where you can see a bunch of hipster geeks sipping beers in a night club turned conference hall with a DJ spinning carefully selected non-intrusive music. I figure they're trying to recreate the hip, tech vibe that you see at events in San Francisco or SXSW (South by Southwest). 

The last talk was about cloud computing and I actually went to check it out since I had no clue what cloud computing was. After the talks, I can definitely say that I still have no clue. It seems it means different things to different people, but in my opinion, it just sounds like a fancy name for cheap web hosting. 

Anyways, the class turned out pretty good and everyone was enthusiastic to learn about electronics. It wasn't easy teaching the basic principles of electronics within two and a half hours, but we managed to pull it off. These days, you pretty much just need to know a bare minimum of theory since the main goal is usually to get the signal of interest into a microcontroller. However we had to conceptually explain and show what resistors, capacitors, diodes, voltage, current, and transistors were. I think teaching basic electronics is much more difficult than teaching more advanced topics because you have to really have mastered the fundamentals to teach it well. It was certainly a challenge to explain things in a way that non-electrical engineers could visualize and understand conceptually.

Along with that, I also got the first batch of the Tokyo Hackerspace development boards back. We'll be selling these in order to raise funds to buy equipment like oscilloscopes, soldering stations, and furniture. It's also going to handily serve as a common platform for future workshops that we do for embedded programming and analog interfacing to digital circuits. 

When we were discussing the boards, I gave people the option to choose different solder mask and silkscreen colors and made it a majority vote decision. The winner was a red silkscreen with a white soldermask since that was supposed to be symbolic of the colors of the Japanese flag. However the red lettering over the white solder mask made the silkscreen come out pink. I was surprised at first, but it really grew on me. The color scheme is definitely different than any other boards I've seen out there, and it appeals to the girls in the group who wanted a girly board. FYI, a lot of the guys wanted a red mask with black silkscreen which was a bit overly testosterone-charged. It would've made the boards look like video cards.

Also, I threw down some cash and bought some cheap, surplus multimeters from Akihabara for the group. It's mostly symbolic, but it's to show that we're taking steps to equip the hackerspace.

Overall, things look like they're moving forward  quite well. The space/studio is already rented and we should be moving in there next month. We're also planning an art/tech exhibition inside and inviting different artists and IT people to collaborate on it. 

So basically, with this and Zigbee, looks like things are going to be getting pretty busy for a while.

Here's a couple of pics of the boards and other miscellanea...

{gallery}2009-07-27 THS Boards{/gallery}

Took a half day off yesterday to hit up Wireless Japan 2009. One of the things I noticed about the shows this year is that they're much smaller than the events that were held last year. I guess show exhibitors is a pretty decent gauge of the economic health of an industry.

One of the things that surprised me is that I actually knew people at this year's Zigbee Pavilion. I guess the Zigbee community is pretty small. A couple of people actually recognized my blog as well which surprised me. I've spent so much time isolated in Japan that I have no clue about the audience, other than the webstats. And I suspect that half of the webstats are actually computerized bots that just want to spam my site. 

One thing that disappointed me was that TI Japan was conspicuously absent. I was hoping to talk to them because I'm not getting any responses for inquiries on purchasing the radios from the Japan disti. I was hoping to add some CC2520s to my dev board radios since they currently seem to be heavily weighted towards Atmel.

Speaking of Atmel, I was talking to the Atmel product engineer and he mentioned that there are a lot of things coming out soon on the Zigbee front. He was pretty straightforward about them so  I don't think they're a big secret (the datasheet was visibly open on the laptop and he was carrying samples in his pocket). They should be an announcing a single die AVR + radio based on the AT86RF231 soon. This would be a major improvement because their previous multi-chip modules that combined the AVR and 802.15.4 radios didn't seem to get very popular within the 802.15.4 community. You know its bad when they don't even have dev boards with the chips on them. Their most popular dev kit, the Raven, has a discrete AVR MCU and radio. They should have some new dev boards out soon as well.

I was also complaining to him that Atmel was ruining the price of dev kits and modules for everyone by pricing the Raven USB sticks at $40. He just smiled and said that it wasn't the first time he heard that complaint. Apparently, the original price for the Raven USB sticks were $29 but they had so many complaints that they had to raise it to $40. Damn...if they had to buy their own chips, they'd be losing shitloads of money. Other than that, the Atmel guy is totally cool and I told him that if he had free time, we could go to dinner. I hung out with him last year too and the guy's a total trance head. He would stay out until 5am and hit up the trance and techno clubs. Heh heh...my kind of engineer...

Checked out the new Ember EM351 ARM Cortex chips too. I have a feeling that they'll be popular in the metering industry since the current EM250/260 series is currently bursting at the seams in terms of code space. It's probably due to all of the security and features that got added into the Zigbee Smart Energy profile, so the Cortex lineup should ease things on that front. 

And one of the things that kind of made me sad was seeing the ANT display at the front of the Nordic booth. ANT is a separate company from Nordic, but you can buy ANT chips which are Nordic nRF24xx chips with the ANT stack in the flash pre-programmed. The problem is that Nordic is making a heavy push towards Bluetooth Low Energy whose guns are aiming directly at the market that ANT made a niche out of. ANT has a good following in the personal health and fitness industry because the protocol is low power, small, and uses the nRF24 which is fairly cheap. However Bluetooth Low Energy is competing directly in this market, plus they have the backing of the cell phone giants and connectivity with Bluetooth enabled cell phones that sport dual mode chips. It's probably going to put the nails in the coffin of ANT if BLE is anywhere near as successful as they hope. It was also the first time that I heard an ANT rep bash a protocol other than Zigbee which was quite amusing.

And finally, here are the pictures. I threw in some eye candy just to see if it'd attract more visitors to the site. If so, then I might turn this into a combined Zigbee/trade show models site. Something similar to LowRider magazine and they're artistic use of females. Enjoy!

{gallery}2009-07-24 Wireless Japan{/gallery}

Yeah, it's been a nice little vacation from the Zigbee stack for me. You wouldn't believe how fatiguing it is to focus on one thing for a year and a half. The stack became part of my life, like I was growing a third arm (or a third leg...*ahem*). So intead, I've been focusing on building hardware development boards that I can use to set up Zigbee networks for real-life testing of the stack. Although it's going to take some time, in the end, I'm sure it will pay off. There's nothing like having access to a large supply of development boards that you can use as wireless sensor nodes. At least it beats having to purchase something like ten raven kits.

However that's another story. I've been spending a bit of time getting the Tokyo Hackerspace boards up. There was some initial hardware flaws that I found but after they were fixed, I got the board up fairly quickly. I was worried about porting my USB stack on to it since the AT90USB16 USB controller is different from the ones on the Raven board (AT90USB128). As an engineer, I was expecting all types of things to go wrong and was ready to pull out the USB protocol analyzer. Lo and behold, after the initial register configuration, the USB icon popped on to my screen and it came up as a COM port.  It was probably one of the first times for me that bringing up a board went so smoothly.

I can't really say that I was testing the boards out. It was more like playing. Working on the stack for so long prevented me from messing around with smaller circuits and trying out fun things since I was putting pressure on myself to get it running. However being part of Tokyo Hackerspace gives me an excuse to explore different components and try things that might not necessarily be WSN related. In essence, it gives me permission to play with electronics which is great.

I was worried that the AT90USB16 might not have enough juice to do a lot (500 bytes RAM, 16kB flash) but I figured I might as well try. So the first thing I did was throw up a command line on the THS board. I just re-used the same one I'm using on FreakZ so it went pretty fast. Once I got the command line going, it was time to play. I wrote a command to toggle the various LEDs on the board, but that got boring pretty quickly.

I wanted a way to demonstrate to the Hackerspace members how it could be used for rapid prototyping of small circuits. That's always a big obstacle because people talk a lot about different things they want to design, but the bottleneck is always in implementation. If it were easy to do a proof of concept implementation, I think it would ease up the design juices and let people get more daring with what they attempt. So I figured that GPS might be a bit impressive. I just happened to have a GPS module given to me from my friend in France. It's quite a nice one and goes for $60 on Sparkfun. The specs are very impressive: it can track 32 satellites at one time, can track position info even in deep canyons and dense foliage, and can update position info up to 5 times a second. Just what you'd expect from a geek gift and something I'm definitely going to use the next time I'm trekking through the dense jungles in Southeast Asia. 

Well, since it was just collecting dust in my parts bin, I pulled it out, soldered some headers onto it and prayed that it still worked. Let me just say: 3 wires, 8 lines of code, and no soldering. It was totally sweet! I was getting raw GPS position data and dumping it to the console. The breadboard peripheral was even better than I had hoped. 

After that experiment, I decided to play with the RGB LED. This is all in preparation of doing a demo to the Hackerspace folks with the board. I wanted to generate some excitement so that people can get motivated to think of interesting projects. I had previously talked to one of the members about designing LED based jewelry. He had mentioned that most of the LED accessories blink which is harsh and gaudy. He wanted something that would slowly pulse which is a more subtle effect for an illuminated accessory.

So I took some time to write some PWM code to control the brightness of the LEDs on the RGB LED. I basically had a 100 Hz update rate (10 msec period) for the PWM and divided that up into 255 intervals of ~40 usec. It's easier than it sounds. After that, I just had a simple counter that kept track of the phase and would turn off each of the LEDs if it matched the counter. Basically, it was just standard software PWM. I implemented some commands to manually control the brightness and also commands that could pulse the red, blue, or green LEDs with a specified pulsing interval. I think I'll probably re-use the same code for the AC light dimmer that I'm going to be using to test my Zigbee Cluster Library implementation. 

So anyways, here's some pics of what I did. I also presented it to the group last night. I can't remember the reaction very well though because I was kind of drunk. Pretty typical for a hackerspace meeting...

And in case you're curious, the final memory footprint including USB stack, command line, PWM, LED pulsing, and GPS was slightly under 8kB flash and about 280 bytes RAM. Looks like the tiny machine can pack a bit of a punch...

{gallery}2009-07-08 THS Boards{/gallery}

Today was kind of strange. The PCB files went out, the parts have been ordered, documentation's been written, license was changed, and the release was issued. I really had nothing to do today and it was a strange feeling. I started getting fidgety so I decided to investigate a problem with my USB device stack on Linux that someone reported. No problem found...worked on Ubuntu. Great. After such a long time pushing myself with all the stuff that needed to be done, having an involuntary free day like this was really eerie. I didn't know what to do with it.

Another strange thing was that Michael Jackson passed away. I was always a big fan of his, since my days as a pro dancer. If you're in the entertainment biz, you can't help but admire MJ, who was one of the few people that really knew how to put on a show. There's a reason why MJ, JJ (Janet Jackson), and Madonna are still the reigning icons in pop. My wife was devastated. She's a member of an online social fan club for MJ in Japan and I had to pretty much forcefully hold her back from buying a ticket to LA.


We had the second meeting of the Tokyo Hackerspace today and I got a chance to present the design idea I had with the development boards. The response was more positive than I expected. We also got a chance to discuss what everyone wanted to get out of the group. I know I've mentioned this before, but there is a huge amount of IT brainpower and experience within the members. A lot of the interest centered on interfacing electronics with web services and physical computing. I'm still trying to get a handle on what physical computing actually is, but I suspect that it's where you interface a PC to real objects like sensor gloves and clothing. Rob Faludi, if you're out there, could you please enlighten me on this subject? 

Anyways, one of the best things is that there is so much energy to learn and try new things. It's like the complete opposite of working with real engineers. I suspect that I'm going to learn more than they will when all's said and done.

In the meantime, one of the issues I think we're going to face is to distill all of the areas of interest into things that are do-able. I think the best way to describe this would be how to separate things into baby steps so that we can actually make progress on hardware hacking and cool projects. I was discussing this with one of the other electronics guys and we think that, on the electronics front, there needs to be some workshops on fundamental electronics and embedded programming. On the other side, I think that we also need to tap some of the computing brainpower for web services and how to access them, as well as the experiences of the artists, musicians, and chefs. Once we can start diffusing the knowledge and experience, I think there's no limit to the design possibilities.

One thing I'm pretty sure of is that Contiki and uIP are going to be really popular. I'm going to be bringing in the Raven wireless boards at the next meeting and showing them some basic Zigbee functionality as well as explaining 6LoWPAN (IPv6 over 802.15.4 for the uninitiated). I'm pretty sure that it's going to spark a lot of ideas. 

Stay tuned, because I think this group has the power to realize a lot of the things that the WSN industry is just talking about. At least...(*buzzword alert*)...the Internet of Things, as applied to real things...

A lot of people waiting for the code release are probably wondering what the hell I'm doing. In fact, I'm even wondering that myself sometimes. The truth is, I've been spending all my free time in the last week and a half trying to design development boards for the stack. So I've finally finished the schematics for six different boards, three MCU boards, two radio boards, and a peripheral board. Designing the boards is actually quite fast, and if it were just a matter of putting the components together, then I think I can usually put together a board in a couple of hours. The problem is that component selection takes a long time. Have you ever seen the DigiKey catalog? That thing puts most phone books to shame.

One of the issues with component selection is finding a reliable supply of components. DigiKey has a habit of running out of components right when you need them, so I've been trying to choose components that are generic enough to have a second source supplier. On top of that, I'm trying to use components that I can source locally in Akihabara in case I get into a pinch in terms of delivery schedules. Along with that, you have to check the package sizes, draw the circuit symbols, the PCB footprint, and check the specs to make sure everything is kosher before you actually take a chance and throw it on the board.

The reason I needed to get the schematics out of the way is because I needed to place the orders as soon as possible. Once the orders are placed, then there will be a time lag that would allow me to do other things like finishing the docs and doing the PCB layout. Also, I wanted to grab the components off of DigiKey as quickly as possible because some of them were disappearing quickly. One of them was the DC-DC boost converter from TI (TPS61202) that can boost a 0.5V source up to 5V. I was planning on using these for my main MCU boards so that it would be easy to interface them to batteries and solar cells. Since they were new and energy harvesting is kind of a trendy thing in electronics now, they were disappearing quickly. I finally bought out the last of the stock from DigiKey so they're completely sold out until the next shipment. The MCU boards that use this chip will be a limited edition until the supply stabilizes.

Along with the wireless dev boards, one of the MCU boards I designed was for Tokyo Hackerspace. There are a lot of people there that are curious about electronics and want to learn more about it. So I put together a low cost board using a USB AVR (AT90USB162) with 16 kB flash. The board has the same modular connector that I'm using for my main dev boards so it can interface to the same peripherals. One of the peripherals that I created specifically for this board is a quick prototyping area using an adhesive-backed solderless breadboard. It's those white plastic things with a bunch of holes that you had in electronics lab back in school. Anyways, since the breadboard can plug into the MCU board, it will automatically have a 3.3V and 5V supply as well as GPIO, interrupt, I2C, and SPI lines. I think it's going to make a good learning platform for the people curious about electronics in Tokyo Hackerspace.

The plan is to make a "class set" of about ten boards that everyone can use free of charge and can also be used for a common platform for workshops, classes, and collaborative projects.  If people want their own personal board, they can purchase it through Tokyo Hackerspace with the proceeds going to buying basic equipment like soldering irons, hand tools, meters, and scopes for the group. 

Also, I'm thinking about what kind of workshops would be interesting. Along with basic electronics and programming, I'll probably collaborate with one of the other geeks on electrical/mechanical interfacing, and of course I think sensor interfacing will be quite fun. I'm also hoping that I can do some more advanced topics like embedded web servers using Contiki and uIP, and of course hands-on tutorials with the FreakZ Zigbee stack, but I'm going to have to wait and see on those ones since they require quite a bit of programming knowledge. 

I'll keep everyone posted on how things go with this, but Tokyo Hackerspace looks like it's going to be fun and keep me a little busy. Here's some shots of the initial MCU and breadboard PCBs for THS. No, the tower in the logo isn't the Eiffel tower. It's the Tokyo Tower located in Roppongi and is part of the Tokyo Hackerspace logo. One of these days, I might even go check it out:

AT90USB162 Dev Board for THS

Breadboard peripheral for THS