![]() | ![]() | ![]() |
| | #61 | |
| Quote:
Sure it could be done, but it would take more circuitry than it's worth. My "off the top of my head" electronics knowledge is poor. It seemed like a nice idea when I posted it, but when I actually started scratching it out on paper I realized it's not so simple.Here's a simple little pwm animation thing for your blinky device: Code: led[0] = led[19] = 31;
led[1] = led[18] = 23;
led[2] = led[17] = 18;
led[3] = led[16] = 14;
led[4] = led[15] = 11;
led[5] = led[14] = 9;
led[6] = led[13] = 7;
led[7] = led[12] = 5;
led[8] = led[11] = 3;
led[9] = led[10] = 2;
while(1){
temp=led[0];
for(x=0;x<19;x++){
led[x]=led[x+1];
delay_ms(3);
}
led[19]=temp;
delay_ms(3);
}
}
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | ||
| |
| | #62 |
|
Nice effect. That's "a keeper". I can see now how easy it will be to create hundreds of patterns and variations. We're definitely going to need that mode switch (grin). I've still got the red led bars in mine and they're incredibly bright so I toned it down a little. I also wanted a little more dark area in there, so..... Code: led[0] = led[19] = 12;
led[1] = led[18] = 9;
led[2] = led[17] = 7;
led[3] = led[16] = 5;
led[4] = led[15] = 3;
led[5] = led[14] = 1;
led[6] = led[13] = 0;
led[7] = led[12] = 0;
led[8] = led[11] = 0;
led[9] = led[10] = 0;
while(1)
{ temp=led[0];
for(x=0;x<19;x++)
{ led[x]=led[x+1];
delay_ms(3);
}
led[19]=temp;
delay_ms(3);
}
}
| |
| |
| | #63 |
|
It may be difficult trying to animate the leds faster than the rather slow 62.5 Hz / 16 msec refresh rate. Also note that the BoostC delay routines will run about 42% slower due to the ISR 'overhead'. Mike | |
| |
| | #64 | ||
| Quote:
Quote:
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | |||
| |
| | #65 | |
| Quote:
__________________ Regards, Sarma. | ||
| |
| | #66 | |
| Quote:
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | ||
| |
| | #67 |
|
Hi again, The processor isn't that busy. When you get a chance could you try this snippet? I removed the delay within the loop to smooth out the transitions. I also synchronized the LED update to the 16 msec frame rate. Please tell me if you notice any difference? It looks incredibly smooth here... Code: led[0] = led[19] = 12;
led[1] = led[18] = 8;
led[2] = led[17] = 5;
led[3] = led[16] = 3;
led[4] = led[15] = 2;
led[5] = led[14] = 1;
led[6] = led[13] = 1;
led[7] = led[12] = 0;
led[8] = led[11] = 0;
led[9] = led[10] = 0;
while(1)
{
temp=led[0];
while(colpos != 0b00100000); // sync' to 16-msec frame interval
for(x=0;x<19;x++)
{ led[x]=led[x+1];
}
led[19]=temp;
delay_ms(26);
}
}
| |
| |
| | #68 |
| Sorry for the confusion guys. I installed a push button switch on my board to use within the program for selecting different modes. Then I suggested that you don't really need the ICSP/RUN slider switch because the push button switch is normally open and it won't adversely affect PICKit2 programming operations.
| |
| |
| | #69 | |
| Quote:
Doesn't the programmer need to hit VPP with 13V to program the chip? Or does it both connect VPP to ICSP and change modes at same time when pressed?EDIT: Oh. It's connected to VPP until you press the button? That makes sense.
__________________ ========================= Futz's Microcontrollers & Robotics ========================= Last edited by futz; 30th June 2008 at 08:33 PM. | ||
| |
| | #70 | |
| Quote:
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | ||
| |
| | #71 | |
| Quote:
I suppose if I were to put an ICSP connector on the board I would just use three jumpers to isolate the GP0, GP1, and GP3 pins and ICSP signals from the rest of the circuit. Again, sorry about the confusion. Also updated my drawing (below) to show the new push button switch and to show the RS-232 connector which has been on the board (but not included in the schematic). Mike Last edited by Mike, K8LH; 1st July 2008 at 06:10 AM. | ||
| |
| | #72 |
|
Well I can see there's a whole new set of skills I need to master to put videos up on YouTube (grin). You guys make it looks so easy (grin). Anyway, here's a link to the video of that last program in operation; Charlieplexed PWM-32 The LEDs are still washing out or overloading the camera and I don't know how to tone it down to get good video. Those LED patterns are really very crisp and clear in person with a very nice fading effect. I've also attached an updated program listing because the listing in the very first post is missing an instruction at the top of the ISR to clear the Timer 2 interrupt flag (oops!). Sorry guys. Mike | |
| |
| | #73 | |
| Quote:
__________________ Regards, Sarma. | ||
| |
| | #74 |
|
Thank you. It looks much nicer in person than it does in the video. Looks like Futz has also put his version up on his site and it looks very nice. He mentioned my name too. Cool. I'm famous (grin)... Futz' Charlieplexed PWM-32 writeup Last edited by Mike, K8LH; 1st July 2008 at 04:38 PM. | |
| |
| | #75 | |
| Quote:
One thing I noticed is that the Kodak that Atomsoft uses must have a different sensor because his LCD backlight pics look great! In fact, they look oversaturated to the point that it should be toned down a bit. Kodaks almost always come out at the bottom of the pack in reviews, but they may be good for LED pictures. If I knew anybody who owned one I'd borrow it to confirm this hypothesis.
__________________ ========================= Futz's Microcontrollers & Robotics ========================= | ||
| |
|
| Tags |
| boostc, charlieplexed, pwm |
| Thread Tools | |
| Display Modes | |
| |
Similar | ||||
| Title | Starter | Forum | Replies | Latest |
| BoostC question.. AddressOf | Mike, K8LH | Micro Controllers | 8 | 25th June 2008 12:20 AM |
| LCD degree symbol with sprintf (BoostC) | futz | Micro Controllers | 29 | 5th June 2008 05:19 AM |
| math.h and lib for BoostC? | futz | Micro Controllers | 3 | 31st March 2008 06:29 AM |
| Charlieplexed code segment for the Cricket Thermostat | William At MyBlueRoom | Micro Controllers | 2 | 14th March 2006 05:12 PM |
| My PIC Projects Site NEW (includes 2 Charlieplexed Display) | William At MyBlueRoom | Electronic Projects Design/Ideas/Reviews | 0 | 28th February 2006 02:31 PM |