Tuesday, July 17, 2012

Vexing

Ah, the joy of embedded computing -- when you are debugging you can never be sure if it is really a software error or if it is a hardware problem instead.

The two worlds blend into each other, too.  Often the simplest "test circuit" is dashing off a quick program that will interrogate the inputs or run through a preset motion on a servo.  So you find yourself working at both ends at once; with breadboard and alligator clips and double-stick tape on the desktop, and a couple feet away, similar commented-out and patched together boilerplate code running on a laptop.



I have three gadgets in performance right now.  My XBee, in a new housing and with a new software interpreter, is in a children's show.  Amusingly enough, the Easy Button it used to be in is in another show, sans electronics.  My MIDI-controlled projector douser is in its first show, and is a visible lighting effect.  The MIDI circuit is being bypassed, though, making it basically the world's most complicated solenoid.  Good thing I included a quarter-inch jack for direct control (although I had to tweak the software to use it for this show).  And the R/C robot with wireless camera is also in a show.

And it needs work.  The transmitter is barely strong enough.  The wheels and motors are so weak I'm scared it is going to stall out in the middle of a performance.  And I could really use remote switches for the lights and camera.  The latter, at least, I could hack up pretty fast with one of the new XBee nodes I just ordered.  Pretty much a button and a Darlington transmitter and that old friendly pin echo mode would do it.

Which I may need to.  I spent today trying to get the Vex transmitter I purchased to communicate with an Arduino.  At this point about all I am sure of is that the receiver is getting power, and seems to put out at least one pulse distinct enough to trigger the Arduino's interrupt.  Other than that, no joy.

For the first time in the two years since I got rid of it, I could use that old oscilloscope.  I can't confirm that the receiver is actually working correctly, or seeing the transmitter.

The alternative (outside of ordering a second one and seeing if that one works better) is to delve a lot deeper into the Arduino PCM capabilities.  Basically, write a series of sketches to confirm that the receiver is actually sending something like protocol.  And then either go back through the code I've been trying to use, or write new code from scratch.

And I still don't know if the other end -- interfacing with the Futaba ESC and the steering servo, or even interfacing with the LED controller darlingtons -- will be as easy as hoped or will bring yet another software/hardware debug.

There isn't THAT much time this week.  I have to re-do some sound cues and repair a whole bunch of microphone elements, plus I should really make some new mic belts.  And I have a multi-track mixdown to do.  And, after all that is done, it would be very, very nice to do some work I'll actually get PAID for!




Looks like it was a hardware error after all -- and not on my side.  I hooked up a speaker and I don't seem to be getting regular tone bursts.  I hooked it up to the Vex CPU and the Receiver Status light doesn't light.  Still not as good as hooking up an oscilloscope, but I'm willing at this point to drop the $40 on a replacement receiver.  Except that I am flat broke again (the current design is paying in installments) so I can't do that until the end of the month.  By which point the show will be almost over.

No comments:

Post a Comment