PDA

View Full Version : PWM of voltage input to PIC - will it damage the chip?



RossWaddell
- 21st January 2016, 23:29
I have a PCB with a 16F1283 chip to control 5 blinking LEDs buried inside a model. The board is powered by 5V which is also used to turn on 5 steady-on LEDs (total of 10). I want to use an external PIC & PWM to 'ramp up' the voltage from 0-5V to make the 5 steady-on LEDs fade in, but will it harm the PIC?

Ioannis
- 22nd January 2016, 09:39
I ma not sure what exactly your wiring will be. Maybe a schematic will help.

Ioannis

RossWaddell
- 22nd January 2016, 12:15
Here's the relevant schematic portion of the board that will be inside the model:

8154

The steady-on LEDs are on the RHS. Both them and the 12F683 PIC are powered by the same +5V input.

Ioannis
- 22nd January 2016, 13:03
You imply that with the PWM controlled voltage, you will power also the PIC12F683 circuit?

Ioannis

Amoque
- 22nd January 2016, 13:08
I think that you might easily do both with the same chip. Google "transistor as switch" this will allow all five LEDS to ramp-up from the same PWM output without issue (and the power needed to run them will not go through the PIC). You might use the same technique to tie several (or all) of the flashers together as well. This would be a good precaution to take regardless as there is a maximum output allowed from the chip. An I2C port expander would also provide 6 additional output pins (subtracting the two PIC I2C pins required from the 8 on the expander equals a net gain of 6) if you can spare the room.

The problem with an external PWM to run the PIC (if I understand rightly) is that it will be constantly resetting as the PWM signal goes to zero

Also in you OP you state your using a 16F1283, but in the schematic is a 12F683. Please clarify.

RossWaddell
- 22nd January 2016, 15:22
You imply that with the PWM controlled voltage, you will power also the PIC12F683 circuit?

Ioannis
That's right. I'm just worried that that will hurt the PIC.

Ioannis
- 22nd January 2016, 15:42
PIC will not be hurt. But as Amoque noted, it will keep reseting because it cannot work from 0 volts, right?

You have to make new electric connections.

Ioannis

RossWaddell
- 22nd January 2016, 18:26
The board is only 1.5" in diameter and I don't think I can fit anything more on it:

8156

I don't think the PIC restarting is a problem since all it does is blink 5 LEDs at separate rates, so if it's turning-on-and-turning-off then that could look OK.

RossWaddell
- 22nd January 2016, 18:27
I think that you might easily do both with the same chip. Google "transistor as switch" this will allow all five LEDS to ramp-up from the same PWM output without issue (and the power needed to run them will not go through the PIC). You might use the same technique to tie several (or all) of the flashers together as well. This would be a good precaution to take regardless as there is a maximum output allowed from the chip. An I2C port expander would also provide 6 additional output pins (subtracting the two PIC I2C pins required from the 8 on the expander equals a net gain of 6) if you can spare the room.

The problem with an external PWM to run the PIC (if I understand rightly) is that it will be constantly resetting as the PWM signal goes to zero

Also in you OP you state your using a 16F1283, but in the schematic is a 12F683. Please clarify.

It's a 12F683. This forum won't let you edit a post after some time has passed so I couldn't update it.

Maybe what I could do is have 3 wires go up to the board - +5V, GND & +5V* (PWM control just for the steady-on LEDs)?