Find The Best Answer

Reverse Polarity Protection

Reverse Polarity Protection
Posted: under TUTORIAL.Tags: , , [e]
Protection in electronic circuits is crusial factor. especially polarity reverse protection. Can you imagine what happen if our circuit not pretected to reverse polarity supply. All digital IC will be damage, and also electrolit capacitor will blow up. There two simple way to protect the circuit from reverse polarity Read the rest of this entry »

Free Electronics Design Software Download

Posted: November 16th, 2008 under FREE SOFTWARE.Tags: , , , , , [e]admin at November 16, 2008 : 11:53 am Edit This
-->

Introduction to Free Electronics Design Software
If you are a student or a electronics hobbyist who does not need to have complicated electronics design software to help you in your design work, it is strongly recommended that you consider the following free electronics design software that can be downloaded. There are some software which allow you to use for 30 days or so before you decide to purchase them. However, if you can live with limited feature, you can get a free download without having to pay for a full feature software.
Among some of the free electronics design software that can be downloaded are free pcb software, circuit analysis software and electromagnetic planar structure analysis software.
EAGLE PCB Layout Editor SoftwareThe EAGLE Layout Editor is a free PCB software (see the conditions) which is easy to use, yet powerful tool for designing printed circuit boards (PCBs). The name EAGLE stands for Easily Applicable Graphical Layout Editor. It has 3 main modules which consists of schematic editor, layout editor and autorouter.
ExpressPCB PCB Layout Editor SoftwareThe ExpressPCB schematic and PCB design software is very quick to learn and completely free! Download a fully functional version here.
5Spice Analog Circuit Simulation Software5Spice is a graphical user interface software that offers easy to use analog circuit simulation for the electronic circuit designer. 5Spice provides the analysis capabilities needed by experienced circuit designers while remaining easy to use. The focus is on analog circuit analysis and circuit design at the component level.
FiltersCAD Software For Designing FiltersFiltersCAD is a comprehensive PC based filter synthesis software package that provides active circuit synthesis.
Convert Your PC Into A Dual Trace OscilloscopeConvert your PC into a dual-trace storage oscilloscope and spectrum analyzer. It uses your computer’s sound card as analog-to-digital converter, presenting a real-time waveform or spectrum of the signal - which can be music, speech, or output from an electronic circuit.
Spice III simulator from Linear Technology SwitcherCAD™ III is a high performance Spice III simulator, schematic capture and waveform viewer with enhancements and models for easing the simulation of switching regulators.
Sonnet Lite EM analysis SoftwareSonnet Lite is a free feature-limited version of Sonnet’s professional Sonnet Suite, which provides Electromagnetic analysis that is able to analyse predominantly planar high-frequency designs from 1 MHz through several THz. PCB trace crosstalk analysis, Microstrip matching networks and Microwave circuit discontinuities amongst others can also be analysed.
Multilayer Air Core Inductor CalculatorCalculate the number of turns, DC resistance and other inductor data based on the input data of the inductance, coil inner diameter, coil length and wire gauge.
Resistor Color Code InterpreterEnter the color codes of the resistor and you will get its resistance. This calculator also shows the equivalent values of 2 resistors that are connected in parallel and in series.

This pic c compiler tutorial shows you how to compile MikroC C source code files.

This pic c compiler tutorial shows you how to re-compile source code using the MikroC compiler - it is not intended as an in depth look at compiling in general.
Re-compilation is only needed to examine or change the code as the ZIP files found on this site already contain the hex file for programming the chip.
MikroC main screen

MikroC has quite a few controls but for this compiler tutorial you only need to consider a few of them.
Re-compiling the source files
Download the ZIP file and extract its contents to your directory e.g. create the directory c:\\mikroC\\.
In this directory you will have files with extensions .c, .h ,.hex ,.ppc. The .ppc is the project file that you select from mikroC using the Open project button:
Open Project
Navigate to your stored files and select the .ppc extension. This loads the project.
Edit Project
If you want to change the project settings e.g. the chip type, oscillator frequency or other chip parameters then hit the 'Edit Project' button :
Compile
Next hit the compile button:
Success
A dialog box will popup showing the compilation status.
When the compile finishes (and if successful) you should see something similar to the following:

Now there should now be a lot more files in the original directory and the hex file will have been updated.

PIC frequency counter circuit Software

Project files for the PIC frequency counter circuit
Compiler project filesFrequency_counter_4MHz_7seg_tmr1.ppc
C Source files.Frequency_counter_4MHz_7seg_tmr1.cbcd.cdelay.cseven_segment.cgate.c
Header files.def.hbit.hbcd.hdelay.hseven_segment.hgate.h
Output filesFrequency_counter_4MHz_7seg_tmr1.hex
Brief description
Frequency_counter...c : contains the code start point (in routine 'main').
bcd.c : machine code to convert a long to a bcd.
delay.c : code to create fixed delay times.
sevensegment.c : Constant time seven segment refresh update routines.
gate.c : Accurate 1 second time delay while calling 7seg refresh.
bit.h : macros for bit manipulation.
def.h : control for simulation help.
All other header files contain prototypes.
PIC frequency counter circuit code operation.
The code uses the built in LCD driver routines which are automatically included by the compiler. Note automatic include is unusual but it seems to work well in mikroC.
Interrupts are not used only the flags that can be polled (timer overflow) are activated.
Frequency_counter_4MHz_7seg_tmr1.c
This file contains the port initialization and main routine.
After initialization the code enters an endless loop where it continuously performs a measurement and display operation. Throughout the loop the display refresh routine is called (approx every millisecond). Also in main the gate_loop routine is called.
The gate loop is tuned to just below a millisecond so that the caller (in main) can adjust the exact delay taking account of any delays caused by calling the gate loop routine itself.
Note that the timer overflow is polled within the gate loop and the seven segment display is refreshed . Extra statements in the else part of if statements allow constant execution time whether the conditions are true or false. This allows the loop time to be accurately calculated since it always has the same execution time.
gate.c
This file contains the gate loop time measurement routines - the loop time is tuned to 999us so that the caller can calibrate the 1 second delay time (accounting for compiler optimisation and return from call instructions).
The gate_loop routine calls the constant time seven segment display update and also checks (in constant time) the timer 1 overflow counter.
sevensegment.c
This file has the 8 digit seven segment display driver.
The first output from the 4017 is not connected so this acts as the reset state. At every call the next digit is output on port D and the 4017 is advanced one bit by strobing the clock. In this way after each call the next digit is displayed.
All the routines here are made into constant time routines so that the gate loop (the calling routine) can make an accurate 1 second time measurement.
delay.c
Delay routines were created using machine code so that they have a fixed execution time i.e. they do not change as the compiler re-optimizes the code. They are also fixed in memory location to avoid bank change problems.
bcd.c
This routine was created in machine code to save space on the smaller chips and it also results in faster code than using the built in routines for long multiply and divide.
It uses the Add 3 method to convert the unsigned long into an ASCII value that can be displayed on the LCD.
For this project the routine is split into separate processing functions
ulong2bcd_p1(df);ulong2bcd_process(void);
The second routine is called 8 times so that the seven segment display can be updated every millisecond (approx). This is true at 4MHz - obviously using a faster crystal would allow less calls e.g. for a 20MHz crystal you could get away with two calls. Using a faster crystal makes timing slightly more difficult since for a 20MHz clock the instruction cycle is 200ns not 1us.
The bcd conversion is not the fastest around but it is faster than letting the compiler using long divide or multiply and this does show how to use machine code in the C source code. It also shows how to split processing time up for the machine code program.
def.h
Contains a control to let the simulator update variables where needed.
bit.h
This contains macros for bit manipulation which should be compiler independent.
End of code description for the frequency counter circuit.

Using Fixed point maths in microcontrollers.

Fixed point mathematics lets you calculate results that need to have a fractional multiplier and it lets you calculate results that would normally need floating point variables. This saves a huge amount of memory.For example if you want to calculate an ADC result that uses a 19.6mV step size then you need to multiply the ADC result by 0.0196. Normal maths using a floating point variable would result in the following:
ADC reading
Floating point calculation
Floating point result
0
0 * 0.0196
0.0
127
127 * 0.0196
2.489
255
255 * 0.0196
4.998With Fixed point mathematics you can do this quickly and efficiently using only integer type variables.Note: Floating point variables use up huge amounts of resources in a microcontroller as microcontrollers are only really good at integer type variables. To do floating point complex library functions are called up. This is similar to the old 386 processor (it too was no good at floating point operations being far too slow) so a separate floating point processor was used.
An example problemHere is the problem to solve:Using the minimum memory resources use an 8 bit ADC with 5V reference to transmit using a PIC micro serial data to a PC via the serial port the ADC reading every second.The most important decision is not to use floating point - this saves lots of memory resource - all the rest; sending data to the serial port and timing will not take up much memory (the soft serial port (TX) that you can find here takes about 90 memory words).So how to do it : First of all the step size of each ADC bit is:
5V/255 = 0.0196 (19.6mV)Next work out the type of the variable that is big enough to hold the maximum expected value but is also the minimum size variable you can get away with. Factors such as the number of ADC bits and required calculation accuracy affect the variable size.To convert, using fixed point, multiply the ADC reading by an integer scale factor but make sure the maximum value fits within the variable e.g If you choose a scale factor of 196 check the maximum value:Maximum value : 255 * 196 = 49980Here you can use a 16 bit variable (or unsigned int) as the maximum value is smaller than the maximum value that the 16 bit variable can hold.Max value that unsigned int can store is 216-1 = 65535.Since 49980 < 65535 the scheme is ok.This has calculated the result using fixed point shown in the table below:
ADC reading
Fixed point calculation
Fixed point result
0
0 * 196
0.0
127
127 * 196
24892
255
255 * 196
49980The decimal point is fixed four to the left - i.e. fixed point. This has use the internal compiler routine '16 bit multiply' which is much simpler than a floating point multiply so you save loads of memory resource.
Jump from Microcontroller Fixed Point Maths toBest-Microcontroller-Projects Home Page

PIC Interrupt Secrets Update

PIC Interrupt Secrets UpdateHere's the download link for PIC Interrupt secrets:
Click Here To Download the Updated Version V1.01

USB ICSP FLASH PIC PROGRAMMER

Features
"Supplies Power 5V power To Your Circuits" This programmer can power your circuts up to (500mA or Max USB output) so there's no need for a separate power supply just connect the correct wires and its ready to go
"ICSP Connections" It has all the ICSP connections - This all you need for programming almost all PIC devices.
"Very Compact Design" It's suitable for use on a desktop and since there is no extra power supply its easy to carry around.
"Upgradable Firmware" The design uses an internal PIC chip that is programmed using the software so it's upgradable.
"USB Port" Connects via a standard USB port.


K182A : This is Strictly an In Circuit Serial PIC Programmer (ICSP). This allows you to quickly program and debug the pic while it is in your circuit. Removing the pic to reprogram while prototyping can be cumbersome. It is designed to program the Flash Pic's from Microchip. These are the ones that have an "F" in the part number. USB ports are just about standard on all PC's now a days, so this PIC programmer only uses the USB port. The circuit is powered directly from the USB port, so no external power supply is needed.
Features:
USB Port Connection
ICSP connector with wires
Software that can be updated as new Pics are released
Windows 9x/NT/2000/XP Compatible Software
Specifications:
L: 4" W: 3" H: 5/8"
Powered from USB port
Requires USB Cable
Link to download software provided
Here is a list of PICs that the MicroPro Software Supports and that this programmer will program.
12F629 12F675 16F627 16F627A 16F628 16F628A 16F630 16F648A 16F676 16F72 16F73 16F737 16F74 16F747 16F76 16F767 16F77 16F777 16F818 16F819 16F83 16F84 16F84A 16F87 16F88 16F870 16F871 16F872 16F873 16F873A 16F874 16F874A 16F876 16F876A 16F877 18F242 18F248 18F252 18F258 18F442 18F448 18F452 18F458 18F1220 18F1320 18F2220 18F2320 18F4220 18F4320Documentation in pdf format.
Assembled and Tested - $49.95Buy This Programmer Now(from electronic kits - an affiliate of mine).(USA & Canada only)More information (Scroll down to K182A for downloading software).