Author Topic: Beginner Components?  (Read 29161 times)

0 Members and 1 Guest are viewing this topic.

Offline Mechanical Menace

  • Super Contributor
  • ***
  • Posts: 1288
  • Country: gb
Re: Beginner Components?
« Reply #75 on: February 24, 2015, 11:22:06 pm »
It seems like that argument would also apply to assembly language,

Oh if timing is critical hand coded asm is sometimes the only option. But advantages of C  is it's abstract enough to be more human friendly and easily portable while still giving you brilliant access to the hardware. Modern compilers also in most cases give you just as fast a result as asm, and believe it or not in some cases faster results than all but the greatest asm treebird could manage. And in those cases where asm is the only real option you can write just that function in it.

Personally I'd also say C is no harder to use than JavaScript either tbh.

I don't need to learn another language since I have espruino, and if I don't have to, I'm not going to...

And while that lasts fairy fluff. But MCUs are a much different place to where JavaScript was designed to be used, you're not having to may not last as long as you think. You'll probably need to become fluent in C to just follow many an example for MCUs even if you don't outgrow espuriono  though.
« Last Edit: February 24, 2015, 11:27:55 pm by Mechanical Menace »
Second sexiest ugly bloke on the forum.
"Don't believe every quote you read on the internet, because I totally didn't say that."
~Albert Einstein
 

Offline BlueBill

  • Regular Contributor
  • *
  • Posts: 169
  • Country: ca
Re: Beginner Components?
« Reply #76 on: February 24, 2015, 11:28:21 pm »
My first computer was a COSMAC ELF1802 I build around 1977. I can program in 6502 & PIC assembler, plus BASIC (I blame early PCs as it was included in ROM). I used to program in PASCAL (all but a dead language, but I liked it) and I'm just now getting around to learning C. I even looked at Forth but always avoided C... Till now.

In that time I've never seen javascript as a viable Microcontroller language (that ARM3 is more a CPU than MPU). Most cheap & cheerful MPUs have very limited everything (RISC,kHz to MHz speeds, kilobytes of RAM & Flash) but great bit manipulation and high current I/O > 20mA is common and a wide supply range 1.8V - 5.5 isn't uncommon. Your Espruino is $39, where as a typical PIC or AVR MPU sells for less than a cheeseburger. PICs and AVR are sold blank, you can erase, program & debug (with a debugger) them with a cheap programmer. The Espruino is preprogrammed with a javascript interpreter. Similar to how a BASIC Stamp was ~20 years ago.

C is a compiled language, efficient and very popular. It's pretty much the go to language for Microcontrollers as it's available for all of them. ANSI C is not that obtuse and has been around forever (and it feels like it). I looked at some of those code examples on the Espurino site, IMHO you'll have no problem with C.
 

Offline JacobEdwardTopic starter

  • Regular Contributor
  • *
  • Posts: 81
Re: Beginner Components?
« Reply #77 on: February 24, 2015, 11:43:37 pm »
It seems like that argument would also apply to assembly language,

Oh if timing is critical hand coded asm is sometimes the only option. But advantages of C  is it's abstract enough to be more human friendly and easily portable while still giving you brilliant access to the hardware. Modern compilers also in most cases give you just as fast a result as asm, and believe it or not in some cases faster results than all but the greatest asm treebird could manage. And in those cases where asm is the only real option you can write just that function in it.

Personally I'd also say C is no harder to use than JavaScript either tbh.

It's not about difficulty... it's like saying, go learn Japanese in order to skip these two or three steps on a business document (where those two or three steps are relatively insignificant in comparison to the entire task)... I think most people would say they'd rather just go through the extra two steps... and the same is true in reverse for C for creating a web app

I don't need to learn another language since I have espruino, and if I don't have to, I'm not going to...

And while that lasts fairy fluff. But MCUs are a much different place to where JavaScript was designed to be used, you're not having to may not last as long as you think. You'll probably need to become fluent in C to just follow many an example for MCUs even if you don't outgrow espuriono  though.

There's already a lot of support for Javascript based MCU's (I've already successfully interfaced a RFID module via a SPI connection and there are all kinds of modules pre built ready to go...)

To be honest, I kinda think the only reason someone like me would ever swap is socially based instead of some technical limitation... we will see though and I'll keep you informed.
« Last Edit: February 24, 2015, 11:46:08 pm by JacobEdward »
 

Offline iamdarkyoshi

  • Frequent Contributor
  • **
  • Posts: 381
  • Country: us
Re: Beginner Components?
« Reply #78 on: February 24, 2015, 11:55:14 pm »
If you want a good play with inductors, build a joule thief and then try to modify it yourself to operate a flourescent tube instead of an LED. it can be done, but tounge angle is important  :-/O

Do you know of a really good tutorial on Joule thief's for beginners?  Something that has a basic set of listed parts I can find cheaply and experiment with?
http://www.instructables.com/id/Make-a-Joule-Thief/?ALLSTEPS=
Try this one. I made mine using an off the shelf NPN transistor.
 

Offline JacobEdwardTopic starter

  • Regular Contributor
  • *
  • Posts: 81
Re: Beginner Components?
« Reply #79 on: February 24, 2015, 11:59:27 pm »
If you want a good play with inductors, build a joule thief and then try to modify it yourself to operate a flourescent tube instead of an LED. it can be done, but tounge angle is important  :-/O

Do you know of a really good tutorial on Joule thief's for beginners?  Something that has a basic set of listed parts I can find cheaply and experiment with?
http://www.instructables.com/id/Make-a-Joule-Thief/?ALLSTEPS=
Try this one. I made mine using an off the shelf NPN transistor.

Thanks a bunch :-)
 

Online Simon

  • Global Moderator
  • *****
  • Posts: 18118
  • Country: gb
  • Did that just blow up? No? might work after all !!
    • Simon's Electronics
Re: Beginner Components?
« Reply #80 on: February 25, 2015, 07:01:00 am »


To be honest, I kinda think the only reason someone like me would ever swap is socially based instead of some technical limitation... we will see though and I'll keep you informed.

As Hero999 pointed out I started on basic and I hated C, but I found that I could not get help with basic because no one uses it (presumably for a good reason) and the software was limited. A lot of the problem was that there is not much standard in basic for micro controllers whereas everyone uses C and all MCU C is ANSI C based so no matter what software I use, microcontroler family or where I ask things are pretty much standard and anyone can help. Try searching the internet and see how much support there is for basic or java versus C........ I started out determined to stick with Basic because I "didn't get" C I prefered the simplicity of basic as it's easier to read but meh I had to make that "social choice" apparently it's a technical one as well.
 

Offline lapm

  • Frequent Contributor
  • **
  • Posts: 564
  • Country: fi
Re: Beginner Components?
« Reply #81 on: February 25, 2015, 09:27:36 am »
After reading this thread all i can say is consider something else then javascript. There are reasons why C is so popular, not least of it is its portable if properly written.

Yes, you can get microcontroller with javascript support. But that docent make it portable. Can you move that javascript engine between MCU´s in same family but different amounts of memory even? Lets say between Atmega 8 and Atmega328?

Also javasript is not codespace efficient. And thats its most likely biggest downfall when it comes to microcontrollers. it docent get compiled into assembly langage like C-does for example. So you waste precious code memory and clock cycles to run separate engine to decode that javascript.

yes it might be good for quick hacks, but when you run into issues of full codespace and you still need to add more code and execution speed... Yes, even i do quick hacks time to time just to test something quick...
Electronics, Linux, Programming, Science... im interested all of it...
 

Offline JacobEdwardTopic starter

  • Regular Contributor
  • *
  • Posts: 81
Re: Beginner Components?
« Reply #82 on: February 25, 2015, 04:14:19 pm »
After reading this thread all i can say is consider something else then javascript. There are reasons why C is so popular, not least of it is its portable if properly written.

To be honest, I'm sorta done with discussing C vs Javascript... this thread wasn't about that, but it seems blatantly obvious that C is as popular as it is because of the echo chamber effect rather than some fundamental advantage to the code... otherwise I would have been given an example of something C can do that Javascript can't instead of just getting these constant assertions that C is better (you will get the same crap in reverse for Javascript oriented forums).

Also javasript is not codespace efficient. And thats its most likely biggest downfall when it comes to microcontrollers. it docent get compiled into assembly langage like C-does for example. So you waste precious code memory and clock cycles to run separate engine to decode that javascript.

This "speed" problem has already been acknowledged and ... as it turns out, there are ways to compensate for this... anyways, good luck to you who insist on learning extra unnecessary languages, it's not worth it...
 

Offline WattsUp

  • Regular Contributor
  • *
  • Posts: 59
  • Country: gb
Re: Beginner Components?
« Reply #83 on: February 25, 2015, 04:24:04 pm »
About your ARM chip question, the only way to use that to generate a signal is to code something in C, as a MCU is inherently useless without code. Unfortunately not the solution you wanted. You could use that as a dedicated IC to generate a signal if you wanted to, though, via a comms protocol and with the necessary code.

  The reason most people here use C is that they are professionals or at least hobbyists. They know that they may have to use a different MCU for a specific requirements (like IO count or memory), and write code in a way that reflects this. Portability, efficiency and most importantly community support are vital for a dedicated EE, which is why C is used as a standard across platforms like PIC or AVR. I'm not going to tell you to switch, as you seem content to use JS, but just consider why everyone else uses C; listen to some of their points, and just think about what they are trying to tell you. No one is 'telling you off' for using JS, they are just providing valid reasoning for the use of C. One thing I will say is what if you want to control something that no one has done before in JS (which is likely because it is not widely use), so there is no high level command?
Ben
I'm trying out something new. Perspective Reviews. Comments and suggestions are appreciated over PM.
 

Offline JacobEdwardTopic starter

  • Regular Contributor
  • *
  • Posts: 81
Re: Beginner Components?
« Reply #84 on: February 25, 2015, 04:41:23 pm »
I'm not going to tell you to switch, as you seem content to use JS, but just consider why everyone else uses C

Everybody uses C because everybody else uses C... kinda straight forward but it's not a compelling reason for me to learn C
 

Offline BlueBill

  • Regular Contributor
  • *
  • Posts: 169
  • Country: ca
Re: Beginner Components?
« Reply #85 on: February 25, 2015, 04:51:21 pm »
I'm not going to tell you to switch, as you seem content to use JS, but just consider why everyone else uses C

Everybody uses C because everybody else uses C... kinda straight forward but it's not a compelling reason for me to learn C

Actually it's an industry standard for programming, especially microcontrollers, and you'll find plenty of examples, libraries, projects, forums...

Anyway, do whatever you want. About a year ago there was a fellow on another forum trying to use an ARM7 for an emergency light when pretty much the cheapest 6pin MPU would have been overkill. Go figure.
 

Offline WattsUp

  • Regular Contributor
  • *
  • Posts: 59
  • Country: gb
Re: Beginner Components?
« Reply #86 on: February 25, 2015, 05:02:14 pm »
 Look, I'm sorry, but that is one of the biggest selling points of C. If your C code isn't working, a properly worded question on any electronics forum (including this one) then you will likely receive a coherent response. How many people actually use JS on a MCU? 7? JS was designed for a different application, and while it is indeed possible to use it, it is not a practical choice for a beginner, hobbyist or professional. In my above answer I pointed out three points: portability, efficiency and community support. These three alone (and they are not the only ones) should at least give you something to think about. You can't just say:
Everybody uses C because everybody else uses C... kinda straight forward but it's not a compelling reason for me to learn C
when I among others have given you plenty of reasons. And anyway, what's so bad about being the same as everyone else when it means you have support for any project, and you do not rely on someone else doing the hard work for you (OK someone has written the compiler but you get the message).

  I'm not going to say any more about this now as it's getting ridiculous, but if you have any questions about the original topic then I will gladly help as I have throughout this thread.
Ben
I'm trying out something new. Perspective Reviews. Comments and suggestions are appreciated over PM.
 

Online Zero999

  • Super Contributor
  • ***
  • Posts: 20358
  • Country: gb
  • 0999
Re: Beginner Components?
« Reply #87 on: February 25, 2015, 05:07:05 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.

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? 
Being Turing complete means fuck all, if it won't allow you to take full advantage of the hardware.

Try writing a driver for a piece of hardware for your PC with JavaScript. It won't work. You'll find the hardware abstraction layer gets in the way. The only way is to switch to a compiled language which will allow you to do what you want.

You don't *have* to use C if all you want to do is tinker but if you want to do this professionally you'll *need* to learn C.

Quote
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.

I'm aware of all of what you just wrote, my question was how does that differ from PWM? 
It doesn't. PWM means controlling the duty cycle of a squarewave between 0% and 100% to represent an analogue value. If you put any waveform through a low pass filter, you'll get the average value. PWM is useful because by varying the duty cycle you can produce an analogue signal from 0 to the supply voltage of the microcontroller.
 

Offline WattsUp

  • Regular Contributor
  • *
  • Posts: 59
  • Country: gb
Re: Beginner Components?
« Reply #88 on: February 25, 2015, 07:45:27 pm »
Keep in mind the 600mW limit for power dissipation in the 555
I'm trying out something new. Perspective Reviews. Comments and suggestions are appreciated over PM.
 

Offline JacobEdwardTopic starter

  • Regular Contributor
  • *
  • Posts: 81
Re: Beginner Components?
« Reply #89 on: March 10, 2015, 07:16:48 pm »
Btw, incase anybody in the future might find this post of any use... if you're a beginner like me and are looking for cheap parts to experiment with or discover, this site has been pretty useful

http://www.taydaelectronics.com/
 

Offline manu793

  • Newbie
  • Posts: 1
  • Country: in
Re: Beginner Components?
« Reply #90 on: May 25, 2019, 02:31:37 pm »
Always try to learn about basics. There are some links of components are given which are very useful to starts from the basics of components.
 First, visit to know about Op Amp https://www.etechnog.com/2019/01/op-amp-circuit-diagram-types-and-applications.html

Know about semiconductor memory in digital electronics https://www.etechnog.com/2018/11/internal-structure-of-semiconductor-memory.html
 

Offline Arjunan M R

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: Beginner Components?
« Reply #91 on: May 25, 2019, 02:39:30 pm »
I'm new to electronics and have been teaching myself as I go but I keep discovering new components that have really essential functionality (like comparators or digital potentiometers) and was wondering if anybody would be willing to list off anything really basic (along with a cheap part number I can experiment with) that you would think is a must for beginners to learn.

I've only really heard of/ experimented with:

relays
motion sensors
switch's
transistors
potentiometers
digital potentiometers
resistors
capacitors
diodes
microcontroller
LED's and Lazer Diodes
Photoresistor
Shift Registers
Multimeter
Servo and toy motors
Ultrasonic Transducer
RFID
Op Amp
555
Thermistor
Barometric Pressure Sensor

--------------------------ADDENDUM--------------------------

Incase anybody in the future might find this post of any use... if you're a beginner like me and are looking for cheap parts to experiment with or discover, this site has been pretty useful

http://www.taydaelectronics.com/
Why did he include multimeter in it :-//.
 

Offline Arjunan M R

  • Regular Contributor
  • *
  • Posts: 236
  • Country: in
Re: Beginner Components?
« Reply #92 on: May 25, 2019, 02:43:51 pm »
If you are a beginner you should not start with µC(microcontroller).If you start with µC you are just learning to code not electronics. I recommend you to put it away for some time and learn all the basics and then start coding.
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 372
  • Country: fr
Re: Beginner Components?
« Reply #93 on: May 26, 2019, 06:07:08 pm »
Sorry if some members will find annoying to come back to the JS vs C debate but after having read some comments I decided to add my two cents.  So the question is: is it still true that real men only use C for MCU programming and everything else is just toys?   I think there is now a growing tendency to change this point of view, especially with the new generations of programmers. I don't know JS and won't defend it here, on the other hand I know several MCUs programmable in C# (e.g. SoM modules from GHI Electronics). Some of these clearly target professional market, likewise recent STM Cortex-M MCUs now provide support for the .NET nanoframework. I also know a company selling test&measurement equipment controlled by C#-based firmware. Of course like for JS the CLR virtual machine environment slows down the execution by a big factor, but who cares in case the MCU only has to monitor buttons and drive some slow hardware and a LCD. As speed and memory don't cost much these days I guess the trend to replace C by higher level languages even in embedded systems will prevail in the future because for cutting developer time costs the advantage of higher level languages is obvious. Having a long experience in the use and teaching of both C and C# I can witness how much faster it takes for an average programmer to obtain a bug-free code in C# compared to C.  This is a non negligible factor, there is a lot of buggy firmware out there :). Though I agree C will stay unchallenged in apps where getting cutting-edge performance by touching the bare silicium is critical.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf