Wednesday, January 13, 2010

Customers

Maker,

Thanks for the info. I would like to get this setup working in our lab in x y so that we can do a better job of debugging yield issues. How do I get these boards and software?

Sunday, September 13, 2009

I2C and SPI with Arduino

Didn't look deeply into SPI, but, considering they're both supported by the AVR feature set (look at the datasheet on Atmel.com), it ought to be simple. The thing about Arduino is that there are only so many pins available for expansion - so you have to give something up. My question is - WTH do you have to give up analog pins - why not digital? Anyhow, here's a guy who's been through it :

http://www.neufeld.newton.ks.us/electronics/?p=241

Wednesday, September 9, 2009

Mission Impossible

Alright, I've had it. I need this gadget now. This is no simple MCU hack of course but..

See what you buy and where you prefer to buy it. Have a bar code reader on your fridge and check items in. Have one on your pantry door as well. Get an idea of the frequency at which you buy the stuff (so you don't have to install weight sensors:) On the other hand, you could check stuff out of the fridge as well - to keep track of usage. Anyway, bottom line is, your fridge will inform your gadget that you need item x.

Then, in the course of your weekly movement, you gadget will alert you when you're close to your chosen store. Sometimes, taking the right exit makes all the difference in gaining that extra half hour of life to do with as you please.

This is going to take GPS and a small form factor PC. But it will be done!

Monday, August 31, 2009

Glitches Explained

Turned out it was the "noise" (in this case, deterministic unwanted patterns on some key voltages) in the noisy testmode in which there was a lot of switching going on. Thing of my chip as a spider on a thin web - the thin web is the supply and ground connections. Now, the spider has a fan that's out of control - and that keeps bouncing it all around by blowing air around uncontrollably. The solution, in this case, increase the moment of inertia of the spider by increasing it's mass - here, add bypass caps between supply and ground. Electrically, what you're doing to help out the spider is putting a sink that'll make the air the fan is blowing recirculate back to itself - so there can't be any uncontrollable bouncing. Clear analogy ja?:)

Interestingly enough - on the node where the noisy switching signal was being muxed out - if I connected a long cable, I could make things more noisy - and get the glitches back. The extra current pulled from the supply in transient to work the capacitance of this cable was enough.

Saturday, August 29, 2009

Glitches Galore

Damn! The thrill of getting something done evaporates when you see that it works most of the time, but there are cases when it doesn't. Tricky glitches screw you up one in 5 times and that's enough to make it look like crap. When it's all digital (or supposed to be) you expect stuff to work 100% of the time. Take this example. My chip takes a pulse to increment the register pointer. We use a board with push-buttons to generate these pulses. To go from state 0 to state 15, you hit the button 15 times. With software, it's trivial to write a function that takes an argument and goes to a specified state in a jiffy. Problem is, there are times it's off by 1 state - it sometimes rolls over into state 16. You get a feel for the mountain of work involved in testing something before you can sell it. Nothing like having many hands here to make work light. Eyeballs too of course - it's the information age.

In this case, it's looking like the assumption of 100% digital is incorrect. One of the states sends a rather noisy signal to one of the pins and that might mess up my setup that has lots of parasitic inductance in the leads - rather than transmission lines to convey the signals cleanly. Probably a signal integrity thing here. Never had to deal with that before.

Thursday, August 27, 2009

Maker Makes It

An end to end solution. That was fun - developing the software and hardware and delivering a complete solution - giving a demo. All in a day's work. Here you see the Arduino mating with a custom board delivered by ExpressPCB.com and assembled by me with parts from Digi-Key. Systems, here we come!



Of course, this is not the end. It's something I can use, but not something everyone can depend on, without doling out more TLC than they care to. Packaging is required - we need headers on the custom board to mate it with the Duemilanove with minimal effort. Plug and play is the name of the game. Anyone know how to launch a program on Win or Unix automatically when you plug something into USB? How does the PC know what you plugged in and what to launch? Good q.

Tuesday, August 25, 2009

Sub-Microsecond Delays with Arduino

It's possible!

The Arduino delayMicroseconds() function creates the shortest delay possible from within the Arduino language. The shortest delay possible is about 2 us (microseconds). Not true - I've tried and the shortest is about 4.5 us.

For shorter delays use assembly language call 'nop' (no operation). Each 'nop' statement executes in one machine cycle (at 16 MHz) yielding a 62.5 ns (nanosecond) delay.

__asm__("nop\n\t");

__asm__("nop\n\t""nop\n\t""nop\n\t""nop\n\t"); \\ gang them up like this

Really, why not a loop?

Dat's vy :

If you write a C loop, it will change into NOP instructions and compares/increments for counters. So your timing will be off. Unrolling loops is a standard practice to get rid of the compares/increments.


Verdict :

You also need to know stuff on this page :

http://arduino.cc/en/Reference/PortManipulation

If you use digitalWrite(), a single write takes 4.5 us to execute. But using

PORTB = PORTB & B11101111;
to set pin 12 low, with no intentional delay, I see a delay of about 400 ns. So much for being able to get 62.5 ns! If I put in 4 NOPs, I get the delay increasing to 620 ns. So we're on!