Monday, April 16, 2012

AVR JTAG programming oddities

I recently launched a new project, I'm working on a bench power supply. I've wanted to do the "old ATX PC PSU to bench power supply" thing for a while, and there was a recent series on the EEVBLOG whose design I'm taking a lot of inspiration from. (That David Jones is a freakin' genius). I want to have a little more "kapow" than his design, 0-9 V, 3 channels. I don't know if that's a folly on my part, but time will tell.

I finished up the "thinking a lot about it" phase, where I watch TV and daydream about what I want to do, and I moved into the prototype/experiment/pre-design phase.

I'm going to use an ATmega 644 as the main MCU to drive my logic. I'm wavering between that and the ATmega 328, but I just think the 328 probably doesn't have enough pins.

I've thrown together a few lines of code for doing the LCD display logic, using a "HD4478x" library for AVR's I found on the internet(I'll wait until my project is farther along before giving credit, since I might swap it out or roll my own in the end).

I went to test on a breadboard tonight and I discovered something very perplexing that I've not run into before...

Thursday, April 5, 2012

Wifi Links.

I haven't made any progress on the Wifi project lately. I've been on a pseudo-vacation for the past week.

In case you've landed here from Google with an interest in the MRF24WB0MA Wifi board from Microchip, I've got  few interesting projects I've run across you may find interesting.

"Jeff", trying(unsuccessfully?) to get the board working with an Arduino:
http://jmsarduino.blogspot.com/2012/01/mrf24wb0ma-not-working-yet.html

"Manis B", got a webserver running on an Arduino with the board:
http://theiopage.blogspot.com/2011/10/connecting-mrf24wb0ma-to-arduino.html
(Also, really nice, pragmatic setup with connecting the pads, made me realize my mount was overkill - but fun)

"Blondihacks", did extensive experimentation with the board with an Atmega 168:
http://quinndunki.com/blondihacks/?p=840
(Also, a fantastically done write-up, even though she deems it "a failed experiment")

And last but not least, one for my favorite blogs, Dangerous Prototypes, recently posted about a MCW1001A chip that is a companion to the MRF24WB0 boards that implements the TCP stack for you and communicates via UART:
http://dangerousprototypes.com/2012/04/04/mcw1001a-tcpip-socket-communications-interface-with-gpio/

--P

Tuesday, March 27, 2012

CPLDs, and the importance of knowing when to quit.

As an engineer, I can have a natural tendency to become obsessed with problem solving. Every problem I come across is a personal test, "If this problem is solvable, I will be victorious, I will conquer it". I think the hard thing can be recognizing when the solution isn't worth the effort. The ability to spot this before others is what can make a great manager, that's not what this post is about, however.

Let me tell you a little story about CPLD's:



Now if you ask my wife, she'll tell you I'm the cheapest, stingiest man alive, if you ask my mother, well she'd probably agree, but if you asked me, I'd tell you I just take pride in being resourceful. I've always had a hard time paying someone to do something I could easily do myself.

Friday, March 23, 2012

Power.

As a technophile, I think we're living in some pretty exciting times. (Wait, does "technophile" mean I like glow-sticks and pacifiers, or gadgets and software?). I think we've only hit the tip of the iceberg so to speak, in human progress, I often wonder what life will be like 500 years from now. Will this blog be archived on a microscopic chip containing all web content of the 21st century? Will a server in a city in a Martian colony house such a chip? Who knows? I probably wont, unless the secret to immortality is unlocked in the next 50 years or so (not necessarily so far fetched, either, wow!)

Anyways, there are some pretty big hurdles to overcome before we achieve total technological enlightenment as a species, and I think currently, there is no bigger obstacle than power and energy. The predominant technology in use for alkaline batteries has not changed significantly in over fifty years. What other area of technology has progressed that slowly? Oh wait I know, the other predominant portable energy-store, petroleum based fuels. Gasoline is pretty much the same thing folks were using 100 years ago. Why has nothing better come along? Well, the old technologies have a lot of benefits that have proven difficult to exceed in all aspects: simple, cheap, safe(relatively speaking), and dense. It's hard to beat the energy density per dollar of a AA battery or especially a gallon of gas. The problem is that they are not good enough, and will only hold us back. I don't have the answer. If I did, I'd probably not be putting it on a blog, but programming atmegas sipping mojitos on a Martian colony financed with the trillions I made cashing in on my solution (maybe I'd even break down and buy a Windows Phone, I do want one).

Somehow this post developed into an offbeat segue into what I really wanted to mention in a short post...

In researching mobile power options and designs for future projects, (2012 is the year of the robot, I mean it this time!), I ran across this on Hack a Day. A clever device utilizing a boost converter to suck the last drops of juice from a pair of AA's. This is not unlike, in principle, the myriad "Joule thief" type circuits various people have built and documented on the Internet, but I'm particularly impressed with this guy for a) putting together such a well thought out design, and b) turning this idea into a product. Check out his his blog about it here.



The utility of the device is extremely well thought out, you can use it as a raw power source, but there are also placeholders on the pcb to turn it into an led flashlight, or a breadboard power supply. There's an on-off switch as well as a switch for selecting 5 or 3.3 volts from the regulator. There's also an led power-on indicator.

The fact that he turned his passion into a marketable product, however is probably the most inspirational thing to me. I'd love to turn my hobbies into something that is financially rewarding as well as soul fulfilling. I'm going to pick up a few of his converters with next my next hobby budget cycle.

--P

Wednesday, March 21, 2012

Android ADT r17 released today.

[Updated, it's the ADTr17 that's was released]

Google released the final/stable version 17 of the ADT today. There are a number of fixes and improvements that almost make me feel that the fine folks at Google read my blog, or at least are inside my head, reading my thoughts - which is entirely plausible too.

Check out the full release notes here

Of special interest to me are:


  • Better, automated jar dependency support: link
  • "Added a feature that allows you to run some code only in debug mode. Builds now generate a class called BuildConfigcontaining a DEBUG constant that is automatically set according to your build type." While this does not address my grievances, it's a step in the right direction.
  • Hardware virtualization support for emulator images based on x86, link. I haven't tried it out yet, but I'm keeping my fingers crossed that this gives a much needed shot in the arm (see what I did there?) to emulator performance. *And yes, I know my pun didn't really make sense.
  • Support for hardware GPU on the emulator: link. This is a big one!   Maybe the openGL support is better on the emulator now too.
  • Fixes for Proguard, with the "Conversion to Dalvik format failed with error 1"issue fixed. I wasted an entire evening and then some on that once, though I eventually fixed it by splicing a newer version of proguard into my local ADK.

I have a new version of Sedition almost ready to go, with only minor tweaks needed (most of the time needed will be QA'ing my tweaks). I think I'll wait until I publish again before kicking the tires on this release.

--P

Sunday, March 11, 2012

MRF24WB0MA Wifi board update.

Success!
(For various values of  'success' at least)

I finally have the board physically put together:

Not pretty, but I think it will work.

After drilling the pcb holes for the .1" headers, I am now certain that surface mounting was the way to go for the daughterboard. I never would have been able to get the accuracy needed with my uber cheapo drill press, it actually moves about 0.5mm when you apply too much vertical force to the press, so about half way through the job I realized that slow drilling was the key to better accuracy. Still, I don't think I could pull off drilling holes for 0.05" headers.

To do a surface mount solder, I "pre-soldered" the pads where the board would be sitting:

Thursday, March 8, 2012

Perfectly etched Wifi host board

I did a second take at doing a toner transfer. This time it came out flawlessly. I did a few things differently. I dont know if any or all of these thing contributed, but I really could not have hoped for a better result.

Here's what I changed:

  • Used a part of a glossy magazine that was mostly white space. The first printing was on top of a color image in the magazine.
  • Once the magazine was lying on the copper, I covered it with a small piece of laser printer paper, instead of ironing directly
  • Maxed the iron setting, and waited a good 10 minutes before starting to iron.
  • Used constant motion of the iron, and made sure that all parts of the iron visited all parts of the copper, so that whatever "sweet spot" that was yeilding good transfer was hitting all parts of the copper.
  • Ironed until I did 300% of what I thought was necessary, basically ironed the crap out of it.
  • Let it soak in water for 2 hours before even attempting to remove the magazine paper from the copper.

 I dremeled and etched the board this evening, and even let my kids watch from a distance.


Fresh etched board. It's not soldered yet.

Tuesday, March 6, 2012

Microchip Wifi update.

My wifi board project has moved kind of slow lately. When I last left off, before the holidays last year, I had ordered 1.27 mm headers needed to make my planned adapter board to a more reasonable 2.54 mm pitch. I've been working with the awesome KiCid to design the adapter. While KiCad is amazing in what it lets you do for free, the user interface is not the most intuitive (I common phenomenon it seems in software designed be hardware people). It turns out that I think I may forgo the 1.27 header and try to mount the Wifi daughter board surface mount. I have a low-end pcb drill press for drilling through-holes, but I have serious doubts that I would be able to drill with the precision needed.

Anyways, I took the plunge this evening and decided to attempt a toner-transfer to a copper-clad. The result is this:
Try again!
I find myself trying to remember some Edison quotes about failure and perseverance. When I was ironing the thing I was convinced it was going to come out perfectly. I thoroughly washed clad ahead of time, I found the glossiest magazine paper I could find, and I ironed it for so long that I thought I was going to scorch the paper. Yet you can clearly see in the top traces where the steam-holes in my iron where. 

I was doing this late night, my whole family was asleep, so I tip towed through the house, fruitlessly searching for my wife's nail-polish remover, to remove the toner. 

As far as my final plans for what I'm going to actually do with the board, I'm leaning toward trying to make my own device inspired by openPicus. It is a general purpose standalone Wifi/tcp/http enabled I/O board. My only problem is that the pic chips I have are not nearly powerful enough to run the openPicus firmware, and I'm having a hard time finding dip PIC24's with 256k of flash, so I may peruse the code and see if I can use a subset of it.

--P






Wednesday, February 29, 2012

Back by unpopular demand.

My posts have trailed off lately. I aim to change that. I was approaching burnout late last year with all that I had going on in my life. I'm easing back into things, taking care not to over extend myself.

Burnout can take a surprisingly long time to fully recover from. It's not that I've not kept busy, I put out a new version of Sedition, and taken on a new job that requires a lot of learning new things (which I love).

--P


Sunday, January 22, 2012

Cloudifying Sedition

Recently, Sedition "0.0.3.0" hit the various Android markets I publish to. It was supposed to be the version that finalized the feature set. Of course, I can leave it alone. I've recently started a new job, and for the first time, I work on web/server/'cloud' based technologies. It is interesting in that I absolutely love learning new things, but it's also tough in that I have so much to learn before I feel I can develop software with the speed and craft that I can with desktop and embedded software.

In the previous version of Sedition, I'd experimented with a high score library called "Score Ninja", a mostly painless way to add a high score system to your game. You go to the Score Ninja website register a game, and get a game id, then download a jar and link your game with that, with a few calls into the library to post or retrieve scores. Users are required to download a scoreninja app from the market which handles all of the communication.

Friday, January 6, 2012

Crufty New Year!

It's been quite a month for me on the personal side. I've switched jobs, hosted my family for Christmas, and spent the week before Christmas in California for training for my new job. I've never written much about my professional life on this blog, but I will say that I'm no longer in the video game industry, and I get to work mostly from home, and I'll get the chance to work in Scala, so it's a good thing!

I really wanted to make a new Sedition release before the end of the year, and I have been putting a lot of work into it in the last month, considering what little time I've had. I even spent a few hours on a layover in the Dallas-Fort Worth airport coding. (A paranoid part of me wondered if someone might look over my shoulder and see me writing code about bombs and explosions and get the wrong impression :) ).

One unexpected snag I ran into was that I decided it was time to update the ADK  and all the 3rd party libraries I was using before the next release. I ran into a few tough-to-figure-out problems. If I had skipped the ADK/3rd party lib updates, I probably would have been able to make a release by now.

Nothing to report on the electronics front, I'm focused on Sedition, and recovering from the verge of burnout from spreading myself too thin last year.

-P


Wednesday, December 14, 2011

Stuck in Blender Past

Work on Sedition has picked up a little. I multitask projects like crazy, it keeps me from getting burned out on any one project, though progress on any given project feels glacial at times.

Anyways, I use the awesome Blender for my 3D models in Sedition, and export them as Quake "MD2" files. I'm a programmer by trade, not so much a digital artist. I selected the MD2 format because, it's simple, compact, has a well documented schema, and supports key framed vertex animation. Also, because Blender 2.49 supported exporting to the format. As I write Blender, is up to 2.60. (Actually 2.61 came out today). The 2.5x release was  major overhaul of Blender, most if not all Python scripts written against older versions will not work.

There is no Blender 2.50+ supported MD2 exporter, I've thought at times about writing one; I did make heavy modifications to the older exporter, to fix a lot of bugs it had with index organization in animated meshes. I would have released it, but I also broke/removed some features that I don't use in Sedition, such as "GL Commands". The latest Blender is beautiful and slick.

I have an asset for Sedition that for some reason displays incorrectly in Blender 2.49, though it exports correctly.

Asset for upcoming Sedition feature "HyperBombs"
The material renders all wrong in Blender 2.49, only the
center sphere is supposed to be red.
I opened the asset in Blender 2.60 and it was perfect.

The same file opened in Blender 2.60. 

Working with my exporter was probably one of my least favorite part of working on Sedition. I'd really love to work in Blender 2.60 and I'd really love to be able to "pay it forward" by making a new reporter, but I fear I would loose my sanity in the attempt. If there were an easy way to debug Blender Python scripts besides copious print statements, I think we'd have seen more exporters already. 

-P

Saturday, December 3, 2011

New Graphical Programming Tool for Arduinos

I've mentioned before that I'm a beg fan of the graphical programming paradigm as an educational tool.

Ardublock:

http://blog.ardublock.com/

Is probably the most exciting embedded development "GP" tool I've seen yet. It's well done, and it integrates into the Ardiuno IDE very nicely.


--P


Tuesday, November 29, 2011

The Leaf Barge

I live in a 15 year old suburban neighborhood in North Carolina. I've only been in the house for 6 years. More than likely, the neighborhood was carved out of prehistoric forest in the early 90's. About half of my backyard is "wooded" and most of the trees are much older than 15 years. Every autumn, an epic (and I'd add "futile", but never in my wife's presence) battle is waged against the leaves. I've got a few large oak trees, and a Bradford Pear, and a "Gum" tree, and a few that I have no clue what they are, but they all fall into one Genus I call "leaf droppers", somewhere between 50-60 in total.

The battleground.

Monday, November 28, 2011

Tiny Gecko ^h^h^h^h^h^h^h^h^h^h + Microchip Wifi Project update.

I finally got my 1.27mm headers in today. They were coming in from China after all.... I didn't pay a lot of attention when I ordered.

Anyways, to recap: the guys at Farnel hooked me up with this wifi board. I planned to use it with my Tiny Gecko demo board. The Microchip board is heavily geared toward using it with PIC processors, but they release the source code to a tcp/ip stack. My plan was to port the Microchip stack to run on the Gecko, shimming in Gecko-native SPI and interrupt code in place of the PIC code.

While I was waiting for my headers, I figured I'd start working on the port, so that when the headers arrived, I'd be almost ready to connect it to my Gecko. I got about 1/3 of the way into it, and realized I was doing more work than it was worth. I decided to scrap the idea of porting the code. I'm just going to use a PIC chip, and treat it like a high level tcp/ip "black box". I'll use a UART, or maybe SPI port to send and receive socket data, and let the PIC do all the heavy lifting. Hopefully, this means I can mostly use the Microchip code "out of the box", and make a simple serial messaging protocol. This also means I can also make it portable so that it's not just for the Gecko.

I just ordered a few PIC chips and a PICKIT 3. I had always planned to get around to exploring the PIC line of chips, but now I have a good excuse.

--P


Monday, November 21, 2011

Tiny Gecko + Microchip Wifi Project.

The good folks over at Farnel (Newark in North America) got me hooked up with a 802.11b "Wifi" board that uses a 3 wire, "SPI" interface to do Wifi.



You can find it here:

I've decided to combine it with my Tiny Gecko board, I'm not sure what I'll do with it yet, it may not even be a permanent marriage of devices. (Both of these devices fall into the category of "I acquired these cool shiny toys without an actual purpose in mind, but just that they looked cool"). My purpose is to just see how easy it is to get up and running with an embedded wifi setup, and get inspired for some other uses along the way.

In this first of several posts about this effort I will focus on my first impressions with the MRF24WB0MA wifi board.

Monday, November 14, 2011

"Sempliduino", My jaunt into Arduinoland.

I've always thought the Arduino was a really cool idea, it lowers the barrier to entry for people without an engineering and/or software background to get their nerd on. Code jockey that I am, I always thought the Ardiuno seemed a little to "beginner" for me. On the other hand, I'm always trying to think of ways to help get my kids interested coding and electronics (eg, see Scratch, more about that later).

Hardware wise, the Arduino at its core is not much more than an ATmega microcontroller, with some convenience hardware(USB serial, voltage regulator, reset button, etc), and a configuration of headers for Arduino add on boards called "shields".

As usual, I dont know exactly what I'm going to get my kids to do with them yet, but I decided that I would order some Mega 28s and some 16 mhz crystals and slap together my own 'duinos on the cheap. Since there are already Adruino minis, and nanos, picos,and femtos, I decided call mine "Sempliduino" which comes from "semplice" and  "Adrduino", the former being Italian for "simple". Yeah, I'm sure that makes no sense to an Italian speaker, but I Googled it and it wasn't taken, so it sticks.

Sempliduino 1.0

Wednesday, November 9, 2011

"Junk" mail

I order stuff from time to time from Jameco Electronics. That's put me on their mailing list for marketing email as well as their paper catalogs. I'm pretty "spam" averse, and regularly delete even emails I'd signed up to receive. When I'm getting close to a new hobby budget cycle, or I have a project I need parts for, I start holding on to the emails form companies I've bought from in the past. I actually read some of them, looking for specials or deals. Jameco actually seems to do a good job of making marketing emails entertaining to read(which, I suppose is the point of good marketing). 


Anywho, I spotted this in a Jameco email today:

Saturday, November 5, 2011

.Net Micro Framework - LCD driver.

I have a loooong running project I come back to from time to time to get the .Net Micro Framework running on one of these boards. They are an ARM 7 TDMI based boards with 16k internal ram, 265 k internal flash, as well as 1 meg of external ram and 4 megs of external flash. It basically exposes most of the processors free pins, and add handy things like voltage regulator, crystal, and an FTDI usb/uart for uploading firmware via the built in bootloader on the LPC22xx chips. It has a 20 pin JTAG connector too, which is what I usually use.

My LCD setup, the LPC2294 is the red pcb in the lower right,
the red pcb in the upper left is a Open Logic Analyser
from Dangerous Prototypes. The car sticker on my desk is a
"gift" from my son :)