Survey
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project
Power engineering wikipedia , lookup
Mains electricity wikipedia , lookup
Microprocessor wikipedia , lookup
Electrical substation wikipedia , lookup
Switched-mode power supply wikipedia , lookup
Immunity-aware programming wikipedia , lookup
Regenerative circuit wikipedia , lookup
Circuit breaker wikipedia , lookup
Fault tolerance wikipedia , lookup
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. 1. Example 1: Simple Door Alarm System Page 1 - 16 2. Example 2: Simple Door Alarm System 2 Page 17 - 23 3. Example 3: Line Following Robot Page 24 – 26 4. 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. 1 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. 1. Select the “Chip Icon” from the menu bar. OR 2. Click on “Options’ and then click a’Chip Selection…”. 3. 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. 2 8-pin PIC Projects PIC12F629 PIC12F675 The eight-pin PIC12F629 chip appears. 3 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. 4 8-pin PIC Projects PIC12F629 PIC12F675 Next enter the “Functional Requirements”: 5 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. 6 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. 7 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 1 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 1 to the chip. Another pin on the chip is then highlighted to accept the next Connection for the Power Supply circuit. 8 8-pin PIC Projects PIC12F629 PIC12F675 9 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 7 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 Step 7: Alarm Trigger Switch Select an Alarm Trigger switch to complete the circuit. Click on the “Push Button Switch” icon in the “Groups of Circuits” menu. Next, click on the highlighted pin number 6 on the chip to add the Push Button switch circuit. The Door Alarm circuit is now complete. 11 8-pin PIC Projects PIC12F629 PIC12F675 Step 8: Rename pin This is an extra section that will not affect the functionality of the Door Alarm circuit. We will rename the labels for clarity. We will change the name “Button6” to “Trigger”. Right Click on the label in the box and choose Rename. Delete the name “Button6” and type in “Trigger”. Click on “Save” under “File” in the main menu to save the project. 12 8-pin PIC Projects PIC12F629 PIC12F675 Step 9: Export Part List Click on “View Parts List” under “Documentation” in main menu to view a list of parts for the Door Alarm circuit. After clicking on “View Parts List” the following window will pop up. Save the Parts List into an Excel file by clicking on “Export to Excel” or save it as a Text File by clicking “Save” under “File” in the main menu. The Part List can be printed out. 13 8-pin PIC Projects PIC12F629 PIC12F675 Step 10: Test Procedure ezCircuit Designer generates a Test Procedure to check for faults or errors on the hardware circuit. Click on “View Test Procedures” under “Documentation” in the main menu to view the Test Procedures. The “Testing Procedures” window pops up as shown below. Save it as a Text File by clicking “Save” under “File” in the main menu. 14 8-pin PIC Projects PIC12F629 PIC12F675 Step 11: Generate CoreChart Test program When the hardware circuit is built and fully tested using the Test Procedures, test the circuit inputs and outputs with the CoreChart test program. ezCircuit Designer generates the CoreChart test program. Click on “Send to CoreChart” under “Options” in the main menu to generate a CoreChart Test program. Note: Ensure that CoreChart is installed. CoreChart will startup automatically and the window below will appear. Click “Import”. After importing the ASM file into CoreChart, your test program should appear as below. 15 8-pin PIC Projects PIC12F629 PIC12F675 In the program there is a “Buzzer07Test” subroutine to test the buzzer. To view the User Variable List click “Variables…” under Edit in the main menu bar. The pin names have been translated to Bit Variables in CoreChart. This will save time in matching the Port Pins to the Circuit. 16 8-pin PIC Projects PIC12F629 PIC12F675 Example 2: Simple Door Alarm System 2 This example is based on Example 1. In Example 1, the circuit detects the switch “trigger” to turn on the alarm. In Example 2, add an indicator to show the state of the alarm and a reset button to reset the alarm after the alarm is activated. 3 additional components are added to accomplish this. They are a Push Button Switch, a Red LED and a Green LED. Step 1: Start ezCircuit Designer and Load Existing Files After starting ezCircuit Designer click on “Existing Project”. Click on “Simple Door Alarm System.ezproj” to open the file. 17 8-pin PIC Projects PIC12F629 PIC12F675 The “Simple Door Alarm System.ezproj” project should look like this. Step 2: Add LED Click on the LED icon in the “Groups of Circuits” menu and select “Active High” in the “Circuits” menu. The compatible pin is highlighted. Click on pin number 5 of the PIC12F629 chip to connect the LED. Rename “LED5” to “LED_RED” 18 8-pin PIC Projects PIC12F629 PIC12F675 Step 3: Add Second LED Click on the LED icon under the “Groups of Circuits” menu and connect the “Active High” LED circuit to pin number 2 of the PIC12F629 chip and rename to “LED_GREEN”. Step 4: Add Input Push Button Switch Click on the “Push Button” icon under the “Groups of Circuits” menu. Choose the Reset Button and connect it to pin 4. Step 5: Save As Click “Save As” under the “File” in the main menu to save the project. 19 8-pin PIC Projects PIC12F629 PIC12F675 Next, go up a level by clicking “Up One Level” button and create a new folder called “Simple Project 2”. 20 8-pin PIC Projects PIC12F629 PIC12F675 Double click on the new folder and type in “Simple Door Alarm System2” in the “File name” text box. Click “Save” to save the new project. 21 8-pin PIC Projects PIC12F629 PIC12F675 Step 6: Generate CoreChart test program Follow the same procedure as in Example 1. Note: Ensure CoreChart is installed. Click “Send to CoreChart” to generate the test program. CoreChart will start up automatically and a window below will appear. Click “Import”. After importing the ASM file into CoreChart, the test program is generated as shown below. 22 8-pin PIC Projects PIC12F629 PIC12F675 The test program shows the subroutines to test the Buzzer and the LEDs. To view the User Variable List click “Variables…” under “Edit” in the main menu bar. The pin names have been translated to Bit Variables in CoreChart. This will save time to match the Port Pins to the Circuit. 23 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 1. 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, 3 and 2 on the chip to connect the Motor Driver Circuit to the chip. Click on pins 7, 6, 3 and 2 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 4 and “RightSensor” for pin 5. 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 2 of the chip. Add the same LED circuit to pins 3 and 7 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 4. Add the same circuit to pin 6 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 5 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 do 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