Showing posts with label USB. Show all posts
Showing posts with label USB. Show all posts

Saturday, November 27, 2010

Just bought an Arduino, What's next?


This article briefly explain what is to be done just after purchasing an Arduino board. Even though the prerequisites of Arduino is less compared to other development boards, I think this article will be useful because Arduino is being popular among beginners. This article deals with the latest version of Arduino at the time of writing - it is Arduino UNO.
Setting up drivers
Connect Arduino to your computer via USB cable. It will power up from USB power. Now start Arduino IDE. If you have not Arduino IDE download from here. No need to install the software. Just extract using your favourite decompressing utility (my favourite is 7zip) and run the executable named 'Arduino'. Now you have to set up your IDE to work with your Arduino UNO. First select your hardware from Tools -> Board -> Arduino UNO (or your exact hardware name. If it is not listed, try to download the latest version). Next, select your serial port from Tools -> Serial Port. Selecting serial port is in different way different OS.
Linux
If the 'Serial Port' menu is not active, probably, your device is not connected properly. Try to reconnect. If more than one serial ports are shown in the menu, we need to find out which is the correct one. To do that, disconnect your arduino first. Then you probably need to restart the IDE. Then look at the 'Serial Port' menu and note down the listed COM ports. Then reconnect your device and track the newcomer. This is the easy way. Select it.
One of the problem I suffered while playing with arduino in my Ubuntu 10.04 LTS was that, the compilation of the program was a failure. It was a dependancy problem. So what I did is that, installed Arduino IDE as described here. But it was an older version and my device UNO is not listed in it. Then downloaded the newer version from the downloads page. That was really a tricky step!
MS Windows
In Windows, just after connecting your device to the PC, a device driver wizard appears and try to find the appropriate device driver for the device. It will take a while and at the end of the fight, it fails to find an appropriate driver. Close the wizard and go to 'Device Manger' (Either via Control Panel or by right clicking 'My Computer' then 'Manage'). Then you can find Aduino UNO as the unknown device. Right click on that and choose the option to manually install the driver. Then locate the directory where you have installed Arduino IDE. Then the system install the appropriate driver and now you can see your device on the list named 'Ports' in the Device Manger. In parenthesis, there will be the curresponding COM port number (eg: COM 4) . Then choose that COM port in the Arduino IDE.
Starting with 'Hello World'
The commonly accepted 'Hello World' in embedded devices is LED blinking. There is an example in the IDE itself. Open the file from File -> Examples -> Basics -> Blink
Look at the program. For an average C programmer, the program seems self-explanatory. To compile your program, choose Sketch -> verify/compile. Then to upload the executable to your device, choose,File -> upload to I/O board. If everything you have done is correct, you will get your Arduino programmed and starts working just after burning the program using the USB power. Disconnect it from USB and use in your standalone applications.
Read more..
Arduino Lanugage reference
Arduino Playground

Wednesday, November 18, 2009

How to prevent virus from USB pendrive

Sometimes attacks of virus through USB pen drives are a real headache. Even though most of them are trivial, anti virus programs may not catch them. Use this following techniques in order to prevent them.
  • Make a raw file in the name same of a virus file. Most probably, these these files will be hidden. To view this, a good way is open the pen drive in Linux OS. you can see some names such as "virus.exe" on the root folder of pen drive. If it exists, open it using a text editor program and delete all the characters and if you want, include some raw characters and save. If you don't have any such files, but want to prevent them, you first of all need to find the name of that virus file and make a raw file in any text editor and save it in the same extension of the virus file. I successfully prevented a most common virus named "autorun.inf". Warning : This method not always work.
  • Use a good anti virus on your PC as well as in your pen drive. Some good links are http://www.usbantivirus.net/ and http://www.zbshareware.com/download.html
  • Format your pen drive well, if your head ache is cumbersome. Some virus programs can override quick format in windows. So use GParted.Prevention is better than cure. Formatting is the last chance.

Friday, October 2, 2009

Booting from CD ROM or USB devices

Booting from resources other than HDD is very simple, but the way in which configure your system for boot from a particular task may differ. First of all, you should know that, the boot configuration appearing on your monitor is independent of the OS, or any other peripherals connected to your system and it is occupied in your BIOS and it may vary for various type of mother boards. Nowadays, many people use liveCDs or liveUSB loaded with their favorite Linux OS for the sake of portability. So I think this tutorial will be useful to you.

After you power on your PC properly, a splash image will appear within few seconds on your monitor probably mentioning about your motherboard vendor or vendor logo. Some keys and their function may be mentioned on the screen.
For example: F9 : Boot menu F2 : Setup
The keys used for boot setup and boot menu will greatly varied. But the major problem is that this splash screen appears for less than a second in some systems so that you can't even recognize what is written on the screen. Here you should do is that press 'Pause/Break' key in your keyboard (It is positioned in between alphabetic keypad and numeric keypad). Then the screen pauses. Then you can configure as you like it. If you now want to boot system normally, press 'Enter'. Each of the operation will be explained while you are attempting to change this. This will not be explained here because this is different for different systems. But in most systems, if you think that you did something and don't know what is the consequence press 'Esc' continuously and probably one dialog box asks you to save changes. Press n/N for No or y/Y for Yes if you want to save changes.

If you want to just boot from CD ROM or like external devices, good option is that select one resource form the boot menu. The way how to navigate to the boot menu will be specified on the splash screen. If not, try F8 because, many systems having F8 as the boot menu key may not be explicitly shown. In boot menu, you can see several sources. 1.FLOPPY 2.HDD 3. CD-ROM 4.USB HDD .Select one which you want to and press 'Enter'. The system try to boot from the source. If fails, system may try a normal boot or a restart. Sometimes some devices for example USB HDD will not be listed until you inserted your memory stick or pen drive to the system before power up. In this case you should insert the USB device and try a restart and do the same procedure. Similarly, you should insert CD ROM to your drive before selecting boot device. One more thing is that if you are attempting to boot from a pend drive (or memory stick or thumb drive), you should select USB HDD. Some other options like USB FDD, USB ZIP may also be listed. One more problem associated with USB boot is that if you didn't enable USB boot in the boot setup (the key for boot setup will be displayed on splash screen), USB boot will be failure. In some systems you have options to enable/disable USB 2.0. All you need to do is that if a USB boot failure occurs, you should navigate through the boot setup menu and do as your need. In this case, the boot selection will not be saved and need to do the same procedure every time you boot time. Otherwise a normal boot will occur.

To permanently setup a boot configuration, you navigate to the boot setup menu and change the 'boot priority'. In normal case, first boot device will be HDD. You can change it to CD- ROM or USB HDD. One thing be noted is that you should give a priority to HDD as second or third device. Hence, if a boot error occur on the first device, system try on the second device (here HDD), so a normal boot will occur. Change the boot priority to CD-ROM as the first device and second device as HDD is a good practice in order to debug your OS, in case of permanent system crash. Here the system ask to save changes. Press y/Y to say Yes, and this configuration is saved on BIOS for future.

If you do the configuration permanently, every time system checks for first priority device and may feel time consuming if you are waiting for a normal boot. If you are doing it in temporary, every time you need to select boot device. It is recommended that you permanently change boot setup in your Home PC while temporarily do in office PCs.

In the worst case, your motherboard will be entirely different thing and you need o read motherboard users manual. If you didn't got any manual on purchase, you can freely download it from the vendor's website. Probably you need to search by the part number. The part number of your mother board can be found on the top side of your motherboard (Hmmm..Best chance to hack your PC).USB boot is not allowed in some old PCs. But all general purpose motherboards not older than 3 or 4 years can have USB boot capabilities.