Sie sind auf Seite 1von 38

8-pin PIC Projects PIC12F629 PIC12F675

ezCircuit Designer (ezCD)


ezCircuit Designer is an integrated graphical program. ezCD fast tracks the design of
electronic circuits, documentation and the CoreChart assembly program that runs the
microcontroller. It comes with example templates.
This document contains four (! ezCD examples based on the "#pin $IC chips.
%. &xample %' (imple Door )larm (ystem $age % # %*
+. &xample +' (imple Door )larm (ystem + $age %, # +-
-. &xample -' .ine /ollowing 0obot $age + 1 +*
. &xample ' 0eaction 2ame $age +, # -"
Ex!p"e 1# $i!p"e Door %"r! $&ste!
$tep1# Crete 'e( Project
(tart up ezCircuit Designer program and click on 34ew $ro5ect6.
2i7e the pro5ect a name and sa7e the pro5ect. Type in the pro5ect name 3(imple Door
)larm (ystem6. 8rowse and sa7e the file in a suitable location. Click 9:.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
%
$tep 2# $e"ect C)ip
8y default ezCircuit Designer uses the $IC%+/*+; chip. The following shows the steps to
select a chip.
%. (elect the 3Chip Icon6 from the menu bar.
90
+. Click on 39ptions= and then click a=Chip
(election>6.
-. Double click on the chip in the main diagram.
) Chip (election table pops up with the list of chips that ezCircuit Designer supports.
(elect 3$IC%+/*+;6 by clicking on it and click 9:.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
+
The eight#pin $IC%+/*+; chip appears.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
-
$tep *# Crete +ocu!enttion
) pro5ect with proper documentation will make the process more organized and simple to
trace. ezCD has an in#built documentation generator.
To create a document, select 3Create Document6 under the 3Documentation6 menu. 4ext
select 3(pecification6.
The following window will pop up. (elect 3Introduction6 and then click 3&dit Content6.
Type in the introduction as shown below and then click (a7e.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<

4ext enter the 3/unctional 0e?uirements6'


"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
<
$tep ,# Po(er supp"&
/or an electronics de7ice to operate, the most basic re?uirement is a power supply. In this
example the $ower (upply for the chip is already allocated. Double click on one of the
power supply connections to 7iew the details.
This will bring up the circuit diagram for the power supply.
0ather than using a @oltage 0egulator we will choose a simpler $ower (upply.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
*
2o back to the Aain screen by pressing the 0eturn To Aain button in the top right hand
corner.
Bighlight the 3$ower (upply %6 by clicking on one of its connections and then press
3Delete6 on the keyboard to remo7e the circuit.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
,
$tep 5# %++ Po(er $upp"&
Ce will now add a new power supply circuit by
choosing the $ower (upply icon in the 32roups of
Circuits6 panel.
) list of different power supplies will appear.
Choose Dener Diode 0egulator. ) list of
Connections will appear. 4otice that Connection %
is already highlighted.
The @DD power supply pin on the chip is also highlighted ready to accept a Connection.

Click on this highlighted pin on the chip to add Connection % to the chip. )nother pin on
the chip is then highlighted to accept the next Connection for the $ower (upply circuit.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
"

"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
;
$tep 6# %"r! -uzzer
4ow that the Door )larm has a $ower
(upply Circuit add other input and output
circuitry. Click on the 8uzzer icon in
32roups of Circuits6 menu and choose the
$eizo 8uzzer. Click on the highlighted pin
number , on the chip to add the $eizo
8uzzer.
4otice the 8uzzer circuit is connected to the chip as an output de7ice.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
%E
$tep 7# %"r! .rigger $(itc)
(elect an )larm Trigger switch to complete the circuit. Click on the 3$ush 8utton
(witch6 icon in the 32roups of Circuits6 menu. 4ext, click on the highlighted pin number
* on the chip to add the $ush 8utton switch circuit.
The Door )larm circuit is now complete.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
%%
$tep 8# /en!e pin
This is an extra section that will not affect the functionality of the Door )larm circuit. Ce
will rename the labels for clarity. Ce will change the name 38utton*6 to 3Trigger6. 0ight
Click on the label in the box and choose 0ename. Delete the name 38utton*6 and type in
3Trigger6.

Click on 3(a7e6 under 3/ile6 in the main menu to sa7e the pro5ect.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
%+

$tep 9# Export Prt 0ist
Click on 3@iew $arts .ist6 under 3Documentation6 in main menu to 7iew a list of parts
for the Door )larm circuit.
)fter clicking on 3@iew $arts .ist6 the following window will pop up. (a7e the $arts .ist
into an &xcel file by clicking on 3&xport to &xcel6 or sa7e it as a Text /ile by clicking
3(a7e6 under 3/ile6 in the main menu. The $art .ist can be printed out.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
%-
$tep 11# .est Proce+ure
ezCircuit Designer generates a Test $rocedure to check for faults or errors on the
hardware circuit. Click on 3@iew Test $rocedures6 under 3Documentation6 in the main
menu to 7iew the Test $rocedures.
The 3Testing $rocedures6 window pops up as shown below. (a7e it as a Text /ile by
clicking 3(a7e6 under 3/ile6 in the main menu.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
%
$tep 11# 2enerte CoreC)rt .est progr!
Chen the hardware circuit is built and fully tested using the Test $rocedures, test the
circuit inputs and outputs with the CoreChart test program. ezCircuit Designer generates
the CoreChart test program. Click on 3(end to CoreChart6 under 39ptions6 in the main
menu to generate a CoreChart Test program.
4ote' &nsure that CoreChart is installed.
CoreChart will startup automatically and the window below will appear. Click 3Import6.
)fter importing the )(A file into CoreChart, your test program should appear as below.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
%<
In the program there is a 38uzzerE,Test6 subroutine to test the buzzer.
To 7iew the Fser @ariable .ist click 3@ariables>6 under &dit in the main menu bar. The
pin names ha7e been translated to 8it @ariables in CoreChart. This will sa7e time in
matching the $ort $ins to the Circuit.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
%*
Ex!p"e 2# $i!p"e Door %"r! $&ste! 2
This example is based on &xample %. In &xample %, the circuit detects the switch
3trigger6 to turn on the alarm. In &xample +, add an indicator to show the state of the
alarm and a reset button to reset the alarm after the alarm is acti7ated. - additional
components are added to accomplish this. They are a $ush 8utton (witch, a 0ed .&D
and a 2reen .&D.
$tep 1# $trt ezCircuit Designer n+ 0o+ Existing Fi"es
)fter starting ezCircuit Designer click on 3&xisting $ro5ect6.
Click on 3(imple Door )larm (ystem.ezpro56 to open the file.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
%,
The 3(imple Door )larm (ystem.ezpro56 pro5ect should look like this.
$tep 2# %++ 0ED
Click on the .&D icon in the 32roups of Circuits6 menu and select 3)cti7e Bigh6 in the
3Circuits6 menu. The compatible pin is highlighted. Click on pin number < of the
$IC%+/*+; chip to connect the .&D.
0ename 3.&D<6 to 3.&DG0&D6
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
%"
$tep *# %++ $econ+ 0ED
Click on the .&D icon under the 32roups of Circuits6 menu and connect the 3)cti7e
Bigh6 .&D circuit to pin number + of the $IC%+/*+; chip and rename to
3.&DG20&&46.
$tep ,# %++ Input Pus) -utton $(itc)
Click on the 3$ush 8utton6 icon under the 32roups of Circuits6 menu. Choose the 0eset
8utton and connect it to pin .
$tep 5# $3e %s
Click 3(a7e )s6 under the 3/ile6 in the main menu to
sa7e the pro5ect.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
%;
4ext, go up a le7el by clicking 3Fp 9ne .e7el6 button and create a new folder called
3(imple $ro5ect +6.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
+E
Double click on the new folder and type in 3(imple Door )larm (ystem+6 in the 3/ile
name6 text box. Click 3Save to sa7e the new pro5ect.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
+%
$tep 6# 2enerte CoreC)rt test progr!
/ollow the same procedure as in &xample %.
4ote' &nsure CoreChart is installed.
Click 3(end to CoreChart6 to generate the test program.
CoreChart will start up automatically and a window below will appear. Click 3Import6.
)fter importing the )(A file into CoreChart, the test program is generated as shown
below.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
++
The test program shows the subroutines to test the 8uzzer and the .&Ds.
To 7iew the Fser @ariable .ist click 3@ariables>6 under 3&dit6 in the main menu bar.
The pin names ha7e been translated to 8it @ariables in CoreChart. This will sa7e time to
match the $ort $ins to the Circuit.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
+-
Ex!p"e *# 0ine Fo""o(ing /o4ot
8uilding a robot is not rocket science anymore. The following example uses ezCircuit
Designer to design a line following robot with two sensors and two motors.
Create a 4ew $ro5ect as shown in &xample %.
$tep 1# $e"ect C)ip
Fse the $IC%+/*,< as the 3brain6 of the robot. Click on 3Chip (election6 under
39ptions6 of the main menu or click on the 3Chip icon6 on the menu bar to select the
chip. The following screen of the 3$IC%*/*,<6 chip appears.
$tep 2# Crete Docu!ents
2o to 3Create Document6 under the 3Documentation6 menu. 4ext select 3(pecification6.
Type in the 3Introduction6 and 3/unctional 0e?uirements6 as shown below. Click 3(a7e6
after typing in the details.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
+
$tep *# %++ 5otor Dri3er
(elect the 3Aotor Dri7er6 Icon in the 32roups of Circuits6 menu.
The motor dri7er needs to be connected to four pins on the chip.
Click on pins ,, *, - and + on the chip to connect the Aotor Dri7er Circuit to the chip.
Click on pins ,, *, - and + to connect the circuit as shown below.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
+<
0ename the pin names of the 3Aotor Dri7er6 to the names as shown below. This will
make the pro5ect easier to understand.
$tep ,# %++ 0D/
4ow add the 3eyes6 to the robot. (elect the .D0 icon and add the two .D0s
to the chip.
0ename the .D0 sensors to 3.eft(ensor6 for pin and 30ight(ensor6 for pin <.
(a7e the pro5ect and the robot circuit is now complete.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
+*
Ex!p"e ,# /ection 2!e
$tep 1# $trt ne( project
(tart ezCircuit Designer and choose Create 4ew $ro5ect or if a pro5ect is already open
choose 4ew from the /ile menu.
To create a document, select 3Create Document6 under the 3Documentation6 menu. 4ext
select 3(pecification6.
Click on 3Introduction6 to highlight it. Click the 3&dit Content6 button.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
+,
Crite the introduction about the pro5ect and then click 3(a7e6.
Do the same with the /unctional and 4on#/unctional 0e?uirements, 0e?uirements
(pecification 0ationale and use the )ppendix for references.
$tep 2# C)ip se"ection
This pro5ect uses the $IC%+/*+; chip. (ince this is a 4ew $ro5ect the $IC%+/*+; chip is
the default chip.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
+"
$tep *# %++ 0ED
Choose the .&D icon in the 32roups of
Circuits6. Then select 3acti7e BI2B6 in the
3Circuits6 menu and click on pin + of the chip.
)dd the same .&D circuit to pins - and , on the
chip.
0ename each of the .&D circuits. 0ight click on the .&D label and choose 0ename.
Change the .&D names as follows'
.&D+ to Central.&DHel
.&D- to $layer%2reen
.&D, to $layer+2reen
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
+;
$tep ,# %++ Pus) -utton $(itc)
/rom the 32roups of Circuits6 menu click the 3$ush 8utton6 icon . (elect the 3$ull
up6 circuit in the 3Circuits6 menu.
)dd the 3$ush 8utton6 circuit to pin . )dd the same circuit to pin * as shown below.
0ename 38utton6 to 3$layer%8utton6 and 38utton*6 to 3$layer+8utton6 as shown
below.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
-E
$tep 5# %++ 4uzzer
(elect the 8uzzer icon in the 32roups of Circuits6 menu. )dd the 3$eizo 8uzzer6 to pin <
of the chip. 0ename it to 3)larm6.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
-%
$tep 6# %++ 'e( circuit
In this section learn how to add in a 3new6 circuit to ezCircuit Designer. This pro5ect adds
a simpler power supply circuit to the ezCircuit Designer.
(elect the 3)dd Circuit6 icon at the bottom of the 32roups 9f Circuits6 . The
following window appears.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
-+
Click on the 3)dd 4ew Circuit6 button.
(elect $ower (upply under 3Circuit 2roups6. The new circuit appears in the list of
a7ailable power supplies in ezCircuit Designer.
Click 34ext6.
4ame the new $ower (upply circuit 39ne Diode $(6. Then click 34ext6.

"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
--
2i7e the circuit a description. Click 34ext6.
)dd the list of components for the circuit. Click 34ext6.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
-
&nter the Test $rocedure for the circuit. Click 34ext6.
&ach pin on the chip has different possible functions e.g. some pins are used to control
the 9scillator, some are used as 0esets and others are used as $ower (upply pins. If the
circuit needs to use some of these functions then set this re?uirement as a 3(pecial Case6.
(ince the $ower (upply is a (pecial Case choose the 3$ower (upply (pecial Case6 for
this circuit as shown below. $ower supplies do not need pin names. Choose 34o $in
4ames6 option in the list.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
-<
)dd an image file that represents the circuit. Fse the 38rowse 8utton6 to browse for the
image to use. Click on 3(et Fp Connections6.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
-*
Chen the image is selected, add connections to the circuit. Click on 3)dd6 to bring up
the 3)dd 4ew Connection6 window. Type in pin name and choose its properties from the
3Aodes6 menu. )dd a @(( connection and call it 3@((6. Tick the @(( mode box. These
modes ensure that the chip pins are compatible with the circuit connections. If no mode is
selected the circuit will not connect to any chip pins. Click on 39:6 to add connection.
0epeat this for the @DD connection making sure you tick the 3@DD6 mode.
If there is a $roteus ((ection! file for the new power supply circuit then enter the path of
the file. Click 3/inish6 to close the 3)dd Circuit Cizard6
The circuit should be a7ailable in the 3$ower (upply6 Circuits group
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
-,
Delete the 3power supply circuit6 to be replaced by selecting one of its connections and
pressing 3Delete6 key on the keyboard. Then add the new 39ne Diode $(6 to the chip.
CongratulationsI The design is now complete. &xport to CoreChart and start
programming.
"#pin $IC $ro5ects $IC%+/*+; $IC%+/*,<
-"

Das könnte Ihnen auch gefallen