Recent activity
Subscribe to this feed
John Laur replied on August 19, 2009 22:26 to the question "Using digital pins to drive alternate i2c bus" in ThingM:
I2C is a very robust system and there are a lot of components for working with I2C networks out there. There are IC's that do long haul I2c; i2c repeaters and expanders. i2c optoisolaters, non-disruptive i2c hotplug devices, etc. You can build quite complex networks with i2c if you have a strong stomach.
See the applications section in this document, for examples:
http://next.nxp.com/acrobat/applicati...
John Laur replied on August 18, 2009 19:52 to the idea "Color Calibration / Dimming Curves (MaxM)" in ThingM:
Tod,
I repaired the MaxM board I have with a new attiny44, so I am back in business for now, but thank you for the offer; I'll contact you via email about it.
As far as progress goes, I have gotten 3 channel 16 bit PWM with logarithmic response working on the MaxM using some test code. After painfully going through the ASM, I've reimplemented the idea from the link above in C; it's not quite as efficient but it works OK; the 8 bit overflow ISR takes a maximum of 45 clock cycles, but in 99%+ cases executes in about 25 cycles. Due to an ATTINY44 hardware problem, It took me a while to figure out I had to use inverted PWM to get the LED's to the very very low duty cycle needed using the 8 bit timers, but after that it's all working great.
My test code isn't integrated with cyz_rgb yet so I am unsure if the way I am using timers interferes with the operation of USI. Also, due to the size of my 512 byte lookup table, I don't know if I will be able to cram it all into 4k after integrating this design into cyz_rgb. I am about to try it out though! I havent worked very hard to reduce the code size yet, so I'm hopeful it will be OK.
I use the "official" AVR ISP mkII. It was plugged in and running when I left for the evening and dead when I came back the next morning. I had heard somewhere not to leave that programmer attached when relying on the internal RESET pull-up, but it's obvious that a great number of things could have happened to cause this problem.
John Laur replied on August 11, 2009 18:28 to the idea "Color Calibration / Dimming Curves (MaxM)" in ThingM:
I tested my port or cyz_rgb to the MaxM hardware yesterday and fixed a couple of outstanding bugs as well. Marcello Caprari was nice enough to add me as a committer, so the changes are now in SVN on google code.
Unfortunately, I left my AVR programmer attached overnight and I think I damaged the internal logic on the reset pin of my MaxM hardware, so I am out of commission until I can get another MaxM or swap the mcu on the one I have.
The cyz_rgb firmware performs PWM using an entirely software driven approach as has to be done on the ATTiny45. Looking at the MaxM design, it's evident that all the LED pins support hardware PWM and the official BlinkM firmware is probably using that (and getting some code size savings too). But only 1 of these pins supports 16 bit PWM, so we're still kind of stuck if we want to support smooth logarithmic (or approximately logarithmic) dimming curves which from what I understand will require at least 12 bit PWM to look right at low power levels.
I have found an idea for a hybrid approach which can create (with some minor limitations)16 bit PWM output using the 8 bit hardware timer to call the nearest interrupt and the 16 bit timer to delay the pin switch, but the concept example is in assembly, and I'm still having trouble fully understanding it. It also may interfere with I2C; don't know yet --- If anyone has the ability to describe what's going on here in plainer terms (or C), I'd be interested in any help: http://stonestreem.com/interrupt-driv...
John Laur replied on August 10, 2009 16:10 to the question "How did you get LED strip to work?" in ThingM:
The problem with color reproduction is due to LED dimming curves. I have a rudimentary solution here, but the ultimate fix is for the BlinkM and MaxM to provide a logarithmic or inverse power dimming curve.
See here: http://getsatisfaction.com/thingm/top...
John Laur replied on August 08, 2009 15:56 to the question "MaxM brightness level comparisons?" in ThingM:
From what I can tell the MaxM board can do at least 2A per channel and probably could go to 4A/channel (dont know about trace widths though - would have to watch that). at 24V you could drive some significant loads with a MaxM.
I have driven 1.2A of RGB leds through it (400mA/channel) at 12V and it's a lot of light, though even with 6A of leds on there you're not close to a 100W light bulb in total output. It would be rather expensive as well, don't forget. Assuming a luminous efficacy of 2% for incandescent and a very optimistic 22% for an RGB led, you'd need to drive 9W of LEDs to get the same light output. I drove 14W of LED with it at 12V and can tell you it wasn't close. I'd say you'd need probably 35-45W of LED on average to do the job. Maybe a little less with some specialty leds like luxeon but you'd need some experience to drive luxeon correctly using a MaxM...-
John Laur started following the question "I want to get a 4 core IDC cable and sockets to create a serial and power bus. Does anyone know good mouser/digikey part numbers? I have seen some examples around for this and I am very intereterested in setting this up. Also, Thing it would be great if you could identify sources for the same on the site. It is no fun wiring up loads of blinkms ;)" in ThingM.
John Laur marked one of todbot's replies in ThingM as useful. todbot replied to the question "I want to get a 4 core IDC cable and sockets to create a serial and power bus. Does anyone know good mouser/digikey part numbers? I have seen some examples around for this and I am very intereterested in setting this up. Also, Thing it would be great if you could identify sources for the same on the site. It is no fun wiring up loads of blinkms ;)".
John shared an idea in ThingM on August 08, 2009 15:37:
Color Calibration / Dimming Curves (MaxM)I have been working with the BlinkM MaxM for a couple of weeks and with the particular light chians I'm using, the color response is poor - the problem is that the PWM of the MaxM is scaled linearly and the LED output is logarithmic. So when I set the color to (128,128,128) the PWM is at 50% duty and my LED's consume half the measured power but are considerably more than 50% as bright as they would be at (255,255,255). This isn't the fault of the BlinkM hardware of course, but it does make for some odd fading behavior and some non intuitive response when one is trying to achieve a particular color. Also, I'm sure there are other LED's that have a more linear response, so please note that this is only what I am seeing - maybe nobody else is in the same boat.
So what can be done about this? Currently, in my arduino sketch I am transforming my rgb values using an inverse cube function to approximate (term used very liberally) a logarithmic curve. It's not perfect but it's considerably less expensive (CPU and code space) than actual logarithms. Here is the code (red only shown; the same is done for other values):
unsigned long rl = (unsigned long) r * (unsigned long) r
* (unsigned long) r / 65535 + 1;
r = (r == 0 ? 0 : rl);
So this transforms our color values into roughly equivalent "brightness" values -- if using HSB colors you could probably succeed in applying the same transform to only the "B" number and achieve the same thing. Internally the BlinkM is going to transform HSB back to RGB anyway.
The drawbacks with this approach are that at the "dim" end of the color ranges there are not enough steps for smooth dimming though the colors on the whole appear more accurate.
My question is, is there a better way to do this? Can I do anything between the MaxM outputs and the led light chain to achieve a linear to logarithmic transformation? Can the MaxM's internal PWM handling be converted to a higher resolution (4096 bit) and internally use a logarithmic (or other approximate) curve for dimming? Is this even a problem on other LEDs?
I have done a port of cyz_rgb firmware to the MaxM though I have not yet burned it to test. I'm trying to understand more about how the PWM is implemented and might be changed to work better before I begin testing with hardware.
I'm thinking we might not be able to get to 4096 steps of PWM without flickering unless we significantly bump the ATTINY44's clock using an external oscillator. I'm not this deep into the hardware yet --
Thanks for any ideas.
John replied on July 06, 2009 22:21 to the question "digital input to turn BlinkM on/off - so as to not need the use of analogue pins on Arduino?" in ThingM:
todbot,
Thanks; my MaxM's arrived today, and I had everything going in no under 20 minutes thanks to your product taking all the pain out of the normal process! Driving the reset pin as you mentioned with a pull down resistor works like a charm; it's really nice to have explicit control of each unit this way.
John replied on July 03, 2009 15:42 to the question "digital input to turn BlinkM on/off - so as to not need the use of analogue pins on Arduino?" in ThingM:
I want to control a BlinkM MaxM similarly, except the MaxM will be powered externally. Both the Arduino and MaxM will be receiving power from a common 12V supply. Can I wire the NPN collector to the MaxM's reset pin to hold the MaxM in reset until I want to activate it (I understand it's not actually going to be "powered off" in this case). Is this a safe approach with my anticipated power configuraiton?
John replied on July 03, 2009 15:29 to the problem "BlinkMs loose unit addresses at random!" in ThingM:
I am also wondering this. Are BlinkM's configured like this by default now? And since the problem isn't technically a firmware change, was the firmware revision number at least increased so that I can check if my MaxM's have correct fuse settings without having to order/build an AVR programmer?
I suspect I'll probably have everything working on the bench and problems in production months later if I dont check this ahead of time.
John replied on July 03, 2009 15:14 to the question "I2C address setting problem - won't 'stick'!" in ThingM:
I believe Vejmarie's solution worked because the BlinkM does an i2c reset whenever it resets its address. Thus if you target blinkm at address 16 with a command to set its address to 16, it will diligently perform this procedure then reset its i2c communications. The problem here seems to be that writes to the blinkms from the arduino were working but reads/responses from the blinkm to the arduino were failing after arduino was power cycled.
I don't know if this is still a problem, but my MaxM's and arduino are in the mail, so I am eager to read about any potential pitfalls before I get going.
I was going to attempt a design where the arduino has control of each connected MaxM's reset pin, so that I can program the addresses of all connected blinkm's in circuit - in case something goes wrong I will have a programatic abilitiy to reset the entire system to a known state rather than having to fiddle with unplugging a ton of blinkms every time I have to mess with their i2c addresses.
Has anyone attempted to control the blinkm's reset with an arduino digital pin?
Loading Profile...
