What do I need in a power supply for a MIDI project?

Started by NeveSSL, November 12, 2005, 09:17:09 PM

Previous topic - Next topic

NeveSSL

Hi all!  I am ordering parts for a MIDI project.  It requires a solid 5v.  I am planning on making this project capable of being powered from 9v pedal supplies.  My question is this:  what in addition to my 5v regulator (coming from 9v) do I need to have a clean power supply?  This will be feeding a micro controller and also signal relays... should I have seperate power supplies for these two, or will one for both work ok?  I'm not sure on the relays causing any spikes or anything.  Thanks!

Brandon

Dave_B

As I type this, I've got a 16F877A pic chip on my breadboard.  I've got a Commodore 1amp 9v adaptor feeding a 7805 with a couple of caps on the output pin (a .01 and a 100uf, I'm pretty sure).  I've not had any issues with that setup, thought 1amp is really overkill for this circuit.

FWIW, I tried run my XM radio from the same supply after bumping the voltage up with a couple of diodes.   Without the caps it wouldn't turn on.  With the caps, I was rocking.
Help build our Wiki!

NeveSSL

#2
Very cool... I thought something like that would sound right.  I'm planning on using the exact same chip for a MIDI looper, similar to an Axess Electronics GRX4.  What are you building with it, if you don't mind me asking?  ;)

Brandon

Dave_B

When I get it working it will basically be a fancy tremolo.   ;D   Once I get it out of the way, I plan to start in on a pic-based tuner for the DIY group using a 16f88.  Then an LFO with tap tempo and a 'metronome' readout (based on Mark Hammer's idea from a few months ago).  That's assuming someone doesn't beat me to them, and they're more than welcome to.   :)

What kind of memory chips are you using for the looper?  72pin PC SIMMS?  Are you building it from a published schematic?  If this is a commercial product or something, feel free to be vague.   

If you haven't started already, you might consider low-voltage programming.  I'm headed in that direction in the next few days.
Help build our Wiki!

NeveSSL

A fancy tremolo sounds great!  :)  One of my favorites for sure.  A pic-based tuner sounds freaking awesome,  as well!

Hmmm... my apologies.  "Looper" was bad terminology.  I should have said "loop switcher", perhaps.  IE, one of the things some people put in a rack to take effects in and out of a/the signal chain with relays.  Make sense?  Sorry about that!

With that being said, I virutally know very little about PICs and the programming there of.  I'm actually getting the code (along with the schematics and everything else) from http://www.jimkim.de/html/guitar01_01.htm.  He uses the relays as "footswitches", so to speak.  I plan on using them as a loop switcher. 

I am, however, minoring in electronics and I will be taking my first classes next semester.  I can't wait!  I love all of this stuff. 

One BIG question I have:  what can I program this thing with?  IE, what inexpensive DIY programmer can I build?  ;)  I had one at one point, but lost the link.  It stinks, too, because it was only like $7 in parts.  Any ideas?  For right now, I'll only be programming the 16F877 and only for this, so I'm not looking to invest in anything (not yet, anyway... may next semester or next year, though, as I plan on taking some uC classes).  I've heard this the 16F877 is programmable in cirucuit... could I do that and, if so, how?

Also, if you have any suggestions for for websites that might be helpful for me, please do feel free to share.  :)

Thanks!

Brandon

Paul Perry (Frostwave)

Here's a DIY programmer that claims to be cheap: http://www.myke.com/elcheapo.htm

Reading the text, it looks like the guy has covered the bases. There's thousands more out there though.

Dave_B

Quote from: Paul Perry (Frostwave) on November 13, 2005, 12:28:38 AM
Here's a DIY programmer that claims to be cheap: http://www.myke.com/elcheapo.htm
Reading the text, it looks like the guy has covered the bases. There's thousands more out there though.
That guy is a good writer, too.  His books are generally regarded highly.

I'm still new to this, but the Sparkfun.com website had enough detail to get me started.  I use Microchip's free MPLAB to code, simulate, and compile (I'm only using assembler at the moment).  I then load the hex file to the chip with another free program called ICPROG. 

As Paul said, there are a ton of schematics for programmers.  I built the Olimax PIC-PG1 programmer simply because I had 95% of the parts on hand, it was "JPM complient," and it was a real simple circuit.  http://www.olimex.com/dev/images/pic-pg1-sch.gif  http://www.sparkfun.com/shop/index.php?shop=1&cart=464190&cat=1&itemid=1&
That programmer is designed to be used in circuit with some support components, but I haven't tried it yet.  You can also use low-voltage programming (LVP).  I plan to do that instead.  LVP really streamlines things and is a good way to go if you have a couple of spare pins on your 877A.  Not all PICS support LVP, but that one does. Go to Sparkfun and search for "bloader" for info on how to do it.  Searching their forum can help you get over any bumps. 

Once you get started, this stuff is pretty straighforward.  In two months time, I went from being scared to plug the programmer into my serial port to having a circuit with three A/D converters reading knobs, three types of interupts, multiplexed leds, etc.  Granted, it's got a minor glitch that's p*ssing me off and I've got some major clock noise in the audio path, but conceptually it works.   :D
Help build our Wiki!

NeveSSL

Thank you guys very, very much!  Just the stuff I was looking for.

I am off to the reading races!  ;)

Brandon

NeveSSL

Bellyflop...

Would you care to share in detail how you got started?  For instance, to begin with I will just be loading code into the chip and hoping the circuit works... heh.  But, I do plan on developing my own code for several different reasons.  Where did you begin to learn the code?  I have experience with VB and C++, so I know the basics of coding to get me started, but I have no clue when it comes to uCs.  :) 

Also, are there any uC sites dedicated to audio use?  Such as, how/where did your tremolo project start from?  Did you do it from the ground up?

And my biggest question, how can I learn to implement MIDI into the wonderful world of uCs?  Anyone know any sites?

Thanks much!

Brandon

Dave_B

We have similar backgrounds with regard to programming.  I know a little Perl and PHP, but not a lot.

For starting from scratch, I really liked this one: http://www.mstracey.btinternet.co.uk/pictutorial/picmain.htm
It got me up and running quickly, though you'll need to make some minor adjustments for the 16f877a vs. the 16f84.  I ended up printing this one.

Is a good reference is here: http://www.mikroelektronika.co.yu/english/product/books/PICbook/picbook.htm
Really tough to print, but it has some info on MPLAB.

Beyond that, I printed the manuals for the 16f877a, MPLAB, and the Mid-Range Reference Manual.  All these are available from microchip.com.  Here's a link to get you started:   http://microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=84&useSecondary=true&device=en010242&ds=on&uguide=on&dnotes=on&tut=on&refm=on

For MIDI, try this one: http://homepage.ntlworld.com/derek.johnson/tutorial.html Lots of subroutines.  Keep in mind he's using the older 16f877 chip.  I don't know if there are code changes needed for the '877a.

For any specific issues, obviously google is a big help.  Searching the archives of the 'embedded' groups has answered a lot of my questions.  That should get you started.  Feel free to PM if you get stuck (no promises  ;D ).
Help build our Wiki!

NeveSSL

Ok, I've decided to use the 16F84 for this project, which is what it orginally calls for.  But upone searching for this at Mouser, it came up with about 53 results... which one do I need to use?  Here's a link:  http://www.mouser.com/?handler=data.listcategory&Ne=500&terms=16f84&Ntt=*16f84*&crc=true&Ns=SField&N=543

Thanks!

Brandon

Dave_B

Of those 53, you'll notice that only two are actually stocked.  579-PIC16F84A-04I/P is the one to get.  Anytime you see a PIC with an "a" suffix, it's a newer chip and almost always a little cheaper.  Also, in general, you want to avoid chips with SOIC in the description, as those are surface mounted.

Feel free to buy an '84a since you don't have to modify the code but, they're old, so you don't want to buy a lot of them.  When you start writing your own stuff, it's doubtful you'll want to use an '84a.  Still... it's not like we don't use obsolete chips around here.   :)
Help build our Wiki!

David

Power supply?  Just build a 5V regulated one.

For the PIC, use a 16F628 instead of the '84.  They're a lot easier to find.  A good source is www.phanderson.com .

Hey, Bellyflop:  When you get LVP figured out, how about presenting it here?  I'd like to figure out how to use it and ICSP both.  I have a laptop in my shop I'd like to use for PIC programming and other electronics type stuff (like perhaps a small laser printer will someday magically appear in my shop... heh-heh...   :icon_mrgreen:)  I have to pry my PIC out of the breadboard, stick it into my PG2C, haul that upstairs, plug it into the family computer, program, remove, go back down to the shop, pry the PIC out, then carefully put it back into the breadboard.  Phew!

Dave_B

Quote from: David on November 14, 2005, 10:20:52 AM
For the PIC, use a 16F628 instead of the '84.  They're a lot easier to find.
I was suggesting another chip as well, but it sounded like Brandon might not want to modify code the first time out.  Substituting a 16f628 would require some minor changes to get it to work (as I'm sure you know   :)).  For that matter, the 16f648a is even more hot-rodded than the '628.  The 16f88 is a cool one also.  That's what I started with.

Regarding substitutions, if anyone is interested in the changes needed to make a 628/648 work in a '84 circuit, here ya go:
http://www.dontronics.com/cat_hard_micro_pic.html#628spec

http://www.glitchbuster.com/ is another good site for ordering PICS.  His shipping is beyond reasonable and the order was shipped almost immediately. 

As far as LVP goes, you might check this place out: http://www.finitesite.com/d3jsys/  I sometimes take a long time to get to things.
Help build our Wiki!

David

Quote from: bellyflop on November 14, 2005, 11:58:18 AM
Quote from: David on November 14, 2005, 10:20:52 AM
For the PIC, use a 16F628 instead of the '84.  They're a lot easier to find.
I was suggesting another chip as well, but it sounded like Brandon might not want to modify code the first time out.  Substituting a 16f628 would require some minor changes to get it to work (as I'm sure you know   :)). 

Agreed, but changing an include statement didn't seem like it would be that hard.

NeveSSL

OK, parts ordered!  :)

I don't have the source code for this project, so I just went ahead with the 84A.  :)

We'll see how it turns out!

Brandon

Dave_B

Quote from: David on November 15, 2005, 09:11:53 AMchanging an include statement didn't seem like it would be that hard.
Don't you have to change your register addresses too?  It may just be bad coding on my part, but I've got all my 'variables' registers assigned to specific addresses that would stomp all over the extra registers in a newer chip.  Not to mention that somethings are in different locations between the two chips, requiring bank changing.

Help build our Wiki!

NeveSSL

Ok, Bellyflop... gots a question...

Would the "Serial Port Programmer - Socketed" work well for me?  Would it be compatible with most programs later?  I have a feeling it would be.  It's only $13 and says it supports both the 16F84A and the 16F877A, which sounds great to me!  :)  Here's a link:  http://www.sparkfun.com/shop/index.php?shop=1&cart=464222&cat=3&

It's almost at the bottom.  It's the eighth item down from the top, or the third item up from the bottom.  ;)  Thanks!

Brandon

Dave_B

That's basically the one I built on a spare breadboard, so yes it will definately work if your serial port is up to snuff.  The schematic is really straightforward for that thing and by the time I added S&H, it seemed a little too high for what I was getting.  Still, it's less than $20 to get started so there's no reason to be as cheap as me.   ;D

Don't forget to buy a serial cable if you don't already have one.  Check the box your PC's battery backup came in.  I found a nice one in there.  :icon_wink: 

Also, if you're going to be moving the chip back and forth (like I still am), it's worth putting it in a socket to keep from bending the pins on the PIC.  I used a machined-pin socket, but I don't know that you need to.  I broke one of the socket pins recently, so you do need to be a little careful when prying the thing up.  It's easy to do when you're moving it a dozen times a day.   
Help build our Wiki!

NeveSSL

#19
Heh... I thought it looked nice and I could get a serial cable from them from pretty cheap without having to source one locally (usually expensive) or getting one online (expensive, again, by the time I pay shipping and handling).  Plus, it would probably have a better chance of working and would look nicer... lol.

BUT, I'll look into the one you built.  :)

Brandon