Category Archives: PCBA & ENG

Appnote: Parallax Propeller layout. Dual SMD footprint.

The Parallax Propeller MCU runs in 3 different flavors. A DIP-40 package (P8X32A-D40), a LQFP-44 package (P8X32A-Q44), and a QFN-44 package (P8X32A-M44). This appnote covers the two SMD packages; LQFP-44 and QFN-44.

The schematic is fairly simple as its just to show a typical layout of for the Propeller. The part number for the crystal is a 6MHz which will run the Propeller at 96MHz. It is a common HC-49/US package so the standard 5MHz type crystal can be used with this layout.

I made a special footprint that can use both the P8X32A-Q44 and P8X32A-M44. This way a part shortage on either package won’t hurt production. I made sure to leave plenty of room around the chip and supporting circuitry for easy fanout of the I/O. Just make sure to route away from the X0 and X1 crystal I/O to reduce EMF.

Files can be found on the GitHub repository and the footprint itself can be found in the my Eagle Library.

Appnote: Using mosfets to expand the WS2801 LED Driver

The WS2801 is an interesting chip. It is a constant current LED driver with 3 drivers that the current can be set individually. This lends the WS2801 to be useful when driving RGB LEDs. Each channel runs off an internal 8-bit PWM (total 24-bits) that is serially clocked in over a 2-wire (data and clock) scheme. This gives each channel 256 levels of brightness. The WS2801 can also be chained together with other WS2801 chips to reduce I/O usage. It can drive up to 30mA of current per channel from 3.3V to 5V which is a fair bit of power.

What if more power and current are needed though? Page 9 and 10 of the datasheet shows that a NPN transistor like a 2n2904 can be used to increase the current sinking capacity. This is all good unless you need even more power. N-type mosfets can be gated to the outputs of the WS2801 in a similar fashion.

Above is an example schematic on how to connect the mosfets to a pair of WS2801 chips. The polarity pin (POL pin3) is pulled down to put the WS2801 into driving mode. The feedback pins (XFB pin4,5,6) are pulled to ground putting the driver in constant voltage driving mode. Pull up resistors are needed on the mosfet gates as the outputs of the WS2801 are open-drain gates.

Demo layout of the dual WS2801 schematic. The WS2801 chip is a really nice chip to layout as the pinout is well thought out. Because two power sources are used (3.3V and voltage for the LEDs) the grounds must be connected to give the same reference voltage. A zero ohm resistor at R7 is used to connect these two grounds. A ferrite bead could be used here as well to reduce noise crossover if the high voltage LED power source is noisy.

The high power LEDs should be connected to the mosfet drain through a current limiting resistor. Multiple LEDs can be connected together serially if the supply voltage is high enough. The voltage drop across the mosfets can be generally ignored as the resistance is usually around .2ohms for low resistance series (RSon) mosfets.

R1 = (V_LED - (V_F x N))/ I


Where
R1 = Resistor value
V_LED = High voltage LED source
V_F = Forward voltage of the LEDs
N = Number of LEDs
I = Forward current of LEDs

Also you have to make sure your resistors are large enough to handle the current load.

RW = (V_LED - (V_F x N)) x I


Where
RW = Resistor watt rating
V_LED = High voltage LED source
V_F = Forward voltage of the LEDs
N = Number of LEDs
I = Forward current of LEDs

For example the OVSPRGBCR4 RGB LED will be used. The source voltage will be 24V and 7 LEDs will be chained together. The forward current (If) of all 3 channels is 250mA. The forward voltage (Vf) of the red channel is 2.3V and the Vf of the green and blue channel is 3.4V.

RED:
(24V - (2.3V x 7))/ .25A = 31.6ohms
(24V - (2.3V x 7)) x .25A = 1.975W


GREEN & BLUE:
(24V - (3.4V x 7))/ .25 = .8ohms
(24V - (3.4V x 7)) x .25A = .05W

Finding a resister to work with the Green and Blue channels of the LED is fairly easy but the Red channel is a bit difficult due to the high power rating needed. A quick look on mouser yields limited selection of 32ohm resistors in a big enough size to handle 2W but two 16ohm 1W resistors in series would work just as well and are much easier to find.

I am using this method to drive banks of RGB LEDs on the PinHeck Pinball System for general cabinet illumination. The Eagle files of the schematics and board layout are on GitHub. I also have some demo SPIN code for the Parallax Propeller chip to drive the WS2801 that I wrote awhile back.

AT2 Motion Controller

This is the first consumer product I ever designed for Dynamic Perception. The AT2 Motion Controller is a dual brushed DC motor controller that offers control with a joystick or a kind of cruse control with the knobs. In Joystick mode, the knobs act as adjustable dampening for the motors. The dampening is adjustable from 0 seconds to 5 seconds. In knob mode the knobs set the speed of the motors. Modes can be swapped individually for each channel (1 in Joystick and 1 in knob) is possible with the push buttons.

Schematic

Above is the full schematic. You can download it and the design files at Dynamic Perception’s github. Everything for the board design is open sourced.

The AT2 can accept a voltage power source from 7V to 16V and power two 1.2A 12V motors. Motor controller is a standard L298 motor driver which should be recognized by most hobbyist.

There are no microcontrollers in the AT2. Each channel uses 4 op-amps to create a pair of square waves to drive the L298 via PWM.

Schematic_PWM_Generator

The first op-amp is just creates a high impedance input to the generator. It is set up as a voltage follower to pass the voltage that the knobs or joystick output. The knobs and joystick do this by just creating a voltage divider. Second op-amp creates an oscillating triangle wave at around 75Hz. The voltage from the first op-amp sets the voltage offset of this triangle wave. The third and forth op-amps are voltage comparators. One is set to trigger at above a certain voltage and the other is set to trigger below a certain voltage. These voltages are set by the voltage dividers. The output of the voltage comparators are the PWM wave that the L298 sees. I have seen a couple motor controllers that operate this way.

This is what the triangle wave looks like.

When the triangle wave is activating the top end voltage comparator. This is with a high voltage input to the first op-amp.

When the triangle wave is activating the bottom end voltage comparator. This is with a low voltage input to the first op-amp.

It took 8 revisions to get the functionality and design of the controller correct.

The first prototypes are in the top left with the final revision being the bottom right. I will never order a board without silkscreen again.

This is the progression of the case design with the oldest prototype on the right side.

First hacked together prototype. I just took a piece of scrap aluminum to make the “chassis”.

Second all aluminum case prototype. This proved to be too heavy and costly to machine.

Third prototype with a hybrid case. My personal favorite. It has an aluminum bottom and a plastic top. The weight was perfect but it still was still too costly to manufacture.

Forth case with the curved plastic on top. This decorative piece of plastic prevented easy access to the motor and power connectors to it was removed.

Final design with silkscreen. The plastic is a really tough ABS which resists cracking. The texture of the plastic is also nice to the touch. Rubber knobs cap the potentiometers.

Some inside action on how it is all wired together.

You can buy the AT2 Motion Controller from Dynamic Perception.

Prop Dev Stick resource page updated

I updated the PDS repository with information on how to configure the FT230X EEPROM and the Propeller Tool IDE.

Template for FT230X EEPROM


FT230X_PDS_REV_1.xml

You will need to download FT-Prog from FTDI. The FT230X needs to be flashed with this template for the Propeller Development Stick to function correctly.

Also the Propeller Tool needs a tweak to its options to make it use the RTS signal to reset the Propeller instead of the DTR signal (which the FT230X does not have). Do this by opening Propeller Tool and clicking Edit. At the bottom there is “Preferences”. Under the tab “Operation” there will be Propeller Reset Signal. Change it from “DTR” to “DTR & RTS”. Press accept to save the settings. Propeller GCC using SimpleIDE also allows you to change the reset signal in the general tab of properties.