2015 Christmas Ornament

From PaxSpace Inc
Jump to: navigation, search


Overview

The 2015 PaxSpace Christmas ornament is a Christmas ball shaped PCB with a PSoC_4 microcontroller, 3 RGB LEDs, spaces for multiple other LEDs, and pin headers to attach other peripheral devices.

Schematic

The basic setup of the PSoC 4 chip is based on the reference design used on the Cypress CY8CKIT-049-42xx Development Kit

2015 Ornament.pdf

GPIO Connections

The following is a mapping of which PSoC GPIO ports are connected to each peripheral on the ornament:

RGB LEDs
PSoC Port Peripheral Associated Resistor
P1.0 RGB LED D7 RED R10
P1.2 RGB LED D7 BLUE R1
P1.1 RGB LED D7 GREEN R2
P0.0 RGB LED D14 RED R24
P0.2 RGB LED D14 BLUE R22
P0.1 RGB LED D14 GREEN R23
P3.4 RGB LED D15 RED R21
P3.6 RGB LED D15 BLUE R19
P3.5 RGB LED D15 GREEN R20
SWD Programming Header
PSoC Port Peripheral
P3.2 SWDIO
P3.3 SWDCLK
GPIO Header
PSoC Port
P2.7
P0.6
P3.7
P4.0
P4.1
P0.4
Other LED Pads
PSoC Port Peripheral Associated Resistor
P2.3 D6 R6
P2.4 D8 R7
P2.5 D9 R9
P3.0 D12 R14
P2.6 D10 R12
P3.1 D13 R15
P2.7 D11 R13
P0.3 D16 R25
P0.5 D18 R27
P0.6 D19 R28
P0.7 D20 R29
P1.3 D1 R1
P1.4 D2 R2
P1.5 D3 R3
P1.6 D4 R4
P1.7 D5 R5

Board Assembly

Solder Paste Application

First, find a well lit, flat table. Shim around the board with some other blank PCBs or other items of the same thickness to support the stencil. Carefully place the stencil over the board so that the stencil holes line up as well as possible with the surface mount pads. Tape the stencil down, trying to keep it as flat and aligned as possible. Solder paste stencil

Scoop a small amount of solder paste over the holes in the stencil. Using a credit card or other squeegee, gently swipe the excess paste off of the stencil, leaving a level amount of paste in the holes. For best results, try to avoid moving or bending the stencil, so that paste only gets applied to the open areas. This is particularly difficult on the tightly placed pads for the microcontroller chip. If the applied paste doesn't quite come out perfectly, it may likely end up fine after reflow soldering since surface tension of the melted solder will tend to separate back out to the metal pads and pins.

Solder paste applied

If you mess something up, don't stress. Wipe the paste off with the squeegee and try again.

Place Surface Mount Parts

Start placing the surface mount components on to the solder pasted board. You'll want to go in this order:

  1. PSoC4 Microcontroller
  2. Capacitors
  3. Resistors

Gently pick up each component with tweezers and try to drop it onto the pasted pads with a steady hand. Components don't need to line up perfectly since the reflow process will tend to pull them into alignment as the solder melts.

Here is a picture of the PSoC and all of the capacitors placed.

PSoC and capacitors in place

Note that the orientation of the PSoC is important. The small circle indentation on the chip will be in the upper right hand of the board. The capacitors do not need to face a certain direction as long as one metal end is on each pad of its footprint.

Do take note that the value of each capacitor varies.

Next, place the surface mount resistors on the board. In order to use the three RGB LEDs, you'll at a minimum need to populate the following resistors:

  • R1
  • R2
  • R10
  • R19
  • R20
  • R21
  • R22
  • R23
  • R24

220 ohm resistors should work OK for the RGB LEDs.

If you want to use any of the other LED pads on the board, you should also add a resistor for each of those. If you'd rather not use the extra LED pads, or want to use the extra LED pads for something other than LEDs, you can either leave those resistors unpopulated and create solder jumpers later, or you can use 0 ohm resistors for those components to create a direct connection to the PSoC I/O pin.

Resistors placed

Reflow Solder

Once all of the surface mount components are placed on the board, carefully place the board into the reflow toaster oven. Close the door with the temperate probe inside. Use the controls on the toaster oven to attempt to follow the recommended reflow soldering temperature profile. Getting the ramp up times accurate is difficult with our manual setup. See the solderpaste datasheet for the reflow profile documentation: Solder Paste Datasheet

Reflow soldering

Inspect And Cleanup

After reflow soldering the board the solder paste should be solid and shiny. Inspect the connections to make sure they are all connected properly and clean up any shorted/bridged pins with solder wick or a solder sucker. You can attempt to hand solder or use the hot air soldering stations to touch up anything that may not have soldered correctly.

Post reflow cleanup

Solder RGB LEDs

Insert the 4 pin RGB LEDs into the holes. Note that the ground pin (the longest of the four pins) should be inserted into the square shaped pad. Use a soldering iron and solder to connect each pin to its pad.

Solder Programming Header

Solder a 5 pin female pin header to the programming header holes near the top of the ornament.

Solder a Battery Connection

You'll want to make some kind of removable connection between the battery holder and the holes labeled "+3V" and "GND" that are on the left side of the board. You can use some type of male/female pin headers, screw terminals, or wires with a disconnect switch on the red wire to remove power during programming. The empty space in the center of the board can be used to hot glue the battery holder in place and out of the way.

Programming

The ornament boards can be programmed using the "KitProg" piece of the Cypress CY8CKIT-059 development board. If you want to buy your own programmer, you can get the CY8CKIT-059 for ~$10 from Digikey, Mouser or other suppliers.

WARNING: Before attaching the programmer to the board, disconnect your battery power from the board. The programmer supplies 5V power to the board via your USB connection, and you could damage either the programmer or you computer if you leave the batteries connected as well.

Align the markings on the programmer with the markings on the board programming header, for example GND to GND, VTARG to V+, Reset to RST, etc. Then connect the programmer to the board, and plug the programmer into your USB port.

Writing a program to control the ornament can be done with PSoC Creator. PSoC Creator is a free Integrated Development Environment software package provided by the chip manufacturer. The software is free to use, but is only available for Windows OS.

Download PSoC Creator Here

There is a good basic set of video tutorials available from Cypress Semiconductor on Youtube:

Watch them here

Example Programs

Here are two example PSoC projects that can be programmed to the PaxSpace ornament.

File:Ornament1.cyprj.Archive01.zip - Flashes all LEDs Red, then Green, then Blue, and repeats.

File:RGB PWM.cyprj.Archive01.zip - Uses 3 PWM hardware blocks to cycle through all of the RGB color mixes.