Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
Tools
Old 30th June 2008, 05:03 PM   #61
Default

Quote:
Originally Posted by Mike, K8LH View Post
How would you connect a single push button switch to disconnect GP0/ICSPDAT and GP1/ICSPCLK from the LED circuitry when you push it and hold it down?
That's what I get for posting before coffee. 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
=========================
futz is offline  
Old 30th June 2008, 05:34 PM   #62
Default

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);
  }
}
Mike, K8LH is offline  
Old 30th June 2008, 05:42 PM   #63
Default

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
Mike, K8LH is offline  
Old 30th June 2008, 06:20 PM   #64
Default

Quote:
Originally Posted by Mike, K8LH View Post
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.....
Hey, that looks great!

Quote:
Also note that the BoostC delay routines will run about 42% slower due to the ISR 'overhead'.
I had noticed that my delays were ridiculously short and yet worked fine. Figured (correctly) it was because it's a very busy chip.
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is offline  
Old 30th June 2008, 06:45 PM   #65
Default

Quote:
Originally Posted by Mike, K8LH View Post
I don't understand.

You wouldn't need a slide switch at all for GP3 because that would be connected to a normally open push button switch.

How would you connect a single push button switch to disconnect GP0/ICSPDAT and GP1/ICSPCLK from the LED circuitry when you push it and hold it down?
after the switch provision, GP3 could also be used as Futz put it in an earlier reply. Perhaps could expand the design further,using GP3 .
__________________
Regards,
Sarma.
mvs sarma is online now  
Old 30th June 2008, 06:59 PM   #66
Default

Quote:
Originally Posted by mvs sarma View Post
after the switch provision, GP3 could also be used as Futz put it in an earlier reply. Perhaps could expand the design further,using GP3 .
I think what Mike was suggesting was to use a momentary switch for GP3 instead of a slider. Hold the button down for programming mode. Either way, it's still a switch and you'd still have the use of GP3 for input.
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is offline  
Old 30th June 2008, 07:40 PM   #67
Default

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);
  }
}
Mike, K8LH is offline  
Old 30th June 2008, 07:42 PM   #68
Default

Quote:
Originally Posted by futz View Post
I think what Mike was suggesting was to use a momentary switch for GP3 instead of a slider. Hold the button down for programming mode. Either way, it's still a switch and you'd still have the use of GP3 for input.
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.
Mike, K8LH is offline  
Old 30th June 2008, 08:23 PM   #69
Default

Quote:
Originally Posted by Mike, K8LH View Post
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.
OK, now I'm really confused. 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.
futz is offline  
Old 30th June 2008, 08:24 PM   #70
Default

Quote:
Originally Posted by Mike, K8LH View Post
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...
Nice. Smooth as buttah!
__________________
=========================
Futz's Microcontrollers & Robotics
=========================
futz is offline  
Old 1st July 2008, 06:08 AM   #71
Default

Quote:
Originally Posted by futz View Post
Oh. It's connected to VPP until you press the button? That makes sense.
Well I don't have an ICSP jack on my board but if I did the switch would always be connected to the VPP pin on the ICSP connector so you would have to make sure you didn't press the push button while you were programming the PIC.

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
Attached Thumbnails
BoostC Charlieplexed PWM 32-pwm-20-schem-2.png  

Last edited by Mike, K8LH; 1st July 2008 at 06:10 AM.
Mike, K8LH is offline  
Old 1st July 2008, 03:31 PM   #72
Default

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
Attached Files
File Type: txt 12F683_Test_v1.txt (7.8 KB, 23 views)
Mike, K8LH is offline  
Old 1st July 2008, 04:24 PM   #73
Default

Quote:
Originally Posted by Mike, K8LH View Post
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
Very Nice Mike! Perhaps top row can be from left to right while bottom on the reverse. like two trains traveling in opposite directions.
__________________
Regards,
Sarma.
mvs sarma is online now  
Old 1st July 2008, 04:33 PM   #74
Default

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.
Mike, K8LH is offline  
Old 1st July 2008, 05:24 PM   #75
Default

Quote:
Originally Posted by Mike, K8LH View Post
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.
It's the sensors they use in these digi cameras. Mine can't take a decent picture of any LED, including LCD backlights. Colors are always wrong and blown out over-bright like you say.

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
=========================
futz is offline  
Reply

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



All times are GMT. The time now is 05:11 AM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker