Shop OBEX P1 Docs P2 Docs Learn Events
Hardware side of things... — Parallax Forums

Hardware side of things...

siljamickesiljamicke Posts: 66
edited 2010-08-30 03:06 in Propeller 1
Hello forum!
This is my first post here... I have just bought the 40-pin dip version. When i look around the internet and in books, a lot of the things concerning the hardware side seems to be common knowledge to all but me. I have some experience from programming microprocessors through the C64 (excellent for learning on, great community), so a lot of the programming concepts are familiar, but i lack the knowledge in electronics.
People in general seem to come to it the other way around. They seem to know all about electronics but struggle more on the software side.

Where do i go for learning all the basic stuff?
I need to have fast hacks on non-lethal subjects, in the spirit of "this resistor works in series with that led" or "you can interface a speaker this way", or "yes/no, it's perfectly fine/a BIG no no, to just solder leads from a wall-wart rated at 3V 0,5A directly to the propeller"...

In other words, i don't need "You need to fully understand how to implement Ohms law on every single point in a circuit" or "You need to read the timing diagrams". I need to start out getting creative, and not hearing that i need a degree in math and electronics engineering, i'll aquire that later on :)...

For example, i was so glad to find out that you could actually use just a resistor as a crude DAC, something that is never mentioned in a schoolbook on digital techniques, even though it is not at all suitable for most situations. It never occured to me that it could be that simple. I need more of those encouraging discoverys! Had another yesterday when i realized you don't actually have to have a regulated 3,3V, 3V atleast makes the thing run. I know, i'm totally left behind regarding this. But the schematic in the beginning of the manual showing how to connect the Propeller Plug isn't very inspiring :) It doesn't blink or make any sounds...
Info is scarce for us coming from the non-electonics side of life. I'd like a manual in the style of webPM-v1.01 but with schematics and interfacing/implementations of the chip, the equivalent of "blink.spin" in breadboard layouts. Basic stuff perhaps, but i feel too intimidated just to try things, so i don't, and feel discouraged :(

Whoa, a bit too long a post maybe, but it felt good coming out as an "electronics-ignorant"!

---EDIT: I now read the manual with my eyes not closed for a change, and two of my questions is answered right in the manual on page 90. Nevertheless, i'd like more :). More tutorials for fools like me! ---


Sincerely,
Mikael

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-26 06:27
    The notion about "give someone a fish and they can eat for a day; teach someone to fish and they can eat for a lifetime" applies to electronics too. I can tell you that a particular speaker will work with a Propeller I/O pin, but it may only work under the circumstances you've got and might destroy the chip in other circumstances and that says nothing about other speakers. If you understand the principles involved, you should be able to figure it out for yourself. These include Ohm's Law and some other basic electronics.

    Some of the best tutorials on basic electronics used to be found in the ARRL's Amateur Radio Handbook. They also publish Understanding-Basic-Electronics.

    You might do a Google search for on-line basic electronics tutorials. There was a thread here once on learning basic electronics with some links to free stuff, but, with the forum transition, I've lost the link.

    Regarding your 3V "Wall Wart" ... again, it depends. If it really puts out exactly 3V under all circumstances, you should be able to use it. On the other hand, if it ever puts out more than 4V, even transiently, your Propeller and maybe some other chips will be toast! If its output voltage falls below 2.7V, the Propeller may quit working. None of this is magic ... it's all spelled out in the Propeller's datasheet and pretty straightforwardly.
  • siljamickesiljamicke Posts: 66
    edited 2010-08-26 06:46
    Thanks for your swift reply!
    I admit i sound a bit too ignorant. I do know enough about electronics to know that i don't know anything, and enough about Ohm's law to know that everything depends on everything else. That's my problem, i don't dare to venture anywhere in this field. Maybe what i search for is a collection of basic working schematics like the one on p.90 in the manual.

    I just took some leaps of faith and hooked up eight leds! Four of them are not red, i'm all out of reds now, but i will try it anyway, just to push myself beyond my limits. I even dared to choose a resistor value of 270 Ohm :)

    You see, even a failure is success for me. I love the memory of when i hooked a led to 9v without a resistor, *pop*, but nothing caught fire.
    For $15 dollars, i'm prepared for the event of a dead prop, as long as i've made something beyond staring at the chip in the ESD-bag, dreaming of a day when i will unpack it...
    I know not to use mains voltage, only small batteries. I know electrolythics can explode. I know there is danger involved sometimes, but surely, a speaker won't kill me from 3 volts, or could it?

    Maybe i sound just as ignorant this time :). I will however proceed now to try a blinking led! Wish me luck...

    I'll check out your ARRL web-tip!

    Thanks!
  • bill190bill190 Posts: 769
    edited 2010-08-26 06:53
    For the short term, the best source of information on how to connect this or that is right here! Go to the Parallax store and click on various devices, then select one specific device and there will be free documentation for that on the lower right of that page. *Every* gizmo is extremely well documented here.

    Also at the store, click on Basic Stamp different kits and Propeller different kits, then look through the index in the manual for each kit. There will be all sorts of projects documented. For example there is a Stamp signals kit as I recall and all sorts of projects in the book relating to signals.

    Here is the link to the Parallax store...
    http://www.parallax.com/Store/tabid/60/Default.aspx

    For the long term, learn how each separate component works. Say spend one entire day reading about resistors. Search the internet and learn all about resistors. Next day diodes. Then capacitors, transistors, logic gates, etc. Spend one day one learning about each part.

    Then you will be able to read a book on basic electronics (book stores/Radio Shack) and much better understand what it is talking about.

    I learned that a long time ago. If learning a new subject, write down all the words and acronyms I don't understand, look them up, THEN read the book and I will understand what it is saying.

    Sometimes I have trouble with basic things though. I was reading an automotive repair manual and it kept referring to the "MT" model. I searched all over trying to figure out what an "MT" model was....

    It turned out to mean "Manual Transmission"! :smhair:
  • K2K2 Posts: 693
    edited 2010-08-26 07:00
    Never overlook PELabsFunBook-v1.1.pdf. It's more FUNdamental than you might suspect.
  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-26 07:01
    See, if you used some basic electronics concepts like Ohm's Law and Kirchoff's Law and information from an LED datasheet, you could figure out the LED resistor thing by yourself.

    From the Propeller's datasheet, an I/O pin produces a voltage of Vdd-0.3V for a logic high or 0.3V for a logic low. With a nominal Vdd of 3.3V, that's 3V output to the LED.

    LEDs have a forward voltage that depends on the materials used to make it. For IR or red LEDs, this is typically 1.7V. For other color LEDs, it can be 2.1V or 2.3V or 3.1V or other values. You have to check the LED datasheet for the value. If it's greater than 3.0V, you won't be able to drive it from a Propeller I/O pin without some additional circuitry.

    So, 3V - 1.7V = 1.3V. This is the voltage drop you'll need across the current limiting resistor.

    You need to figure out how much current you want to flow through the LED. From the Propeller's datasheet, the maximum current available from an I/O pin is 40mA with other limits on the total I/O current for the whole chip. If you look at a typical LED, the maximum current is 20mA. More may damage the LED. For the purpose of this example, 10mA should be more than enough. By Ohm's Law, R = E / I = 1.3V / 0.01A = 130 Ohms. The closest standard value is 120 Ohms. Your 270 Ohm resistor should allow about 5mA through the LED which is more than enough for visibility.
  • Dr_AculaDr_Acula Posts: 5,484
    edited 2010-08-26 07:50
    If you can program a C64 the prop should be just the thing for you!

    I reckon with electronics you need to know a few basics, but then it is a matter of "see one, do one, teach one"

    Mike has answered the led question very well.

    For the speaker question, yes you can build a LM386 amp or a LM380 or any number of amplifier circuits. For a really quick and simple 'beep' test, stick a 100 ohm resistor in series with the speaker.

    No, a speaker won't kill you from 3V. You need about 50V before things get dangerous.

    Electrolytics can explode, but only if you put too many volts on them, and the voltage rating is printed on the side of the can. Tantalums explode if you put them round the wrong way.

    You don't need a CRO to do this sort of thing (contrary to some comments on other forums, where the vibe is that you need $1000 worth of test equipment to flash a led), but a $10 multimeter can be very handy. Especially useful to check that 3V really is 3V before you pop in the $15 chip.

    If you can get a led to blink, you are well on the way.

    Back in the olden days, you needed a pile of manuals or someone prepared to show you all this stuff. These days, all you really need is a 1) digital camera to take a photo of the setup, 2) the ability to cut and paste code into a forum window, and 3) this amazing forum!
  • potatoheadpotatohead Posts: 10,261
    edited 2010-08-26 07:55
    I too am learning the electronics part of things.

    What I find handy is to follow the design projects here, and to ask questions. (I've only asked a couple, because I learned the basics needed for a prop from the activities of others here)

    If I were you, I would get the bill of materials for the PE Kit, or buy the PE kit, and download the labs.

    Since you have a DIP 40 Prop, take a look at the basic Prop circuit found all over the place, and in the Prop Manual, or in those labs. If you have to, ask here about using a regulator, and obtain one.

    If you do the basic circuit correctly, and understand why it does what it does, then you can build out other small, fun things, learning along the way, without killing your Prop! Regulators added to that, make the Prop pretty robust. Nick who does Gadget Gangster, has some great design kits with instructions and schematics you can build up too. Recommended.

    It's nice to have a working reference board. A Proto board, or Demo Board is a great start. What I did early on, for some simple circuits, was to run some ribbon cable from the Demo Board I had, to a breadboard, where LED's and stuff can be connected and operated on.

    What's great about it is you can then work on software with few worries, and when you get it to the point where you want to weave some hardware into the mix, you do that piece, with other stuff under control. That's how the best learning happens, IMHO.

    Edit: I second Dr_A's post. Yeah, if you've been jamming on a C64, the Prop is going to be a blast!
  • siljamickesiljamicke Posts: 66
    edited 2010-08-26 09:02
    Thanks for all the great responses! You guys should be proud of your forum, it seems really friendly and helpful!

    I'm a bit more read up on electronics than i might have proposed in my first post. I have been reading texts and books for a couple of years, but since i never practise for real, but rather just reading small bits here and there, everytime i try to approach it, it overwhelms me.

    I'm not yet comfortable with juggling 10 different datasheets, a calculator and about 20 fragmented tutorials on linear and discrete electronics :)

    Can i post two more really silly questions here, questions which i'm sure i can find here somewhere;

    Silly question 1. What really happens when i supply the chip with 3V (2xAA batteries)? Is it dangerous to the chip if the voltage fluctuates, or drops below some level?

    Silly question 2. For the I/O-pins, what of these conditions are dangerous, too high current flow, too low current flow, unconnected pins? (I'm guessing the first one is dangerous, the other two not a big problem, with the exception of the last maybe being unpredictable if it is configured as input)

    The thing is, since i have no practical experience, i have only been reading, i don't know where to draw the line regarding theory versus just hooking it up and try it. I mean, is it really nescessary to calculate heat dissipation in a led (bad example maybe, but then again in my world it seems that you have to account for the power all the time or?). I don't know when to study the inductive and resistive property of the coil in the speaker i just ripped from a toypiano and when to, as proposed earlier, just connect a reasonably sized resistor in series and see if i get any bleeps?

    To put it in different words, I have some knowledge of electronics, what i lack is the feel for electronics.

    Geez i post too long :smhair:

    Thank you guys anyway, i have lots of links to check out!
  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-26 09:42
    Q1:
    Again, look at the datasheet for the Propeller, page 25 where there's a table of Absolute Maximum Ratings, there's a maximum voltage that can be supplied to any pin relative to Vss (ground). Under DC Characteristics, there's a maximum supply voltage and a minimum supply voltage. If the supply voltage goes over the absolute maximum, even for an instant, you will probably damage the chip. The maximum and minimum operating supply voltages are somewhat dependent on chip temperature and desired operating frequency. See the graph on page 31 for specifics.

    Q2:
    Back to the datasheet ... On page 25, there's an Absolute Maximum Rating for current into or out of any I/O pin and total current into Vss or out of Vdd. More than that will damage the chip's internal wiring. There's no specification for too little current because CMOS logic really doesn't work that way. With CMOS, you're mostly charging capacitors made up of the wiring itself and the gate capacitance of the input circuits and the current starts off relatively high, then decreases to nearly zero as the capacitance charges up. If you have unconnected pins that are configured as outputs, there's no problem. If you have unconnected pins configured as inputs, the voltage they "see" floats. If you bring your hand nearby or a wire carrying another signal comes close, the unconnected pin will have some of the voltage carried by your hand or the wire induced in the unconnected input circuit and that will cause the input circuit to partially switch on (or off) and draw power supply current that's essentially wasted. It's always best to connect unused logic inputs through a high value resistor (like 10K or 100K) to either Vdd or Vss.

    What you're describing as "feel" for circuits is also considered as a sign of experience. You start out by working through examples in various tutorials (like those in the Propeller Education Kit or those in the Stamps in Class tutorials). They're worked examples with "good" parts values, known to work. You then start experimenting. You should have a good multimeter ... RadioShack sells perfectly good ones for as little as $17. If you can afford it, get something like the PropScope so you can look at the actual signals. See what happens when you attach a speaker to an I/O pin and activate it. Make sure to have the reverse connected diode recommended for an inductive load like a speaker, motor, or solenoid (including a relay coil). See what happens to the signal with the diode. Watch for a voltage spike across the coil as the I/O output pulse cuts off. You'll see that the diode clamps off the spike.
  • siljamickesiljamicke Posts: 66
    edited 2010-08-26 11:39
    Wow, thanks Mike!
    There's one right now, one of those tips that will stick in my memory probably forever, diodes in series with inductor loads to avoid voltage spikes! I'm a musician for a living, and i will as soon as i've done blink2.spin try my hands at some bleeps!
    Once again, congratulations on a great product suite, wonderful community and may you all be prosperous in your tinkering!

    From Sweden with Love!
    /Mikael
  • siljamickesiljamicke Posts: 66
    edited 2010-08-26 11:42
    ... and also, i do, and i will continue do, read datasheets for parts. It's just another of those overwhelming sources of information for a newbie hobbyist. Graphs and what not :smilewinkgrin:
  • siljamickesiljamicke Posts: 66
    edited 2010-08-26 12:10
    Running lights, hehe... :scool:
  • Mike GreenMike Green Posts: 23,101
    edited 2010-08-26 12:17
    The diode is in parallel with the speaker, not in series, and the polarity of the diode is to oppose the flow of power.

    When you turn off power to an inductor (or other coil), as the magnetic field collapses, the coil and collapsing magnetic field act as a generator and produces a voltage spike (at low current) that's opposite in polarity to the original electrical energy. This voltage spike can instantly burn out an IC like a Propeller. The "reverse connected" diode short circuits this voltage before it can build up, limiting it to about 0.7V which is not a problem for even a low voltage IC.

    For an example of this, look at Nuts and Volts Column #6 which discusses controlling small motors and relays with a Stamp I/O pin. The same issues apply to speakers and Propellers. Go to the main Parallax webpage, click on the Resources tab and you'll see a link to the Nuts and Volts Columns index.

    If you haven't seen it yet, check out Open Stomp
  • siljamickesiljamicke Posts: 66
    edited 2010-08-26 12:59
    Oh, i've checked out open stomp a few days ago!
    A bit out of my legue, but these kinds of things is what drives me. And it is amazing that the Prop does these kinds of things. I have applications dreamt up that will surely fit the Prop... Now i only need to understand those electrons whirling round my breadboard ;)

    Why can't the diode be in series if i only output positive voltage? Is it perhaps because the spike would fry my puny diode reversely aswell...

    About your previous comment "give a man a fish..", i see it more in terms of "show a man cool enough fishes that he'll want to learn fishing for real" :)

    Thanks though, for this was another of those cool fishes!
  • DaveJensonDaveJenson Posts: 375
    edited 2010-08-26 13:10
    There is a pretty good set of tutorials on basic electronics over on
    http://tronixstuff.wordpress.com/electronics/
  • StefanL38StefanL38 Posts: 2,292
    edited 2010-08-28 13:06
    If you take the next best hit from google about electronic circuits or the next best book found in the library or at amazon.

    I'm pretty sure that it is hard to understand. You have to take yourself time
    to find one that is easy to understand for YOU.

    I do this with a very simply method. opening the book on page 10 or 20 and reading 4 or 5 sentences.
    If I do not understand I put the book back on the shelf. Taking the next one.
    Really until I found one that I can easy understand.
    Sometimes this method took me 20 books or more but finally I will find one that's easy to understand.

    Here is a link to a tutorial that is good - in my opinion

    Lessons In Electric Circuits

    As you are working with LEDs and need a serial current limiting resistor
    Just take a look into this chapter

    SERIES AND PARALLEL CIRCUITS

    to check if this style of writing is easy to understand for you

    If yes stay with it - if no check the next one

    best regards

    Stefan
  • siljamickesiljamicke Posts: 66
    edited 2010-08-29 05:39
    I have had good patience with reading texts i don't fully understand before. After a while i piece together the picture from multiple sources. I'll have a go at your link!
    Thanks!
  • SeariderSearider Posts: 290
    edited 2010-08-29 06:03
    siljamicke,

    I can sympathize with how a data sheet can seem overwhelming at times. I can get a new part, look at the data sheet and get 5 or 10 pages of specifications and performance charts. The key for me to get past this is to realize that most of the information is not useful to me. At least it is not useful for beginner circuits and when you get to the place where you need to know some of the more esoteric details you will most likely be comfortable reading a data sheet. When I look at a data sheet the first thing is to find the part of the specs that apply to the part I am using. It is not uncommon for a data sheet to contain specifications for 2, 3 or sometimes more similar parts. Next is to look at the Maximum and Minimum Supply voltage to be sure it will work with my current circuit. Next, what are the maximum current limits. If you abide by the maximum voltage and maximum current limits, then you are unlikely to damage the chip or other connected chips (I say unlikely, but not impossible).

    Reading specification sheets does take some practice but there is really no way around it unless you want to limit yourself to building circuits that others have designed and published.
  • Bob Lawrence (VE1RLL)Bob Lawrence (VE1RLL) Posts: 1,720
    edited 2010-08-29 19:07
    A few hardware tips from Warranty Void:

    DIY
    The original Propeller Cookbook is a recommended resource for anyone getting started with the Propeller Protoboard. It contains instructions for basic video, audio, SD, and more.

    http://ucontroller.com/Propeller%20Protoboard%20Designs%20for%20the%20Beginner.pdf
  • siljamickesiljamicke Posts: 66
    edited 2010-08-30 03:06
    Thank you! This is exactly what i was talking about.

    Now if i could only find the docs explaining assembly a bit more thoroughly than the manual...

    Everywhere i search on the forum, as soon as i find texts about assembly, i get the 404 file not found greeting... Should i be searching somewhere else for it?
Sign In or Register to comment.