Question:
Can programming be apply to control frequency?
Bill
2008-03-16 09:28:35 UTC
It would seem these days that programming can be used to assist the control of everything, such as microwave, X-ray, home lighting etc machines, can I use programming to control the use of frequency with little help of hardware?
And if so, what programming language should I learn bearing in mind that the only computer skill I'm capable is end user of Windows.
Regards
Bill
Three answers:
?
2008-03-16 11:21:17 UTC
Aboslutely.... Programming a micro controller for the purpose of generating a frequency is very easy. Toggling the state of an output pin at a program controled rate is often done as a means of providing an analog output to represent a digital value. Filter a frequency with a capacitor and you can create a voltage output that is porportional to the frequency which is proportional to the digital value.



You can do some very simple experiments with a PC by using an RS232 COM port. Using Visual Basic or Visual C++ you can control one or two status pins and toggle there values on and off generating a frequency.



However since most PC's no longer come with a serial port additional hardware is required such as a USB to serial adapter for about $20 or having a PCI serial card installed.



I would recommend that you look at using a "Basic Stamp" . This is a simple easy to use micro-controller (uC) that has lots of educational support and is programmed using BASIC. The cost is arround $80 to $100,and a simple starter kit is available at Radio Shack. (The Basic Stamp does require a Serial Port to connect to the PC. There is a newer version which is connected to a USB for a little more $$)





Programming uC's are done in several languages, the top three are:

1.) Assembly

2.) C (and sometimes C++)

3.) Basic -Beginners All Purpose Symbolic Instruction Code

BASIC is the language for beginners, the name says it all



The easiest to learn and use is BASIC and is what I would recommend an absolute beginner to dabble with. Ultimately any serious programmer will learn all three and will transistion to using Assembly and C/C++ most frequently (sometimes together in the same uC project)
Stacy P
2008-03-16 09:39:29 UTC
What do you mean by "use of frequency?" If you mean you are interested in tuning something, like a ham radio, then yes. Frequency refers to the periodicity of some action, or how frequently it occurs. Hardware does this using timers based on the known frequencies of certain physical processes, like the vibration of quartz crystals. These components can be controlled by software.



Now, what language you use depends on what you are trying to accomplish. I'd recommend you learn C. It is a low-level language that allows you to directly manipulate hardware registers without to much trouble. Also, get a few introductory books on embedded systems. I recommend Embedded C by Michael Pont to start.



If you want to know more about hardware, you can read Embedded Hardware by Catsoulis.



Once you're ready to do more, if you *really* want to know how things work, you can read The Art of Electronics by Horowitz and Hill. It's big, and relatively tough, but extremely good.



Now, for some applications that don't require "hard real time" or extremely high frequencies you can probably use Java or Python. Both are pretty friendly languages, but neither gives you the power you get with C. Of course, it's harder to write code that damages hardware with Java and Python, but not all that hard with C!
2008-03-16 09:59:22 UTC
I like Stacy's answer. Java was originally envisioned as an appliance controller. Java didn't work out that way at first, it became a language. But now, as of late, Java ME is evolved from mobile phone devices. ME stands for Micro Edition. I would suggest going to a bookstore that has a coffee stand, look for Java Books with ME topics, sit down at the table and see if looking through the book connects with your way of "wishful" thinking.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...