Thursday, August 21, 2014

Writing C code on Windows using Geany and GNU

I have to provide a simple instruction to install an IDE "Integrated Development Environment" for  my students to be able to work on the assignments on their computers.
After doing a lot of research I found two options, Monodevelop and Geany. They both work great on Ubuntu Linux and have no issues, but, to use them on Windows I started to deal with the unknown...

Working with Monodevelop: monodevelop
Monodevelop will install fine in windows under different name, the issue is it does not support C programming language. At least out of the box. However, I read some blogs stating that we can somehow get it to compile C...  So, this is not what I am looking for and I can not expect my students to waste their time with these hacks at this time.  NOT AN OPTION.
Note:
it works fine on Ubuntu Linux and Mac, so, you can use it fine if this is what you have for Personal Computer...


Working with Geany:  Geany
Geany is a great simple IDE that works on Ubuntu Linux and Windows, as well as Mac.  but it requires the GCC, GNU C Compiler which will need to be installed on Windows.
I came up with the following instructions to help simplify the process of doing that.

Here is a list of download links that will be needed:

  1. Geany download site  Please select"geany-1.24_setup.exe - Full Installer including GTK 2.16."
  2. MinGW "Minimalist GNU for Windows"  Please select "Looking for the latest version? Download mingw-get-setup.exe (86.5 kB)"
Now that you have all required downloads, run both and install by following the default installations.
You should have the following icons on your desktop now,






Now, we will need to setup and install the gcc compiler to be able to compile your C code programs.





  1. Start MinGW by clicking on MinGW Installer shown on your desktop.
  2. you will get the following screen and notice that your list has no items selected in green boxes like my screen shot
  3. Go a head and select the one I have selected, right click and select "Mark for Installation"


    1. mingw-developer-toolkit
    2. mingw32-base
    3. mingw32-gcc-objc
    4. msys-base
  4. Now go to the menu "Installation" , and click on "Update Catalogue"
  5. after the download of needed files and installing them is done, you now have all you need to work on Geany and write your applications, but we need to add the new MinGW to Windows Path...
  6. You will need to go to Control panel
  7. Select System
  8. On the right list click on Advanced System Settings
  9. Now Click on Environment Variables...
  10. You will get this dialog box
  11. find Path  in the System Variables and double click on it
  12. now click on the Variable Value
  13. make sure you are at the end of the text and add the following text  ";C:\MinGW\bin\"
  14. you will be adding everything inside the double quotes
  15. Now, Click on OK and OK again,
  16. when you start Geany and write your own program at this point everything should be all set to compile your new code.









Monday, February 17, 2014

Biasing a Diode Semiconductors

To talk about a semiconductor, we need to talk about a conductor first.
Conductors: such as copper, silver, gold and iron are good materials that allow the flow of electrons through them.
Insulators: such as wood, plastic, rubber and glass are materials that do not allow electrons to flow through them.

Semiconductors such as silicon and germanium are neither good conductor nor good insulators.
A new material that is based on semiconductors is produced by combining two materials in a certain ratio that will have a controllable behavior different than conduct/insulate.

The Diode is the simplest device that makes use of semiconductors and are the base of a very complicated devices such as transistors, Integrated Circuits, Microprocessors.
The idea behind Diodes is that they can control the flow of electrons through them to one direction only.  This is achieved by process called biasing.


There are two types of diode biasing, forward and reverse.  Forward biasing allow the diode in a circuit to conduct and allow electrons to flow in one direction.
However, when the diode is reverse biased it will work as an insulator and prohibit electrons from flowing through it.

Reverse Biasing a Diode, No Current flow

Forward Biasing a Diode, Current Flows in Circuit


The behavior of a diode in a circuit is very similar to a one way valve placed to connect two water pipes.  The valve is a control system that will allow the flow of water through the pipes in one direction only.
This behavior reminds me with the valves in the human hart.  Human heart has four valves that allow the flow of blood ONLY in one direction and never the opposite direction.














References:
http://www.st-andrews.ac.uk/~www_pa/Scots_Guide/info/comp/passive/diode/diode.htm

http://www.allaboutcircuits.com/vol_3/chpt_3/1.html
http://www.chipshow.com/blog/?cat=1
http://www.youtube.com/watch?v=JBtEckh3L9Q

http://www.youtube.com/watch?v=W6QUEq0nUH8