Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 38 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
38
Dung lượng
4,92 MB
Nội dung
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 (4) ezCD examples based on the 8-pin PIC chips Example 1: Simple Door Alarm System Page - 16 Example 2: Simple Door Alarm System Page 17 - 23 Example 3: Line Following Robot Page 24 – 26 Example 4: Reaction Game Page 27 - 38 Example 1: Simple Door Alarm System Step1: Create New Project Start up ezCircuit Designer program and click on “New Project” Give the project a name and save the project Type in the project name “Simple Door Alarm System” Browse and save the file in a suitable location Click OK 8-pin PIC Projects PIC12F629 PIC12F675 Step 2: Select Chip By default ezCircuit Designer uses the PIC12F629 chip The following shows the steps to select a chip Select the “Chip Icon” from the menu bar OR Click on “Options’ and then click a’Chip Selection…” Double click on the chip in the main diagram A Chip Selection table pops up with the list of chips that ezCircuit Designer supports Select “PIC12F629” by clicking on it and click OK 8-pin PIC Projects PIC12F629 PIC12F675 The eight-pin PIC12F629 chip appears 8-pin PIC Projects PIC12F629 PIC12F675 Step 3: Create documentation A project 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 “Create Document” under the “Documentation” menu Next select “Specification” The following window will pop up Select “Introduction” and then click “Edit Content” Type in the introduction as shown below and then click Save 8-pin PIC Projects PIC12F629 PIC12F675 Next enter the “Functional Requirements”: 8-pin PIC Projects PIC12F629 PIC12F675 Step 4: Power supply For an electronics device to operate, the most basic requirement is a power supply In this example the Power Supply for the chip is already allocated Double click on one of the power supply connections to view the details This will bring up the circuit diagram for the power supply Rather than using a Voltage Regulator we will choose a simpler Power Supply 8-pin PIC Projects PIC12F629 PIC12F675 Go back to the Main screen by pressing the Return To Main button in the top right hand corner Highlight the “Power Supply 1” by clicking on one of its connections and then press “Delete” on the keyboard to remove the circuit 8-pin PIC Projects PIC12F629 PIC12F675 Step 5: Add Power Supply We will now add a new power supply circuit by choosing the Power Supply icon in the “Groups of Circuits” panel A list of different power supplies will appear Choose Zener Diode Regulator A list of Connections will appear Notice that Connection is already highlighted The VDD 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 Another pin on the chip is then highlighted to accept the next Connection for the Power Supply circuit 8-pin PIC Projects PIC12F629 PIC12F675 8-pin PIC Projects PIC12F629 PIC12F675 Step 6: Alarm Buzzer Now that the Door Alarm has a Power Supply Circuit add other input and output circuitry Click on the Buzzer icon in “Groups of Circuits” menu and choose the Peizo Buzzer Click on the highlighted pin number on the chip to add the Peizo Buzzer Notice the Buzzer circuit is connected to the chip as an output device 10 8-pin PIC Projects PIC12F629 PIC12F675 Example 3: Line Following Robot Building 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 New Project as shown in Example Step 1: Select Chip Use the PIC12F675 as the “brain” of the robot Click on “Chip Selection” under “Options” of the main menu or click on the “Chip icon” on the menu bar to select the chip The following screen of the “PIC16F675” chip appears Step 2: Create Documents Go to “Create Document” under the “Documentation” menu Next select “Specification” Type in the “Introduction” and “Functional Requirements” as shown below Click “Save” after typing in the details 24 8-pin PIC Projects PIC12F629 PIC12F675 Step 3: Add Motor Driver Select the “Motor Driver” Icon in the “Groups of Circuits” menu The motor driver needs to be connected to four pins on the chip Click on pins 7, 6, and on the chip to connect the Motor Driver Circuit to the chip Click on pins 7, 6, and to connect the circuit as shown below 25 8-pin PIC Projects PIC12F629 PIC12F675 Rename the pin names of the “Motor Driver” to the names as shown below This will make the project easier to understand Step 4: Add LDR Now add the “eyes” to the robot Select the LDR icon and to the chip add the two LDRs Rename the LDR sensors to “LeftSensor” for pin and “RightSensor” for pin Save the project and the robot circuit is now complete 26 8-pin PIC Projects PIC12F629 PIC12F675 Example 4: Reaction Game Step 1: Start new project Start ezCircuit Designer and choose Create New Project or if a project is already open choose New from the File menu To create a document, select “Create Document” under the “Documentation” menu Next select “Specification” Click on “Introduction” to highlight it Click the “Edit Content” button 27 8-pin PIC Projects PIC12F629 PIC12F675 Write the introduction about the project and then click “Save” Do the same with the Functional and Non-Functional Requirements, Requirements Specification Rationale and use the Appendix for references Step 2: Chip selection This project uses the PIC12F629 chip Since this is a New Project the PIC12F629 chip is the default chip 28 8-pin PIC Projects PIC12F629 PIC12F675 Step 3: Add LED Choose the LED icon in the “Groups of Circuits” Then select “active HIGH” in the “Circuits” menu and click on pin of the chip Add the same LED circuit to pins and on the chip Rename each of the LED circuits Right click on the LED label and choose Rename Change the LED names as follows: LED2 to CentralLEDYel LED3 to Player1Green LED7 to Player2Green 29 8-pin PIC Projects PIC12F629 PIC12F675 Step 4: Add Push Button Switch From the “Groups of Circuits” menu click the “Push Button” icon Select the “Pull up” circuit in the “Circuits” menu Add the “Push Button” circuit to pin Add the same circuit to pin as shown below Rename “Button4” to “Player1Button” and “Button6” to “Player2Button” as shown below 30 8-pin PIC Projects PIC12F629 PIC12F675 Step 5: Add buzzer Select the Buzzer icon in the “Groups of Circuits” menu Add the “Peizo Buzzer” to pin of the chip Rename it to “Alarm” 31 8-pin PIC Projects PIC12F629 PIC12F675 Step 6: Add New circuit In this section learn how to add in a “new” circuit to ezCircuit Designer This project adds a simpler power supply circuit to the ezCircuit Designer Select the “Add Circuit” icon at the bottom of the “Groups Of Circuits” following window appears 32 The 8-pin PIC Projects PIC12F629 PIC12F675 Click on the “Add New Circuit” button Select Power Supply under “Circuit Groups” The new circuit appears in the list of available power supplies in ezCircuit Designer Click “Next” Name the new Power Supply circuit “One Diode PS” Then click “Next” 33 8-pin PIC Projects PIC12F629 PIC12F675 Give the circuit a description Click “Next” Add the list of components for the circuit Click “Next” 34 8-pin PIC Projects PIC12F629 PIC12F675 Enter the Test Procedure for the circuit Click “Next” Each pin on the chip has different possible functions e.g some pins are used to control the Oscillator, some are used as Resets and others are used as Power Supply pins If the circuit needs to use some of these functions then set this requirement as a “Special Case” Since the Power Supply is a Special Case choose the “Power Supply Special Case” for this circuit as shown below Power supplies not need pin names Choose “No Pin Names” option in the list 35 8-pin PIC Projects PIC12F629 PIC12F675 Add an image file that represents the circuit Use the “Browse Button” to browse for the image to use Click on “Set Up Connections” 36 8-pin PIC Projects PIC12F629 PIC12F675 When the image is selected, add connections to the circuit Click on “Add” to bring up the “Add New Connection” window Type in pin name and choose its properties from the “Modes” menu Add a VSS connection and call it “VSS” Tick the VSS 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 “OK” to add connection Repeat this for the VDD connection making sure you tick the “VDD” mode If there is a Proteus (Section) file for the new power supply circuit then enter the path of the file Click “Finish” to close the “Add Circuit Wizard” The circuit should be available in the “Power Supply” Circuits group 37 8-pin PIC Projects PIC12F629 PIC12F675 Delete the “power supply circuit” to be replaced by selecting one of its connections and pressing “Delete” key on the keyboard Then add the new “One Diode PS” to the chip Congratulations! The design is now complete Export to CoreChart and start programming 38 8-pin PIC Projects PIC12F629 PIC12F675 ... Designer supports Select PIC1 2F629” by clicking on it and click OK 8-pin PIC Projects PIC1 2F629 PIC1 2F675 The eight-pin PIC1 2F629 chip appears 8-pin PIC Projects PIC1 2F629 PIC1 2F675 Step 3: Create... introduction as shown below and then click Save 8-pin PIC Projects PIC1 2F629 PIC1 2F675 Next enter the “Functional Requirements”: 8-pin PIC Projects PIC1 2F629 PIC1 2F675 Step 4: Power supply For an electronics... highlighted to accept the next Connection for the Power Supply circuit 8-pin PIC Projects PIC1 2F629 PIC1 2F675 8-pin PIC Projects PIC1 2F629 PIC1 2F675 Step 6: Alarm Buzzer Now that the Door Alarm has a Power