Electronics > Beginners

Beginner Components?

<< < (14/19) > >>

JacobEdward:

--- Quote from: Hero999 on February 24, 2015, 09:39:07 pm ---JavaScript is a perfectly reasonable way to get into MCUs. Many other people here have started programming MCUs in other languages than C or assembly. BASIC is another common language which is supported by MCUs (remember using that Simon?). At some point you'll probably discover something you can't do in JavaScript and will need to learn C though.

--- End quote ---

Javascript is a turing complete language, there's nothing any other language can do that Javascript cannot do so if C can do it, then Javascript can... that said, what is something you expect I'll find that Javascript can't do?  The only thing so far is speed... hence the question  (thanks for actually providing an answer to it btw, not sure why that was so hard for Simon) javascript modules for espruino microcontroller


--- 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?  I think this was more of Simon being a Jackass than it was about anything fundamentally wrong with what I was asking... 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?).

JacobEdward:

--- Quote from: Hero999 on February 24, 2015, 09:50:42 pm ---The answer is yes, it is possible to connect another IC to a microcontroller and use it to generate a signal.
http://www.analog.com/media/en/technical-documentation/data-sheets/AD9851.pdf
http://www.analog.com/media/en/technical-documentation/data-sheets/AD9835.pdf

--- End quote ---

Is it possible to block people on this forum?  Not particularly interested in reading comments from Simon if he's going to be abusive and deliberately unhelpful

WattsUp:
 Sorry to break this up!
  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.

  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). I have nothing against JavaScript and have used it extensively in web development, and fair play for wanting to use something you are comfortable with. However, you have to think about layers of abstractions (maybe look at the MIT Open courses online for more info), which are basically layers. As you add abstractions, the functionality is a higher level, and the task for you becomes simpler. You have to realise that you are further from the hardware when using JavaScript, which means it will run slower and have less control. It is unfair for people to say you have to learn C though, since even C is not quite as fast or low level as Assembly. All I am saying is that for certain tasks, you will find it easier to directly influence the hardware with C; also, you are severely limited to your choices of MCU, which is why professionals will use C or Assembly. You are also limited by what other people have done i.e. someone has to have written the module of code that takes your JavaScript and 'turns it into' machine code.

A final thing, PWM is a combination of what Hero999 wrote. It is just a way of analogue like control using digital signals, without having to use a DAC. A PWM signal is made up of these parts, and you will be able to identify them on an oscilloscope. 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. Look in the datasheet of your MCU and take a peek at the PWM section. It'll probably be complicated but give it a go.

Ben
P.S. I apologise if some of this is not completely correct, I'm 14 and by no means a professional!

Mechanical Menace:

--- Quote from: JacobEdward on February 24, 2015, 10:03:30 pm ---Javascript is a turing complete language, there's nothing any other language can do that Javascript cannot do so if C can do it, then Javascript can...
--- End quote ---

In the sort of processing it can do, the sort of computational problems it can solve, yes. But...


--- Quote ---that said, what is something you expect I'll find that Javascript can't do?

--- End quote ---

Fully access the memory map, use inline asm if needs be, efficiently handle memory usage, use peripherals in any way other than the person who wrote the JavaScript interpreter has thought of.

JacobEdward:

--- Quote from: Mechanical Menace on February 24, 2015, 10:32:24 pm ---Fully access the memory map, use inline asm if needs be, efficiently handle memory usage, use peripherals in any way other than the person who wrote the JavaScript interpreter has thought of.

--- End quote ---

It seems like that argument would also apply to assembly language, though, that get's me thinking about how exactly an assembly language would be written...

Navigation

[0] Message Index

[#] Next page

[*] Previous page

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod