Components Bin, Power Supply, & General Electronics

I posted mostly the same questions to sci.electronics and exactly the same questions to c.a.e.piclist, but received no reply after several days, so I'm posting it here in the hopes that people here will be more able to help:

I'm new to electronics in that I've never actually built anything before (I know the basic theory/forumals though, and have drawn up schematics, etc, but I've never actually built anything), and recently I have become interested in electronics as it applies to microcontrollers.

I'm fairly certain I'll have no problems with the microcontrollers themselves(the PIC12F675, PIC16F877A, and PIC18LF4539 for now) since I've done assembly programming on several platforms before and the data sheets from microchip seem to be very complete with respect to programming. However, the electronics part is giving me some problems.

I want to do many random projects, but I'd like to work toward making an NES-level game by both assembling the hardware and programming the software myself. I don't mind using several PICs as 'dedicated cpus', since I know things like sound processing and video processing might be difficult to do in the middle of such a 'processor intensive'(for PICs) game's code.

My primary problem is that I don't have any parts at all since I've just become interested in electronics. I do have the extreme basics - some assorted resistors, LEDs, a multimeter, and some wire. I need some help figuring out what other components I'll need to do general tinkering with PIC-based circuits.

I know I'll need a PIC programmer, but I'd rather not buy one of the $100+ programmers. I do want one that works on multiple chips, so I'm thinking about the $13 "Serial Port Programmer - Socketed" from

formatting link
Is that a good choice for a

Reply to
Extrarius
Loading thread data ...

Interesting idea. Most of the difficult work in this will be generating the tiles and sprites, and collision detection. This would be considerably easier to implement in programmable logic (FPGA) than on a PIC, IMHO. And on the PIC you have irritating memory addressing limits. I'd suggest you start with something substantially less ambitious than a NES-alike, though. Maybe a Pong-alike (which has been done in a PIC, BTW). Later, work your way up to emulating those multi-game ASICs AY-3-8500 and AY-3-8610A (search google to see what I mean). I'm told these chips were really masked, customized PICs anyway (though I don't 100% believe it).

For the _extremely_ complex waveforms you will be working with in this project, a scope is mandatory equipment. It doesn't have to be high-end - 20-40MHz would be adequate. Storage capability is exceedingly useful. I use a Tektronix TDS210 for these sorts of low-speed circuits.

Your proposed circuit isn't digital, though - it's mixed-signal (unless you were planning to drive a TTL monitor and you don't want sound). There are kits available from Digi-Key, All Electronics (cheaper), Jameco, et al. I've been in your sort of position a few times (had to throw away all my component stash due to moving house) and I handled it by designing my next project on paper first, then ordering a 10x oversupply of the passives I'd calculated on paper, as well as two steps either side of the calculated value. Given the tiny cost of these parts, it's not much of an investment.

A tube of op-amps is always useful to have, I keep LM358s lying around for random experiments. You'll probably also, for your specific project, want an audio power amp - the LM386 is the hobbyist's friend. I don't immediately see why you'd need 555s, but there are many fun circuits you can build around them, it can't hurt to buy some.

By the way, look on eBay for components. For example "resistor kit" and "capacitor kit". LOTS of prototyping material there.

You need a smoothed, regulated, adjustable current-limited power supply, preferably with integral voltage and current meters so you don't have to probe everywhere with your multimeter. Something like a BK Precision 1610A would be suitable.

If you want to build your own, search google for "bench power supply schematic" and be selective. For instance, is voltage-adjustable but not current-limited. If you like to live dangerously...

Reply to
Lewin A.R.W. Edwards

Perhaps, but I've found MUCH, MUCH more information on PICs, and they are much closer to what I already know (I've done tons of normal PC programming as well as assembly for the Z80 and 68k, which from what I've seen is quite a bit closer to PIC assembly than the hardware design languages for FPGAs). Perhaps if you know of some good resources on FPGAs I could look into them more.

I'm not starting with a 'NES-alike', I just want to work toward that. By that, I mean I want to eventually learn through smaller projects all that I'd need to create that kind of game.

Unfortunately, even the inexpensive scopes I can find are out of my range for now. I just don't want to spend much on this yet since I'm not sure I'm really going to dig in deep. Maybe if the low-end projects get me hooked I'll shell out for the fancy(even a low end scope is such IMO) equipment. I'll do TV signals last, probably B&W first as demonstrated by several sites out there.

That sounds like a good idea, but really its been so long since I did any kind of electronics at all (the little bit I did in my physics class) that I'm not sure I could design something on paper. At the very least I'd need a good book on it or somesuch, and that was part of the reason for this post (to find a good book on electronics in general and digital or analog specifically)

What are op-amps used for? Obviously they amplify something, but I thought they were only used to boost audio output or the like?

I did so for capacitors, and the only inexpensive results were from a uk website selling kits. The shipping isn't too bad either. The only thing that sticks out to me is that the voltage ratings are much higher than I'd need(63V when I'm using 5V). Does that really make a difference as long as it is high enough? I'm remebering less than I thought I would about basic electronics.

It isn't that I want to build my own really, its just that I'm not willing to spend that much on something I might not stick with. Also, I don't need something so complex as being adjustable(as in knobs and buttons) etc, because I don't mind having to set up a different circuit on the breadboard to control a simple plugin AC adapter or the like.

Reply to
Extrarius

Implementing this kind of thing in software on a PIC is a real pain in the ass. It's best implemented as hardware logic. Your choice - wire together hundreds of gates, counters and so on by hand, or draw the schematic in a CPLD/FPGA design tool and have it generate the right upload file for you.

I'm speaking specifically of the NES thing here. There's a lot of data that needs to be combined in complex ways. For the simpler projects, yes you could do them all in firmware on small micros.

Huh? How exactly do you expect the design process to work, then? Are you planning to glue together components randomly until something happens?

is good reading. Particularly read AN-31.

The tradeoffs are cost, MTBF and size (among other things), and neither of those really affect you. Yes, you can use "63V" caps in 5V applications.

Look at seller "nfceramics" on eBay (no, this is not me, or anyone I know; I've just bought a couple of things from him). For instance he sells an interesting little LM358 experimenters' kit with various R/C values and some 358s.

If you're only working with a 5V circuit, then, you can use any old AC plugpack with high enough output voltage, four diodes, a capacitor and a

7805 to get the power supply you want.
Reply to
Lewin A.R.W. Edwards

Having dealt with all sorts of complex data regimes with video I could not agree more here.

Another good resource is TI App Note Op Amps for Evryone

formatting link

For general Electronic books if you can afford it

The Art Of Electronics by Horowitz and Hill

--
Paul Carpenter          | paul@pcserviceselectronics.co.uk
    PC Services
              GNU H8 & mailing list info
             For those web sites you hate
Reply to
Paul Carpenter

Well, I was hoping for a reccomendation on a good book or two that would help me get started again. This post had 3 main parts: what components do I need, how to build a simple power supply, and information/resources/books/etc on electronics (in general or on each type specficially).

Reply to
Extrarius

Here's a really good starter electronics book - it steps through the basics using practical projects (incl a benchtop power supply):

formatting link

For your purposes, the power supply need be little more than an 5v LDO regulator and a power pack running at ~6v. (Higher will work, but the LDO will run hotter.)

When you start getting into the MCU arena, this is a great book: Designing Embedded Hardware

formatting link

This one's more high-level, but also good:

formatting link

Art of Electronics of a great text too, but not for starting out, IMO:

formatting link

HTH, Richard

Reply to
Richard

If you have access to electronic surplus dealers, you should check them out for power supplies. When I'm breadboarding stuff I usually use a PSU I got from a dealer in Silicon Valley. I think it was from some sattelite TV system or something. It provides me with +- 5V & +- 12V, though for most things +5 & +12 would be fine. Cost me SFA.

--
Burn the land and boil the sea,
 You can't take the sky from me.
Reply to
Geoff McCaughan

As well as books, www info, etc, you need experience. Do some small projects and work your way up to the more ambitious stuff.

--
Burn the land and boil the sea,
 You can't take the sky from me.
Reply to
Geoff McCaughan

Thanks for the recommendations. After some searching, both:

Tab Electronics Guide to Understanding Electricity and Electronics The Art of Electronics

were highly recommended, so I ordered them both. I'm more of an academic at heart than an engineer so I'm more willing to buy books =-) Hopefully they'll guide me into practical experiementation in electronics and help me overcome that difficulty.

I also have a book on VHDL coming because its the text for one of my college courses. The course won't go into depth because it is an into class, but perhaps the text will. That will hopefully help me put my head around how an FPGA would be better.

Reply to
Extrarius

If I were you I would get all my stuff at ebay, new components sell for below wholesale, used scopes and power supplies can be bought for $10, and books are almost free. Of course, it may take some time to find what you want, but thats the price you have to pay if you can't afford new stuff.

However for information I wouldn't suggest any books, I would suggest getting back copies of magazines like Nuts and Volts and Circuit Cellar for ideas/circuit examples, they usually explain the basics and get you going quickly. If thats too expensive the web has more then you need.

steve

Reply to
steve

If I were you I would get all my stuff at ebay, new components sell for below wholesale, used scopes and power supplies can be bought for $10, and books are almost free. Of course, it may take some time to find what you want, but thats the price you have to pay if you can't afford new stuff.

However for information I wouldn't suggest any books, I would suggest getting back copies of magazines like Nuts and Volts and Circuit Cellar for ideas/circuit examples, they usually explain the basics and get you going quickly. If thats too expensive the web has more then you need.

steve

Reply to
steve

Hrmm, I had an interesting idea. From what has been said here and various sites I've found, it seems the hardest part is generating the various analog signals(color video seems to be the most difficult, but also audio) with proper timing on a PIC.

So what about using a small FPGA to make a 'video/audio card' type device that can take instructions from the PIC and load the tile images/etc from external memory(probably EEPROM) when needed. With about 52us per scan line, I'd need ~160ns or faster access time on the memory to get the desired 320*200 resolution, which seems to be available in quantity. It seems to me that the only question would be getting the data from the 'slow' PIC to the 'fast' FPGA.

Of course, I have no idea how difficult that would be, but it seems to mirror the way things are currently done on computers where there is are seperate devices for specialized tasks like video and audio output.

It seems like that would possibly be a lot easier than making the whole thing on a FPGA (for me, since I don't know hardware design but I do know normal programming).

Also, what do you mean collision detection would be difficult? I guess it would be if I wanted per-pixel collisions or something, but that isn't neccessary for the kinds of things I have in mind. Would the slow speed of a PIC make even simple bounding box checks too slow? I've been looking around and considering switching to the SX chips offered by Parallax/Ubicom, since they can run up to 75Mips as opposed to the mere 10Mips of the fastest PIC chips, but the high end PIC chips have much more flash/ram/eeprom onboard that might make managing things easier.

Or maybe I'm just way off base because I'm completely new to this field =-)

Reply to
Extrarius

Don't make things difficult for yourself. AFAIK, the SX chips are based on a very primitive PIC core. They are a pain to program. For the more powerful stuff, I'd recommend an ARM or other decent 32-bitter, and use C.

You only learn by making mistakes :-)

cheers,

Al

Reply to
Al Borowski

And getting rid of the 'slow' PIC would solve a good part of the problem for you ;-)

Seriously, I suspect you're suffering from "new hammer disease", to some extent. You know, the one from the saying "If you just got a new hammer, everything you see suddenly has a way of looking like a nail."

The PIC series of micros may be famous and widely used in hobbyist circles for various reasons, but that by no means does that imply that it's the right choice for every hobbyist project in the world. For a project as ambitious as yours, trying to do your own animated video output, while still having enough juice left to do not entirely pre-recorded audio, I rather strongly suspect it's inadequate. A bit like trying to move a 4-person household between towns using nothing but an old VW beetle as transport --- sure, it may be possible, if you really put your mind to it (and you don't have too much heavy furniture), but why would you want to, if you can just rent a proper moving van instead?

"Currently"? I'm quite certain it's been that way pretty much since forever, i.e. all the way back to the days of the very first things called "computers" that weren't human beings paid weekly salaries to do computations using pencil, paper and brain. Generating analog signals from digital video frame buffers and pre-recorded audio samples is almost invariably a task so demanding, yet untypical, that there's no way a common, non-specialized CPU could compete with dedicated, specialized hardware. Audio is often handled by somewhat general-purpose DSP chips these days, but for actual video (i.e. anything at or beyond the resolution of a TV), there's not much doubt you'll need specialized hardware. Even an FPGA would likely be overly generic for that --- using an actual COTS video controller might well be the better idea.

--
Hans-Bernhard Broeker (broeker@physik.rwth-aachen.de)
Even if all the snow were burnt, ashes would remain.
Reply to
Hans-Bernhard Broeker

Well, it kind of kills the oldschool feel when you have 150+ times the available processing power =-/ Programming a 386 was easy enough, and unless I'm mistaken an ARM has quite a bit more power than that.

If I'm going to use an ARM, I feel like I might as well just make games on my PC and skip the electronics stuff all together. Also, from what I've seen of ARM assembly, it isn't so great (though as you said I could just use C or even go for one of their java cores, but again the idea was to have a challenge).

I'd much rather have something slow at least, maybe something from zilog or an old 68k or the like where I at least have to try to get some good performance.

Or maybe I'm underestimating the electronics of using an arm? It seems like it would be much easier since all the parts would probably have much stricter requirements as far as how the connections go. Also, wouldn't I still need some kind of 'video card' if I didn't want to count clock cycles for the proper timing of video?

Reply to
Extrarius

Well, really, I'm not stuck on PICs, its just that doing it in an FPGA sounds kind of scary because its entirely uncharted territory for me, and I've seen some pretty impressive projects done with them (for ex, XGameStation, thought it uses an overclocked SX chip). Also, there is a ton more information (that I can find anyways) on PICs than FPGAs or other solutions.

Also, it seems like making hardware to act as a 'hard coded processor' (which is what I'm understanding of doing it as an FPGA) would mean a LOT more work to make a new game using the same system since I'd have to create a whole new 'hard coded processor'. Maybe 'programming' hardware isn't really that different from creating software? If that is the case then it might not be a big deal, but it seems like it'd be much more difficult.

Anyways, reguardless of how inappropriate they are for my goal project, they will hopefully help me get familiar with electronics, which will help me then move to whatever more advanced equipment I need.

I didn't mean to imply it has ever been different, but really I wasn't sure it had been and didn't feel like researching it for such a simple comment.

Reply to
Extrarius

It depends on the chip of course. You have the low end ~30MHz (I think) Philips microcontrolls, right up to the 400MHz+ beasts.

Really? why?

The only advantage to using an ARM for this kind of thing is more processing power. You still have the fun of making a PCB, connecting any additional devices and programming for them, translating between all the different weirdo voltages :-) etc.

Strange, I think ARM is the nicest CPU I've programmed for yet. _miles_ ahead of PIC. You can generally do up to 3 things with every instruction; a test, an ALU operation, and a shift. You can do some tricky things with it if you're careful:

--
If ( (R1==R2) and (R3==R4))
Then (R5=5*R6)
Reply to
Al Borowski

There are many ARMs with on-chip LCD drivers, e.g. Sharp LH79xxx series. These are actually quite easy to use. For an assembly programmer, the ARM is one of the nicest CPUs around - even more fun than a 68xxx.

Stephen

-- Stephen Pelc, snipped-for-privacy@INVALID.mpeltd.demon.co.uk MicroProcessor Engineering Ltd - More Real, Less Time

133 Hill Lane, Southampton SO15 5AF, England tel: +44 (0)23 8063 1441, fax: +44 (0)23 8033 9691 web:
formatting link
- free VFX Forth downloads
Reply to
Stephen Pelc

d'oh! I should have mentioned this, as the one I'm programming now has such a driver :)

Al

Reply to
Al Borowski

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.