Having fun with a PIC16F84A microcontroller

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.

iko

Ex-Moderator
Joined 2008
I'm planning to use a PIC16F84A microcontroller to keep the shunt current within a certain range, in a shunt voltage regulator. The regulator I have in mind is the salas simplistic that can be found in this thread

http://www.diyaudio.com/forums/showthread.php?s=&threadid=143693&perpage=25&pagenumber=1

I've started to put together a page with some info about the pic chip, just in case other people might be interested.

The page is found at this link , and is very much work in progress.

More details to come, stay tuned.
 
Great start, Iko. Can you say anything about how this will work, what the concepts behind it are? However, I don't mean to start an endless stream of requests for functions, in fact, I believe it should be kept tight & minimal, especially as it will be a first uc project for lots of us

Thanks for kicking this off - I'm sure we'll see this thread mushroom into many pages
 

iko

Ex-Moderator
Joined 2008
Thank you guys.

Here's the spiel, and I'm just thinking out loud here. The pic I'm looking at has a total of 13 I/O bi-directional pins. We can set a few pins to be inputs, and a few to be outputs. Using some kind of a resistor ladder the input will be a simple A/D converter, converting the voltage across a resistor sensing the shunt current to a few zeros/ones which will be fed to the pic. The pic makes a decision to decrease or increase the shunt current, and it puts a code of zeros/ones on its output pins, which will now be converted by a simple DAC (can also be a resistor ladder thingy, maybe) to a voltage, used to increase/decrease the value of a voltage controlled resistor (mosfet?) which in turns controls the shunt current. I'd like to keep it as simple as possible.
 

iko

Ex-Moderator
Joined 2008
astouffer said:
No need for a DAC or anything fancy. Look at the chips with PWM modules built in. Feed the PWM signal into a low pass RC filter and you'll see a DC voltage.

The PIC16F84 is a pretty limited. A 16F684 or 16F628A is a good starting point.

Thanks! I already looked at the 16f628a because it has an internal oscillator so, fewer outside parts. But didn't think to of using the pwm module. I was also considering the 16F716 which besides the pwm module has an A/D module too. This is all very new to me...
 
Thanks! I already looked at the 16f628a because it has an internal oscillator so, fewer outside parts. But didn't think to of using the pwm module. I was also considering the 16F716 which besides the pwm module has an A/D module too. This is all very new to me...

The 16F84 was obselete last century, replaced by the 16F628 - however, due to demand for an old part (why?) they reintroduced it at a higher price. You certainly shouldn't be using a 16F84 these days, and even worse not writing a tutorial using one, you're just prolonging people using it - use a modern device, cheaper, higher spec, and easier to use. The 16F84 is long dead, don't keep dragging it up.

For a regulator you really need (as a minimum) hardware PWM, and analogue inputs, this makes it trivial to make a regulator.

If you check the circuit and software for the PICKit2 (MicroChip programmer) they use hardware PWM and analogue feedback to create a 13V regulated supply from the 5V USB port voltage.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.