Pages

Thursday, November 19, 2015

About Bluetooth Communication (ABC)

What is Bluetooth Low Energy?


Where can I find examples of PSoC 4 BLE projects?


How do I create a custom BLE profile?


How do I create an Android app that is BLE-enabled?


Where can I find examples of custom Android apps that are BLE-enabled?

How do I create an iOS app that is BLE-enabled?


Where can I find examples of custom iOS apps that are BLE-enabled?


How do I communicate from PSoC® 4 BLE to PSoC® 4 BLE?


If you find additional resources that are helpful, please send them to Dr. Jordan

Thursday, October 22, 2015

Placing and moving components in Cadence PCB Editor

While it is easy to place components using the mouse, most designs require precise placement of some components (e.g., to align parallel headers). This tutorial walks through how to place components at a specific X-Y coordinate, determine the X-Y coordinates of a component, measure the distance between two components, move an existing component to a specific X-Y coordinate, and move an existing component relative to its current location.

How do you place a component at a specific X-Y coordinate?


  1. Choose Place > Manually... (see Figure 1). The Placement dialog box appears (see Figure 2).

Figure 1: Place > Manually... menu

Figure 2: Placement dialog box

2. Check the box next to the part that you want to place, but do not place it yet. Instead, go to the command line at the bottom of the screen and type the desired placement coordinates in the following format: x x-coordinate y-coordinate

Example:

Command > x 0 0 will place the component at the origin (0,0)

3. Press Enter to place the component at the desired coordinates (see Figure 3).

Figure 3: Component placed at origin (0,0)

How do you determine the current coordinates of a component?

1. Choose Display > Element (see Figure 4) and click on the component you would like to examine. The Show Element dialog box will appear and show the current coordinates of the component (see Figure 5).

Figure 4: Display > Element menu option

Figure 5: Coordinates of a placed component

How do you measure the distance between two components?

1. Choose Display > Measure (see Figure 6). The command line will ask you to "Make two picks for the distance calculator" (see Figure 7).

Figure 6: Display > Measure menu option

Figure 7: Command line message for Measure tool
2. Click parts of two components (e.g., a pin of a resistor and a pin of a capacitor). The Measure dialog box will appear and show the distance between the selected points (see Figure 8).

Figure 8: Measured distance between resistor and capacitor pins

How do you move an existing component to a specific  X-Y coordinate?

1. Right-click on the component and select "Move"
2. Use the command line to enter a specific coordinate in the x (x x-coordinate) or y (y y-coordinate) direction.

Examples:
A component is at (25,75).

Command > x 200 will move the component to (200,75) (see Figure 9)

Command > y 200 will move the component to (25, 200) (see Figure 10)

Figure 9: Moving a component to an absolute x coordinate

Figure 10: Moving a component to an absolute Y coordinate

How do you move a component relative to its current position?

1. Right-click on the component and select "Move"

2. Use the command line to enter a relative movement in one of the following formats:

ix x-units
iy y-units
ix x-units y-units


Examples:
A component is at (1000,2000).

Command > ix 200 will move the component to (1200, 2000)

Command > iy 200 will move the component to (1000, 2200)

Command > ix 200 -500 will move the component to (1200,1500) (see Figure 11)

Figure 11: Results of relative movement

Based on a tutorial by Seana O'Reilly

Printing a PCB Layout in Cadence PCB Editor

Note: This tutorial shows how to print a PCB design on paper. Please see the ASU PCB Fabrication Process for instructions on how to manufacture / "print" a PCB design in copper.

Why would you want to print a PCB design on paper?

Before sending a PCB to be manufactured, it is imperative to separate the layers and print it at 1:1 (100%) scale on paper to physically verify that your parts will fit through the holes and that pad spacing is correct.

Note: "Plot" in Cadence is synonymous with "Print" in other Windows programs

Note: You can also Print a PCB Layout in DFM Now.

How do you print a PCB design on paper?

1. In PCB Editor, open your design and choose File > Plot Setup... (see Figure 1). The "Plot Setup" dialog box will appear (see Figure 2).

Figure 1: Plot Setup menu option

2. In the "Plot Setup" dialog box, choose a "Scaling factor" of 1.00, "Auto center" checked and "Plot method" matching your printer's capabilities (color or black and white), and click OK (see Figure 2).

Figure 2: Plot Setup dialog box

3. On the right side of the screen, select the Options tab. Set the "Active Class and Subclass" to Etch and the Subclass to Bottom (See Figure 3). This will show the most important details in the printout.

Figure 3: Options tab

4. Choose File > Plot... (see Figure 4). The "Print" dialog box will appear (see Figure 5).

Figure 4: Plot menu option

5. In the "Print" dialog box, click "Setup..." (see Figure 5) and select the printer, paper size, and orientation in the "Print Setup" dialog box (see Figure 6).

Figure 5: Print dialog box

Figure 6: Print Setup dialog box

6. Click OK in the "Print Setup" dialog box, and OK in the Print dialog box to print the design (see Figure 7).

Figure 7: Print dialog box

Based on a tutorial by Seana O'Reilly

Pushing PCB changes back to a schematic in Cadence

Why would I need to back annotate a design?

If you make changes to your design while in PCB Editor (for example, swapping a footprint), you must back annotate (meaning, push changes) from the PCB design back into your original schematic. By doing this update, future changes to the schematic can be forward annotated (meaning, pushed forward) to your PCB design without having to start over from scratch.

How do I back annotate a design from PCB Editor to Design Entry CIS?

1. In PCB Editor, choose Setup > User Preferences... and click on the Logic folder. The User Preferences Editor window will appear (see Figure 1).

Figure 1: User Preferences Editor window with Logic folder selected

2. Under the Logic folder, set schematic_editor to capture (see Figure 1, above). Close the User Preferences Editor.

3. Choose File > Export > Logic.... The Export Logic dialog box will appear. (see Figure 2).

Figure 2: Export Logic dialog box

4. In the Export Logic dialog box, select the Cadence tab and choose the Design entry CIS option under "Logic type" (see Figure 2, above). If the path under "Export to directory" does not point back to the directory your design is stored in, click the "..." button and change it.

5. In the Export Logic dialog box, click the "Export Cadence" button (see Figure 3). You are now finished exporting the design from PCB Editor, but still need to import the design changes into Design Entry CIS.

Figure 3: Export Cadence button in the Export Logic dialog box

6. Open your project in Design Entry CIS.

7. In Design Entry CIS, go to the "Project Manager" window and select the project icon. Choose Tools > Back Annotate... (see Figure 4). The Backannotate dialog box will open (see Figure 5). If you want to make any changes to what is imported, click the "Setup..." button and edit the allegro.cfg file (not recommended for most users) (see Figure 5).

Figure 4: Project Manager and Back Annotate...

Figure 5: Backannotate dialog box and setting up the path8. Click "OK" to complete the back annotation.

Based on a tutorial written by Seana O'Reilly and updated by Griffin Puggie

Changing a Hole Diameter in Cadence PCB Editor

Why would you need to change the hole diameter?

The default diameter of holes in Cadence is 0.3 mm. This is too small for most components to fit through, as well as too small for proper through-plating of vias.
According to the Peralta PCB Mill specifications, hole diameters should be at least 0.5 mm (19.7 mil). Therefore, the following settings are recommended:

  • Drill diameter > 20 mil
  • Pad diameter = drill diameter + (at least) 30 mil
  • Soldermask diameter = pad diameter + 20 mil
Example: If the drill diameter = 31.5 mil, the pad diameter = 61.5 mil and the solder mask = 81.5 mil.


How do you change the hole diameter in PCB Editor?

1. In PCB Editor, open your design and right-click on a via or hole and choose "Replace padstack". If you want to only change the selected via or hole, choose "Selected instance(s)". If you want to change all vias or holes on your board, choose "All instances" (see Figure 1). The "Select a padstack" dialog box appears (see Figure 2).


Figure 1: Replace pad stack contextual menu

2. In the "Select a padstack" dialog box, select Pad62cir32d (which has a 62 mil pad and a 32 mil hole) or another pad with a hole size of at least 20 mil and click OK (see Figure 2). While the hole size is reasonable for many components, the pad size is still too small.

Figure 2: Select a padstack dialog box

3. Or you can modify the existing Padstack in your design. Right-click again on a via or hole and choose "Modify design padstack". If you want to only change the selected via or hole, choose "Selected instance(s)". If you want to change all vias or holes on your board, choose "All instances" (see Figure 3). The "Padstack Editor" dialog box appears (see Figure 4).


Figure 3: Modify design pad stack contextual menu

4. In the "Padstack Editor" dialog box, increase the "Regular Pad" diameters to 60.0 or greater on the TOP and BOTTOM layers (see Figure 4), and change the Mask Layers diameters to 80.0 (see Figure 5).


Figure 4: Padstack Editor dialog box
Figure 5: Padstack Editor dialog box - Mask Layers tab

5. In the "Padstack Designer" dialog box, choose File > Update to Design and Exit. You have successfully increased the pad size of the via or hole.

Based on a tutorial by Seana O'Reilly and updated by Qinchen Zha

Sunday, October 4, 2015

Configuring the UART on PSoC®

What is a UART (Universal Asynchronous Receiver/Transmitter)?

UART is one serial protocol used for communicating data between two digital devices (e.g., between the Pioneer Kit and the computer).

When is a UART useful?

Some sensors (e.g., GPS and RFID units) have a UART interface. Additionally, it is very helpful for debugging programs by using it to send messages back to the computer indicating the current status of the program.

How does a UART work?

More information on UARTs is available in the Microcontroller UART Tutorial from Society of Robots.

How many PSoC® chips does the PSoC® 4 Pioneer Kit have?

See the PSoC® Hardware Development Kits page. This is important to understand the answer to the next question.

How do I connect and configure the PSoC® 4 Pioneer Kit to send information to the computer over the UART?


1. On the Pioneer Kit, connect a jumper wire from UART RX (P0[4]) of the PSoC® 4 to J8_10 (P12[7]) of the PSoC® 5LP

2. On the Pioneer Kit, connect a second jumper wire from UART TX (P0[5]) of the PSoC® 4 to J8_9 (P12[6]) of the PSoC® 5LP

3. Connect the Pioneer Kit to your computer with a USB cable.

Next, you will need to determine which COM port the Pioneer Kit is connected to, install a terminal program, and configure it to read data from the serial port on your computer. This will allow you to see the output from your program.

4. Determine which COM port the Pioneer Kit is connected to by opening the Bridge Control Panel application in the Cypress folder in the Start menu, and looking for the COM port listed with the highest number (see Figure 2, below). Write down this port name and close the Bridge Control Panel.

Figure 2: Bride Control Panel


5. Download, install, and open the terminal program PuTTY

6. Click on the Terminal tab and configure it with the settings shown in Figure 3 (below)

Figure 3: PuTTY terminal configuration tab

7. Click on the Session tab and configure it with the settings shown in Figure 4. Use the COM port for your computer determined earlier in this tutorial. Save the session as PSoC and click "Open".

Figure 4: PuTTY Session configuration tab

8. Finished! Now, you can see text sent between your computer and PSoC® 4 Pioneer Kit via the UART.








Thursday, September 24, 2015

Exporting Gerber files from Cadence PCB Editor

What is a Gerber file?

A Gerber file (also known as artwork) is a 2-D graphical representation of a single layer of a PCB. A typical design will have individual Gerber files for each layer (e.g., top copper, bottom copper, top silkscreen, bottom silkscreen, top soldermask, bottom soldermask) of a PCB.

What is a drill file?

A drill file (also known as a NC Drill file) stores both the specific sizes and types of drill bits that will be used in manufacturing a PCB in addition to the specific coordinate locations where each hole must be drilled. Our equipment uses files that are in Excellon format.

You need both Gerber files for each layer and a single drill file in order to successfully submit your design for manufacturing.

How do I export Gerber files from Cadence?

1. Open your PCB layout in Allegro PCB Designer

2. Choose "Manufacture > Artwork..." The Artwork Control Form window (see Figure 1) appears.

Figure 1: Artwork window

3. Next, a board outline must be added. Right-click on the TOP folder and choose "Add Manual" (see Figure 2).

Figure 2: Right-click on TOP and choose "Add Manual"

4. Enter a film name of OUTLINE and click "OK" (see Figure 3).

Figure 3: Film Name window

5. In the Subclass Selection window (see Figure 4), expand the BOARD GEOMETRY folder and check the box next to DESIGN_OUTLINE. Click "OK".
Figure 4: Subclass Selection window


6. Select the OUTLINE checkbox (see Figure 5). Make sure in Film options that "Film name: DESIGN_OUTLINE" appears (if it does not, select the OUTLINE checkbox again). Set the Undefined line width to 0.1.
Figure 5: Artwork Control Form

7. If you have an anti-etch (rubout), you will need to add it to the layer that you put it on. Click on the down arrow under the layer folder(s) that you added it too. Then, right-click on the items in the folder and select Add (see Figure 6).
Figure 6: Add anti-etch layer

8. Then, expand the anti-etch subclass folder and select the box next to the layer you are adding it to (see Figure 7). Repeat this process for each layer that you have an anti-etch on.
Figure 7: Adding the anti-etch layer to the top

9. Click the "Select all" button to output all of the layers

10. Click "Create Artwork" to export the Gerber files

11. Click "OK" to return to the layout

How do I export solder mask files from Cadence?

See the Exporting Solder Mask Layers from Cadence PCB Editor tutorial

How do I export drill files from Cadence?

  1. Open your PCB layout in Allegro PCB Designer
  2. Choose "Manufacture > NC > NC Drill..." The NC Drill window (see Figure 6) appears.

    Figure 6: NC Drill window

  3. Click "NC Parameters..." The NC Parameters window (see Figure 7) appears.

    Figure 7: NC Parameters window
  4. Select "Enhanced Excellon format" and click "Close"
  5. Name the drill file and save it in the same directory as your project
  6. Select "Auto tool select" and "Repeat codes"
  7. Click "Drill" to export the drill file
  8. Click "Close" to return to the layout

Thursday, September 17, 2015

Software design

What is a finite state machine?

A finite state machine (FSM) is a way of modeling a system such that there are a limited number of finite "states" that a system can be in, and that it can only be in one of those states at a time. Events (e.g., pushing a button) cause the system to change from one state to the next. Unexpected events do not cause the system to change states, which is useful for ignoring spurious inputs. Rather than coding for every possible input, you can instead code only for inputs that matter at the given time. The following resources provide a solid conceptual framing and implementation examples:

What is Unified Modeling Language™ (UML®)?

UML is an industry-standard specification for representing software designs. It is equivalent to schematics for hardware designs. More information on UML can be found at uml.org. Official documentation on UML is available at:
Common UML diagrams that you may use include:

What software do I use to create a UML diagram?

  • ArgoUML is an excellent free open-source software engineering tool that supports the creation of a wide variety of UML diagrams. It runs on Windows, Mac OS X, and Linux.
  • StarUML is another excellent freely-available program that supports the creation of a wide variety of UML diagrams. it runs on Windows, Mac OS X, and Linux.
  • Draw.Io - Recommended. Add-on to google drive documents, free - http://draw.io
  • LucidChart - cloud-based collaborative diagramming app ASU has a site license if you use your ASU google account.  Or get an Education Account.  Add as a addin via google drive.

What is pseudocode?

Pseudocode is a near-English representation of a program that allows you to represent the functionality of a program without worrying about the syntax. It is useful when planning how software will work. Pseudocode can be created in any text editor or word processing program. An example of pseudocode for the game Monopoly is available here.

Many links above suggested by Cecilia La Place

Sunday, September 13, 2015

What is a Gantt Chart?

A Gantt Chart is a common project management tool that helps teams understand the phases of a project, deadlines, critical paths, and interdependencies between tasks. It is important to gain experience predicting how long tasks take in order to calibrate your time management.

What software can I use to make a Gantt Chart?

Gantt Charts can be made with a variety of software programs. Here are several free options:
  • Microsoft Project - Available on MyApps (via Microsoft Imagine). This is the industry-standard project management tool (Windows)
  • ProjectLibre is an open-source alternative to Microsoft Project (Windows, Mac OS X, Linux)
  • RationalPlan Project Viewer is a Microsoft Project file viewer (Windows, Mac OS X, Linux)
  • Gantt charts can also be made in Microsoft Excel, but will not meet the dependency requirements in Dr. Jordan's assignment requirements.
  • Gantter is a cloud-based collaborative Gantt chart tool
  • Microsoft Visio is a general purpose graphical chart generation program with a nice Gantt chart template.  It is available on myapps.asu.edu through Microsoft Imagine

Monday, September 7, 2015

Transferring a Cadence schematic to PCB Editor

Introduction

In order to create a PCB, you must first prepare the schematic and check for errors, export a netlist of the schematic, import the netlist into PCB editor, and design the PCB. A netlist is a file that describes interconnections among components in a circuit. This tutorial describes the process of transferring a schematic to PCB Editor. It is assumed that you have a completed schematic (see example, Figure 1) before trying to migrate to PCB Editor.

Figure 1: Example schematic ready for transfer to PCB Editor

Video Walkthrough


1. Create Custom Footprints

All schematic symbols need a footprint. If you created any custom schematic symbols, you likely need to create a custom footprint for each one. For most ICs, you can use the Package Designer application to make custom footprints. For all other components, you can make custom footprints manually.

2. Open Project and Set Root Design

a) In Windows, open your project in the Design Entry CIS program.

b) For complex designs (see example, Figure 2), you may have multiple folders with multiple schematic sheets in each folder in the project explorer. Right-click on the folder you want to prepare for transfer to PCB Editor and choose "Make Root". This will set Cadence to generate a netlist only for the schematics inside the root folder (which will have a / through the folder symbol). This feature can be useful when your team is working on multiple break-out boards simultaneously before integrating them into one full design.

Figure 2: Example folder hierarchy for complex schematic

3. Assign Footprints to Components

c) Open the schematic and select all components on the page by choosing "Edit > Select All". Right-click and choose "Edit Properties..." (see Figure 3) to batch-edit the footprint information. The batch component property editing window will appear (see Figure 4). Click the Parts tab to show the parts in the schematic. Click the "Pivot" button to see the part information vertically instead of horizontally.

Figure 3: "Edit Properties..." menu option

Figure 4: Batch component property editing window

d) Enter footprint names (built-in or custom) for each component. For more information on finding the names of built-in footprints, see the "Where can I find a list of PCB footprints built-in to Cadence?" section on the Cadence PCB Tutorials page. Repeat until all components have footprints.

4. Run Design Rules Check

f) In the project explorer window, left-click on your schematic (see Figure 7) and choose "PCB menu > Design Rules Check" (see Figure 8). (If the Design Rules Check option is dimmed, then you have selected the wrong icon in the project explorer window). Figure 8 shows the Design Rules Check window. Leave the default options selected and click OK to continue.

Figure 7: Schematic icon selected

Figure 8: Design Rules Check... menu

Figure 9: Design Rules Check window

g) From there, you will be prompted with the DRC main screen in Figure 9. Keep everything as it is on the main screen and be sure to checkmark all of the boxes in the "Rules Setup" and "Report Setup" (see Figures 10 and 11). Doing this will ensure the DRC will check for many possible errors on the schematic. Once you have checked all of the boxes, click "Run".

Figure 10: Design Rules Check > Rules Setup pane

Figure 11: Design Rules Check > Report Setup pane

h) After you press "Run", several alerts will appear. The first will be to notify you that once you proceed with the DRC, all actions already made cannot be undone (see Figure 12). Click "Yes". The second will ask to save all the changes made since the last save (see Figure 13). Click "OK".

Figure 12: Undo Warning alert

Figure 13: Save changes alert

i) In the command window, you will see a list of warnings or errors that the DRC has found. If the "DRCs" window is blank, you are ready to move on and create your PCB design. If not and an error is listed (see example, Figure 14), go back to your schematic and fix the errors. If you see warnings, read each one and consider making the recommended changes before continuing. DO NOT SKIP THIS STEP. Fix any errors identified by the Design Rules Check and repeat steps (f) - (i) until all errors are gone (or determined not to be real problems).

Figure 14: DRCs error listing

5. Create a Netlist

h) In the project explorer window, left-click on your schematic and choose "Tools > Create Netlist..." (see Figure 15). (If the Create Netlist option is dimmed, then you have selected the wrong icon in the project explorer window). Figure 16 shows the Create Netlist window. Set the checkboxes as shown below (file names and paths will be specific to your design) and click OK to generate a netlist as shown in Figure 16. The setlist will appear in the folder you save it to. You do not need to open the file after creating it.

Figure 15: Tools > Create Netlist... menu

Figure 16: Create Netlist dialog box

6. Create/Update a Printed Circuit Board (PCB)

i) In the Project Explorer window, left-click on your schematic and choose "PCB menu > New Layout". (If the New Layout option is dimmed, then you have selected the wrong icon in the Project Explorer window). Figure 17 shows the New Layout window. Select the folder path where you would like yo create your new PCB design next to the "Board" path and click OK (see Figure 18). To update a PCB design you have already made, select the path where your current board is saved for "Input Board File" as well as for "Board", and click OK (see Figure 19). Once you have clicked OK, the Allegro PCB Editor will automatically open. See the Cadence PCB Tutorials page for more information on creating a PCB.

Figure 17: PCB > New Layout menu

Figure 18: New Layout window configured to create a new PCB design

Figure 19: New Layout window configured to update an existing PCB design

Common Errors

Schematic Updated after PCB is Routed

It's not uncommon for an error to be discovered in the schematic after the PCB has already been routed. Rework of routing can be fixed as follows:
  1. Fix the errors in the schematic
  2. In the project explorer window, left-click on your schematic (see Figure 7) and choose "Tools > Create Netlist...". (If the Create Netlist option is dimmed, then you have selected the wrong icon in the project explorer window). Figure 9 shows the Create Netlist window. Set the checkboxes as shown above (file names and paths will be specific to your design), but this time set "Input Board File" to be your current routed PCB file and "Output Board File" to be a different name for the updated file.
  3. Click OK to generate a netlist and push the changes forward to PCB Editor.

Duplicate Reference Designators

Sometimes, making significant edits to a schematic can result in multiple components with the same reference designators (e.g., U1, U2, R1, R2). This can be fixed by renumbering all of the reference designators in a schematic.

  1. Open the project in Design Entry CIS and select the *.dsn file in the project explorer.
  2. Choose "Tools > Annotate", select "Reset part references to "?"", and click OK (see Figure 10). Your schematic will now have ? marks for all reference designator numbers (e.g., U?, J?).
  3. Choose "Tools > Annotate" again, select "Incremental reference update", and click OK (see Figure 10). This will replace all ? marks with numbers to create unique reference designators.


Figure 10: Annotate window

Additional Common Errors

  • You changed your "nets" name but missed a trace somewhere
  • You changed your "nets" name and connected two different nets together accidentally (e.g., Ground_Plane and Ground)
  • Cadence couldn't find your footprint, or no footprint was specified
  • Missing a *.psm file for the *.dra file, or vice-versa
  • Unconnected traces
  • You used multiple ground symbols and connected them together incorrectly
  • Forgetting to define your paths correctly for footprints to be findable
  • Defining the footprint names for all parts.


Based on a tutorial by Josh Carroll