Testing the Atmel Mega32U4

December 2nd, 2008 by don

Mega 32 U4

While I am wrangling with the appropriate board design, I needed to get started working with the underlying software so I ran up one of the six samples I was able to get from Cascade on a tqfp adapter from measure explorer.

Schematic For Test Board

The AtMega32U4 is the midrange model in the atmel usb chipset. It follows a new standard naming convention that atmel is adapting U for Usb 4 is for the 40 pins 32k, there is another 32K part the U6 which has the same pinouts as the 90usb646/647/1286/1287. The U4 does not have a legacy pinout however the q1000 price for this board is around $2 which makes it a very powerful chip for the money.

Dfu-Programmer.

There is a new release of dfu-programmer but it seems that they havent read the atmel doc on the signatures for the dfu recently. http://www.atmel.com/dyn/resources/prod_documents/doc7618.pdf

I need to check the memory and eeprom sizes against the datasheets for the parts. However the table in arguments.c should have the following entries; added new parts, corrected 64x and 82 signatures. (I will resubmit this patch).

/* ----- target specific structures ----------------------------------------- */
/*  { "name",         value,            ,device_type, chipID,VID   , MemSize,FPSize,abt,ifclass,eepgsz,eepmemsz} */
static struct target_mapping_structure target_map[] = {
    { “at89c51snd1c”, tar_at89c51snd1c, device_8051, 0×2FFF, 0×03eb, 0×10000, 128, false, true,  0,   0      },
    { “at89c5130″,    tar_at89c5130,    device_8051, 0×2FFD, 0×03eb, 0×04000, 128, false, true,  128, 0×03FF },
    { “at89c5131″,    tar_at89c5131,    device_8051, 0×2FFD, 0×03eb, 0×08000, 128, false, true,  128, 0×03FF },
    { “at89c5132″,    tar_at89c5132,    device_8051, 0×2FFF, 0×03eb, 0×10000, 128, false, true,  0,   0      },
    { “at90usb1287″,  tar_at90usb1287,  device_AVR,  0×2FFB, 0×03eb, 0×1F000, 128, true,  false, 128, 0×0FFF },
    { “at90usb1286″,  tar_at90usb1286,  device_AVR,  0×2FFB, 0×03eb, 0×1F000, 128, true,  false, 128, 0×0FFF },
    { “at90usb647″,   tar_at90usb647,   device_AVR,  0×2FF9, 0×03eb, 0×0F000, 128, true,  false, 128, 0×07FF },
    { “at90usb646″,   tar_at90usb646,   device_AVR,  0×2FF9, 0×03eb, 0×0F000, 128, true,  false, 128, 0×07FF },
    { “atmega32U6″,   tar_atMega32u6,   device_AVR,  0×2FFB, 0×03eb, 0×07000, 128, true,  false, 128, 0×03FF },
    { “atmega32U4″,   tar_atMega32u4,   device_AVR,  0×2FF4, 0×03eb, 0×07000, 128, true,  false, 128, 0×03FF },
    { “atmega16U4″,   tar_atMega16u4,   device_AVR,  0×2FF3, 0×03eb, 0×03000, 128, true,  false, 128, 0×01FF },
    { “at90usb162″,   tar_at90usb162,   device_AVR,  0×2FFA, 0×03eb, 0×03000, 128, true,  false, 128, 0×01FF },
    { “at90usb82″,    tar_at90usb82,    device_AVR,  0×2FF7, 0×03eb, 0×01000, 128, true,  false, 128, 0×01FF },
    { NULL }
};

Then we test.

static
dfu-programmer atMega32U4 get bootloader-version --debug 20
     target: atMega32U4
    chip_id: 0x2ff4
  vendor_id: 0x03eb
    command: get
      quiet: false
      debug: 20
device_type: AVR
------ command specific below ------
       name: 0

Bootloader Version: 0x00 (0)

(after reading the datasheets for the 3 classes of avr usb chips and looking at the way that the avr-gcc library calls the cpu names there are some changes to the above that I will post later.)

Next up some code.

Tried running up the midiGate software that I wrote last week and found my first bug for the chip in avr-libc

UBRR1 is redefined in iom32u4.h

#define UBRR1 _SFR_MEM16(0xCC)

#define UBRR1L _SFR_MEM8(0xCC)
#define UBRR0 0
#define UBRR1 1
...

Which results in lvalue errors errors when trying to set the register to a given value. Setting the bit values as in some of the other registers seems to resolve this issue.

#define UBRR1 _SFR_MEM16(0xCC)

#define UBRR1L _SFR_MEM8(0xCC)
#define UBRR_0 0
#define UBRR_1 1
#define UBRR_2 2
#define UBRR_3 3
#define UBRR_4 4
#define UBRR_5 5
#define UBRR_6 6
#define UBRR_7 7

#define UBRR1H _SFR_MEM8(0xCD)
#define UBRR_8 0
#define UBRR_9 1
#define UBRR_10 2
#define UBRR_11 3

This is a pretty braindead error so I am sure that its been resolved by now. I need to see if it is fixed in 1.6.3 or the current release candidate (since AvrMacPack is out of sync and has 1.6.2) And yes this is the case.

We have a device!!! 

Is it me or does that look like a target?

October 27th, 2008 by don

http://www.gearthblog.com/blog/archives/2008/10/google_earth_for_the_iphone_release.html

Enzyme Induction paper published in Complexity.

October 22nd, 2008 by gepr

Our paper Enzyme Induction paper has finally been published!  Woohoo!

Agent-Directed Simulation Symposium

September 24th, 2008 by gepr

As usual, we’ll be participating (to some extent) in the ADS symposium.

The theme of ADS’09 is based on the observation of the following premises.

  1. The growth of new advanced distributed computing standards along with the rapid rise of e-commerce are providing a new context that acts as a critical driver for the development of next generation systems. These standards revolve around service-oriented technologies, pervasive computing, web-services, Grid, autonomic computing, ambient intelligence etc. The supporting role that intelligent agents play in the development of such systems is becoming pervasive, and simulation plays a critical role in the analysis and design of such systems.
  2. The use of emergent agent technologies at the organization, interaction (e.g., coordination, negotiation, communication) and agent levels (i.e. reasoning, autonomy) are expected to advance the state of the art in various application domains. However, modeling and testing complex agent systems that are based on such technologies is difficult. Using agent-supported simulation techniques for testing complex agent systems is up and coming field.
  3. To facilitate bridging the gap between research and application, there is a need for tools, agent programming languages, and methodologies to analyze, design, and implement complex, non-trivial agent-based simulations. Existing agent-based simulation tools are still not mature enough to enable developing agents with varying degrees cognitive and reasoning capabilities.

Note the dorkboard….

September 21st, 2008 by don

Ethan and his dad came to the first dorkboard based induction. This is one of his recent projects.

http://etharooni.wordpress.com/2008/09/21/nunchucklogger/

Very cool stuff.

Our first reseller.

September 7th, 2008 by don

Brian Reilly at Wulfden picked up the dorkboard in his freeduino line of products.

http://wulfden.org/TheShoppe/freeduino/dorkboard.shtml

Yeah!

Ptolemy II Webcam App

September 4th, 2008 by gepr

My partners got so excited about the ease with which one can create data-driven programs using QuartzComposer for the Mac that I just had to demonstrate to them that Apple doesn’t have any kind of lock on this domain. In fact, it brought to my mind a very old Mac OS 9 (or earlier I guess) visual programming language called Prograph, which has now become Marten and a handy little signal processing tool called Cantata, which has now become VisiQuest (look at the tutorials near the bottom of the page). And, of course, that’s not to mention the many other packages out there like PureData, LabView, etc.

Anyway, here’s my demonstration using Ptolemy II 7.0.1 over the top of FMJ (forget JMF - “Oh Sun Microsystems, why have you forsaken us?”):

At our company meeting, we were playing with a USB microscope Don borrowed from a friend of his. And one must admit that’s a much cooler thing to play with than a webcam. But, hey, my point can be made without the fancy hardware. ;-)

The ascription of telos

August 27th, 2008 by gepr

Things come in threes. I’m beginning to think that this “law of threes” might be a good gauge for when one should actually speak. Perhaps I’ll try it one day … just keep my mouth shut until there are 3 similar things about which to talk. ;-)

Anyway, I recently hosted a poster at the Engineering in Medicine and Biology Conference (EMBC) entitled: Using an In Silico Liver to Evaluate a Hepatic Enzyme Induction Mechanism. I won’t attempt to explain the contents, here (thank the gods, eh?); but the gist of it was that all models, including in silico (a.k.a. computational), in situ, in vitro, in vivo, indeed ALL ways of interacting with anything, involve what we’re calling a “phenomenal manifold” (a.k.a. an “aspect” as in Aspect-Oriented Programming). Basically, whenever a subject interacts with an object, the interaction is always mediated by some layer … a membrane. The subject cannot reach directly inside the object and manipulate or observe anything she might want to. Such interaction is always distorted, governed, or transduced through this layer. Granted, sometimes the layer can be very transparent so that it seems as if you’re touching the object directly. But in other cases, there are highly nonlinear or unpredictable effects when the subject manipulates the object or the data from observation can be very cryptic or misleading.

Why is this important? Well, in the context of using computational models to understand an extant system, the phenomenal manifold must be explicitly included in the experimental method. Otherwise, the results will not be repeatable and the effort can’t be considered “science”.

That’s the first of the three. The second is that one of us just got their hands on a high powered microscope and his family has been spending quite a bit of time staring at pond water animals through it. This sparked an argument between me and him about the telos of these animals’ motion. I suggested that it was primarily (say 70%) random, probably even Brownian (an aggregate of collisions with much smaller forces). He countered that their movements seem very purposeful, that they very clearly swim from place to place.

Now, I ran this by a few people, including biologists, and they all agree with him. The consensus seems to be that the motions of these animals do have telos and I am wrong. However, I maintain my skepticism primarily because this has the same texture as a mistake I’ve seen people make over and over again, never learning the lesson. We humans always ascribe telos. It is the fallacy of anthropocentrism. Besides, I can imagine many random, including Brownian-style, mechanisms that might generate seemingly purposeful behavior. So, as long as my imagined proto-hypothetical mechanisms are not falsified, my skepticism is appropriate and it’s just sloppy thinking to jump to the conclusion that the motions must be purposeful.

So that’s 2. And I was waiting for my partner to post some pictures or video about this locomotion to launch into the argument, here. But then the third thing came rattling down the pipe. I finally got caught up on my e-mail and, lo’ and behold, I find this post on Panda’s Thumb, wherein we find the telos-obsessed Intelligent Design people misquoting John von Neumann regarding the disturbing randomness at the heart of evolution. It’s useful to requote an excerpt of the quote used by Douglas to show that Berlinski misrepresented von Neuman. 8O

Yet many efficient (?) and purposive (??) media, e.g., language, or the national economy, also look statistically controlled, when viewed from a suitably limited aspect.

Local Induction.

August 15th, 2008 by don

Flashback to an old simulation

August 12th, 2008 by gepr

I got the new Silicon Forest Universe 2.0 poster and flashed back to SwarmCorp’s multi-scale Alzheimer’s Disease model.  We used a product called “TheBrain”, which has now been forked into several products by TheBrain Technologies, Inc..  Anyway, I dug up our old brain map from my SwarmCorp archives, imported it into the PersonalBrain I just downloaded and here is the result.  I love technology sometimes. … Of course, most times I hate technology.  But this was a nice fugue of nostalgia.  Thanks to TheBrain Technologies!

Note that the ADBrain was built by Chris, whereas I wrote most of the simulation and Visio code to which the ADBrain hooked.

NDA-ROX

August 3rd, 2008 by don

I just spent the weekend with a few people who knew a lot more about programming the iphone than I did and several people that knew about as much as I did. I can tell you that the Portland group got the best of satellite category for our collectively built app.

(If you look behind the sf group you can see the Portland and Seattle groups in the background)

But given Apple’s NDA I can’t tell you much else.

Why Portland?

July 10th, 2008 by gepr

I get a lot of people asking what Tempus Dictum does.  What’s the company about?  What do y’all do?  Etc.  And from my friends in Silicon Valley, I often get the question:  Why Portland?

Well, there are many answers to these questions, some of which I’ve covered (albeit in an apparently infuriatingly vague way, according to some) in previous log entries.  I admit this is a problem and we really should work on our … [cough] … messaging.

But, regarding the question of why we’re located in Portland, I can cite at least two things right off the bat:

  1. a do-it-yourself culture, and
  2. beer.

I won’t say anything about the DIY culture this post.  And Portland’s reputation for beer is global.  Now before you jump to the conclusion that we merely have a prurient interest in beer, I’d like to point to this article, which makes an interesting point that speaks directly to everything Tempus Dictum is about, including the English translation of its name “Statement of the Time”.  Civilization is based not on high-falutin’ past times like science, economics, or politics.  Civilization is based on banal things like water, shelter, food, and neighborhoods.  Portland excels at the banal while maintaining a satisficing tendency toward intellectual foresight.  And if Mr. Will is right and beer is positively correlated with civilization, then Portland is one of the most civilized cities on the planet.  Shouldn’t that be enough of a reason?

Rapha Race Controller

June 24th, 2008 by don

Rapha Sportswear has a stationary race controller prototype that they need replicated for an event next week. The first step int this process was to break out the original design into 3 boards one for input processing one for the stepper drivers and one for the processor itself. Since the customer wanted to be able to modify the code themselves in the future and expand the system an Arduino or Wiring compatible board will be used.

(The completed project)

Motor Boards

The motor boards consisted of 4 darlington transistors on the best performing heat sinks I could find.

The I/O - Processor Board.

The I/O Processor board consisted of to schmidt triggers to clean up the input and a usb to serial connection for programming and future use. The board also has 3 free ports for future use.

The Inverse Map

June 18th, 2008 by gepr

In the course of my duties as a biological modeler (whatever that may mean to you, my dear reader; were you to exist, of course) I am sporadically called upon to wax explanatory on the relation between generators (abbreviated and unitized as “gene” in some domains) and phenomena. The path from generators to phenomena is called the “forward map” and, perhaps obviously, the path from the phenomena back to its causes, the generators, is called the “inverse map”. It is largely the subject of plectics ¹ (a.k.a. complexity theory) to discover, use, and make repeatable, methods for accurately following these two paths. A primary premise of the computationalist approach to plectics is that the forward map is not so straightforward. I.e. beyond a certain degree of simplicity, it is not clear what phenomena will emerge from the generators. And this premise is emphasized because it is so often forgotten. It is the reason Chaos theory, fractals, and games like chess are so maddeningly interesting.

Similarly, the cyberneticists have an emphatic premise: that complexity comes about through feedback loops. Again, beyond a certain degree of simplicity, it is not clear which part of a system is the cause and which is the effect. Phenomena are exacerbated with positive feedback and dampened with negative feedback.

Both emphases are appropriate and the fact that we even have a distinction between computationalists and cyberneticists is an example of specialization gone mad. ² Both require the notion of loopiness and the somewhat occult nature of both the forward and inverse maps. But the loopiness is often a more difficult concept to grasp.

This article challenges the notion that a complex forward map is sufficient to realize or explain a complex system, especially one so full of occult paths and loopiness (including trans-hierarchy) as multi-cellular life. And I am very happy that such an article has made it into the mainstream news.

1. Murray Gell-Mann tried to install “plectics” in the vernacular, but failed. I buy Murray’s argument and try to use “plectics” whenever I can.

2. Not that I would advocate for huge box stores like Wal*Mart where you can buy diapers, car batteries, and bread all in the same trip or anything. In fact, such lack of specialty disgusts me. But there is something to say for, e.g., the general practitioner or renaissance man (sorry, I just can’t replace “man” with “person” in that phrase) who can think holistically … synergistically … about a subject without her (that should make up for the gender bias) prejudices kicking in to keep her from escaping her current thought rut.

Happy Birthday to Me!

June 12th, 2008 by don

I am old. I won’t say how old exactly but I am half way through a few experiments. Life, work.

It makes me very happy that three of these experiments will be funded as Tempus Dictum Projects.

  1. The Dorkboard.

  2. The Benito Serial Programmer

  3. The Arduino Cult Induction Series.
    (Next Induction Sunday June 22)

I would like to thank Tempus Dictum for the opportunity to work on these items.

I am a very lucky man.

Write Locally Post Globally

June 3rd, 2008 by don

I like wordpress.

It allows me to do much of what I post on the web without having to look at the underlying html and still letting me at the html. In fact I use WordPress to to post on Dorkbots Drupal pages. It is easier than hand rolling html and the new wordpress saves your drafts. This is no small issue: As I was reminded at 2:30 monday morning as Drupal timed out the session that I was writing on and ate my post. Between that and the Eagle files I was working with I lost most of sunday nights sleep. The other issue is portability.  So last night I ran up mysql, unpacked the latest wordpress into my home directory and reconfigured the apache daemon that comes with leopard.

I plan to get more done and loose less sleep.

The Really Really Bare Bones Arduino

June 3rd, 2008 by don

This has been reposted on dorkbotpdx.org

A few weeks ago I bought the last of the Really Bare Bones Arduino rev A boards from Brian at Wulfden (http://wulfden.org/freeduino/freeduino.shtml) I now have enough boards for one more workshop and then we have to reevaluate the boards which are avaliable. Pictured below is a finished board from the first “Arduino Cult Induction Workshop”

In addition to letting me clean out his new old stock Brian threw in one of the “Rev B” boards so I could check it out. Unfortunately I don’t like it.

The new board is almost 3/4″ of an inch longer than the original. Most of the new space is dedicated to room for a power jack and a regulator. Things that I never use. The design is supposed to allow you to cut the power jack off as well as the regulator. Notice in the finished board above that their is space for a big old reset switch. When the original Arduino came out you had to reset the board to get it into the bootloader. However in the past year or so all the new boards have been using the dtr signal run through a capacitor to pull the reset line so the switch is wasted space. The original board made up for this space by adding ample ground and supply connections. The new board adds another 1/8″ and gets rid of these.

As I was grumbling about this Mark Gross suggested that I just roll my own.

So we are back to the drawing board. Above is my pen markup of the changes that I wanted to see done to the original Really Bare Bones Arduino and below is the draft of the rework to scale with the RBBB rev B.

Now comes the fun part The cost of goods sold and a business case.

Web log posts

May 30th, 2008 by gepr

Sheesh! It’s like pulling teeth to get anyone to post to a web log. I suppose there are two fundamental blockages: 1) a phantom requirement for high quality and 2) the idea that there should be some clever or interesting content in the log entry.

But, both of these are pure vapor. People seem to be very willing to post silly and overly personal messages on their Facebook or Twitter feeds. They even seem willing to use four letter and misspelled words. Now, I agree that a semi-professional web log shouldn’t be populated with unverified “facts”, overly personal information, or contentless snippets. But if an obsessive desire for high quality and interesting content prevent one from ever posting anything, well, that seems like a personality disorder more than an honest attempt at high quality or interesting content… to me, anyway.

Besides, the very point of a web log is that it be a log. It’s not a news publication. It’s not a venue for peer-reviewed journal articles or vetted press releases. It’s a log. Logs are populated with entries, some of which turn out, later, to be useless evidence of the enthusiastic but myopic detailed exploration of rat holes and dead ends. Some of the entries, of course, end up being the fundament of astounding insight or fecund intellectual property. But not everything in a log has to be brilliant or clever.

Take this entry, for example. 8^)

A Statement of the Time

April 10th, 2008 by gepr

This story in Information Week helps provide the justification by which the Tempus Dictum hypothesis (TDH) will graduate to a full thesis:

Solo Entrepreneurs: Big Bucks From Tiny Computing Startups

The TDH states that, if the information explosion continues its general trend, human organizations will tend toward smaller and smaller clusters.

The TDH is an informal combination of the concepts of scale-free networks, libertarianism, and distributed problem solving. As I explained in The Motivation behind Tempus Dictum, we are, banally and somewhat facetiously, just a collection of misfits who find greater efficacy when operating “in the wild”, as it were. But the deeper message is that TDI presages an emerging trend in the way humans apportion their attention and efforts. Large bureaucracies are efficient and effective at exploiting coherent circumstances. Small organizations are more agile and much more effective (if not efficient) at discovering potentially coherent circumstances. In a relatively stable system, small organizations form in co-evolution with emergent coherence in circumstances. The small organizations reinforce the coherence and “blaze” the trail for the large organizations that follow.

However, as the world becomes more connected (via the internet but also other more robust factors like the homogenization of cultures through air travel), the potential coherency of any set of circumstances decreases. I.e. the phenomena and patterns that emerge are much more fragile when there are more paths to the same objective. And as humans become more connected, there are more feasible paths to the same objective.

This means that we need fewer large organizations to achieve our objectives because, if one particular path is capital or infrastructure intensive, it’s likely there is another path that is less so, making it achievable with a smaller organization.

Granted, we will still need some large organizations to achieve the objectives to which we can’t find easier paths. For example, space exploration and colonization is still capital and infrastructure intensive. Another example is the burgeoning epidemiological problems brought on by increased connectivity. Higher connectivity means higher homogeneity means more susceptibility to epidemic. Finding solutions for problems like the loss of honey bees, influenza, and Kraken will also be capital and infrastructure intensive.

However, if we mis-read this trend, we may be inclined to coerce ourselves into big money, big infrastructure solutions where such are unnecessary and, worse, wasteful and obstructionist. Big organizations form naturally when the discovery mode (many small organizations trying to achieve some objective by different means) wanes. Prematurely establishing artificially large organizations to solve improperly explored solutions is the primary risk during our evolution from a mostly heterogeneous, cliquish population into a mostly homogenous, connected population.

Correlation causation conflation

March 27th, 2008 by gepr

I have no choice but to post this. Forgive me for being an automaton.

Here’s the /. blurb.

Here’s the debunk.

And here’s the original article in Oikos.

–gepr