| Electronics > Beginners |
| Beginner Components? |
| << < (15/19) > >> |
| rolycat:
--- Quote from: JacobEdward on February 24, 2015, 10:03:30 pm --- --- Quote from: Hero999 on February 24, 2015, 09:39:07 pm ---Hz is a unit of frequency, which is the repetition rate. The period is the length of time it takes for a waveform to repeat itself and is equal to 1/frequency. Duty cycle is how long the square wave is high vs how long it's low. A square wave with a frequency of 1Hz and a duty cycle of 50% will be high for half second and low for half a second. A square wave with a frequency of 1Hz and a duty cycle of 25% will be high for 0.25s and low for 0.75s. In both cases the period will be 1 second. --- End quote --- I'm aware of all of what you just wrote, my question was how does that differ from PWM? --- End quote --- Varying the duty cycle of a square wave is much the same as modulating the width of the pulses - Pulse Width Modulation. The additional factor with PWM is that the duty cycle may change with each successive pulse. This will be the case when using PWM to generate sine waves as described below. --- Quote ---...I was just referring to it being a square wave since that's what MCU's typically output (though now that you mention it, it would probably be useful to be able to generate a sign wave as well, how would you do that?). --- End quote --- There are several ways, but probably the simplest way to do it with a standard microcontroller is by low-pass filtering a PWM signal - yet another application for this useful technique. The frequency of the PWM signal needs to be much higher than the frequency of the sine wave. Incidentally, you do need to be careful with terminology when discussing electronics. A 'sign wave' is not the same thing as a sine wave, and there is no such physical quantity as "Htz". Frequency is measured in hertz (Hz). |
| JacobEdward:
--- Quote from: WattsUp on February 24, 2015, 10:31:58 pm ---In regard to your diode question, I am not in any way a professional, but their function is based upon a PN junction. Something about the electron flow? Anyway, try googling (a key part of most of my answer!) PN junctions to find out a bit more, and you will see they have other implementations. AfroTechMods on YouTube did a great, in-depth diode video if you want to learn more. --- End quote --- I actually found a good description of how diodes work, thanks! --- Quote from: WattsUp on February 24, 2015, 10:31:58 pm --- On the topic of programming languages, you will find that JavaScript is an interpreted language, which is slower than a compiled language (as mentioned before). --- End quote --- Yea, but that seems to be the only real downside compared to assembly... --- Quote from: WattsUp on February 24, 2015, 10:31:58 pm ---All I am saying is that for certain tasks, you will find it easier to directly influence the hardware with C --- End quote --- How do you know? --- Quote from: WattsUp on February 24, 2015, 10:31:58 pm ---You can get specific ICs for the job, as Hero999 said, but there is no point in using another MCU if it has the same capabilities as yours. --- End quote --- If it had the same capabilities as mine, but wasn't interpreting Javascript and was only tasked with generating a 50Mhtz 50% duty cycle square wave and nothing else, are you saying that wouldn't work? |
| BlueBill:
I've no idea why someone would start out with an Espruino. Seems like an odd choice for motor control. Most folks by a wide margin cut their teeth on the Arduino. It has a C like syntax and a simple cross platform free IDE plus an endless amount of info about the thing. Espruino not so much. I'm a PIC programmer myself, some folks might recall me as BlueRoomElectronics when I designed and sold PIC kits. Anyways, having a selection of parts onhand is nice but you still need to learn how to use them. You'll also need equipment, e.g oscilloscope, multimeter, soldering station... The OP seems obstinate in their choice of well... everything. That's not how you learn. |
| JacobEdward:
--- Quote from: rolycat on February 24, 2015, 10:59:11 pm --- --- Quote from: JacobEdward on February 24, 2015, 10:03:30 pm --- --- Quote from: Hero999 on February 24, 2015, 09:39:07 pm ---Hz is a unit of frequency, which is the repetition rate. The period is the length of time it takes for a waveform to repeat itself and is equal to 1/frequency. Duty cycle is how long the square wave is high vs how long it's low. A square wave with a frequency of 1Hz and a duty cycle of 50% will be high for half second and low for half a second. A square wave with a frequency of 1Hz and a duty cycle of 25% will be high for 0.25s and low for 0.75s. In both cases the period will be 1 second. --- End quote --- I'm aware of all of what you just wrote, my question was how does that differ from PWM? --- End quote --- Varying the duty cycle of a square wave is much the same as modulating the width of the pulses - Pulse Width Modulation. The additional factor with PWM is that the duty cycle may change with each successive pulse. This will be the case when using PWM to generate sine waves as described below. --- Quote ---...I was just referring to it being a square wave since that's what MCU's typically output (though now that you mention it, it would probably be useful to be able to generate a sign wave as well, how would you do that?). --- End quote --- There are several ways, but probably the simplest way to do it with a standard microcontroller is by low-pass filtering a PWM signal - yet another application for this useful technique. The frequency of the PWM signal needs to be much higher than the frequency of the sine wave. Incidentally, you do need to be careful with terminology when discussing electronics. A 'sign wave' is not the same thing as a sine wave, and there is no such physical quantity as "Htz". Frequency is measured in hertz (Hz). --- End quote --- Thanks, sorry about the Htz thing lol |
| JacobEdward:
--- Quote from: BlueBill on February 24, 2015, 11:01:59 pm ---I've no idea why someone would start out with an Espruino. Seems like an odd choice for motor control. Most folks by a wide margin cut their teeth on the Arduino. It has a C like syntax and a simple cross platform free IDE plus an endless amount of info about the thing. Espruino not so much. I'm a PIC programmer myself, some folks might recall me as BlueRoomElectronics when I designed and sold PIC kits. Anyways, having a selection of parts onhand is nice but you still need to learn how to use them. You'll also need equipment, e.g oscilloscope, multimeter, soldering station... The OP seems obstinate in their choice of well... everything. That's not how you learn. --- End quote --- Well, I've been wanting to program things other than Microcontrollers and Javascript is just about the best language for as wide a variety of tasks that exists... I'm not starting out on Espruino, I started out on Javascript and then converted to Espruino for electrical stuff... As far as being obstinate... to be completely honest, after explaining what I just said about 5 or 6 times, and having you people continually ask why... it sorta seems like the reverse is true... I don't need to learn another language since I have espruino, and if I don't have to, I'm not going to... |
| Navigation |
| Message Index |
| Next page |
| Previous page |