Showing posts with label smd. Show all posts
Showing posts with label smd. Show all posts

Friday, 26 July 2013

3 Ghz counter and power detector build Part II Troubles programming the Dsp

When I populate a new pcb I first solder the chips with the smallest footprints.
Next in order are the bigger ics and power supply chips.

Then I make a break and program the controller.
To program a Pic chip you just need the chip, some decoupling capacitors a pullup resistor  on the reset line and the three programming data lines MCLEAR (reset line),PGC,PGD.
Usually pic chips are super easy to program, compared to the Atmel Avr line they even don't need an oscillator.

So with high hopes I started  the Microchip ide Mplab, connected the programmer to the board (using pogo pins to avoid solderin a connector) and clicked the connect menu entry.


Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
ICDWarn0020: Invalid target device id (expected=0xF0F, read=0x0)
...Reading ICD Product ID
Running ICD Self Test
... Failed Self Test.  See ICD2 Settings (Programmer->Settings) (status tab) for details.
MPLAB ICD 2 ready for next operation

Hmmmm
At least one head scratching hours later, no difference.
The Dsp chip simply told me in this working environment we ar on strike, go f*** yourself.
Now what to do if a processor is in working refusal ?
The best way is to negotiating with their local labour union boss, the datasheet.
In a good datasheet there is often a minimal working environment section and voila there is a strange pin number 7 called Vcap/Vdcore.

Hmmmm

After further reading I understood the internal core runs on 2.5V and to avoid an extra power line the chi provides an internal regulator which needs a decoupling capacitor.

Next try:

Connecting to MPLAB ICD 2
...Connected
Setting Vdd source to target
Target Device dsPIC33FJ32GP204 found, revision = Rev 0x3006
...Reading ICD Product ID
Running ICD Self Test
...Passed
MPLAB ICD 2 ready for next operation
Programming Target...
...Validating configuration fields
ICDWarn0046:  Because clock switching is enabled, MPLAB ICD 2 requires the user to cycle target power after a program operation.
...Erasing Part
...Programming Program Memory (0x0 - 0x54FF)
Verifying...
...Program Memory
...Verify Succeeded
...Programming Configuration Bits
.. Config Memory
Verifying configuration memory...
...Programming succeeded

BOOOOOM
Success, the chip is now programmed.
Now that was some heavy lifting , usually troubles appear from the most unexpected direction.

Time for some pictures:
Dsp processor

PLL chip very small footprint

 Log Power measurement , Cpld and Pll chips

Links:
3 Ghz counter and power detector build Part I
Elektor project page

Tuesday, 23 July 2013

WS2812 RGB Led Matrix Booster Pack

The WS2812 is a highly interesting RGB led, since it already has a controller build in and supports daisy chaining.

Now how does it work ?
You can send 3 bytes of information to the led. Every byte corresponds to either the intensity of the colour red green or blue. 255 translates to highest intensity while 0 turns the corresponding colour of.
So f.e. you have 10 leds in a row and send 30 bytes to them. The first led grabs the first 3 bytes and passes the left 27 bytes down to the other leds. But the led not only passes the bytes down, it also reshapes the signal and amplifies it.. You don't need to worry of signal integrity.

The controller also only needs one data line, so there is no clock signal needed.

There is only one problem, the signal has to be short to get reasonable update rates.
So a 1 is translated to a 1.2us long high impulse followed by a 1.3us long low impulse.
While a 0 is translated to a 0.5us long high impulse followed by a 2. us long low impulse.

So the pulses need to be so fast you cannot bit bang them any more you need a built in hardware module.
Some genius developer on the internet suggested to use the built in Spi bus protocol since it supports fast data rates.But there are still some problems waiting to be solved. In hardware Spi a bit always has the same time frame and either a high or a low pulse.

So you have to map your bit to a matching spi sequence.
So first program the bus speed to 2 mhz. Every bit is now 0,5 us long.
A bit with value 1 now translates roughly into 11000
A bit with value 0 translates exactly into 10000

The bit with the value 1 is not exactly mapped but the processor has a tolerance of +-150 nS so we should be fine.

I tested the code with a WS2812 led light strip I built and it worked.

This is a great example of a developers ingenuity, there is a big problem but thinking out of the box and using an hardware bus protocol which has completely different specs but is fast enough saved the day.

I plan to use the led matrix  as a moodlight, but most importantly I wanted to learn how to use this leds.
I want to use them to display sensor data like temperature and humidity. Blue would translate to below comfortable, green ok and red above comfortable level.

RobG Led Matrix Msp430 Booster Pack


Backside JP1 powers module from launchpad

Booster pack in action
 Links:
Buy pcb
Designers forum thread

Saturday, 13 July 2013

Sorting, sorting , sorting


Usually I store my resistors in a zip bag and there is always the worry  if I already own the right ones for a certain project.

More than a year ago I bought three smd component storage boxes and started to sort my 0603 resistors.
First you have to label all the compartments and then you fill them up with resistors.
Great care is to be taken, wrong placed resistors have to potential to sabotage you project.

Sorting the 0603 resistors was really not a project you would write home about.
But the resistor box turned out extremely useful.
In fact so useful I would not miss this box anymore.
By the time (> 1 year at least) I also forgot about all the hassle.
So I decided today it is time to fill another box, this time 0805 resistors.
To get an idea of the project, i own meanwhile more then 10k of 0805 resistors with about 170 different values.Eight back aching hours later, I finally sorted them in !!!

 
Very useful storage box

more than 10.000 sorted resistors

Friday, 12 July 2013

How to solder QFN chips like the MSP430FR5739

The new MSP430FR chip line has interesting features like embedded non volatile fram and ultra low power consumption. The chip is available in TSSOP38 or QFN40 package.I simply had to try them out.

Usually hobbyists  are repelled by the very small case and the missing pins.
But once you get used to work with the QFN package you start to prefer it over any other packaging.
Since they have no visible pins, they cannot suck the solder up via capillary suction and create ugly shorts.

To solder a qfn chip you buy a breakout board and put a small amount of solder paste at the pcb.
Beside the solder paste you add some solder flux (very important).
Then you place the chip on the board and roughly align it.
With an heat gun you slowly heat the chip and board until the flux starts to melt.
This is a very important phase because the chip will swim on the fluid and align itself correctly.
Now heat it up until the solder past melts and you are done.

The next problem you will face is how to check the correct alignment and if all pins are correctly connected to the board.I use a multimeter for that purpose. Usually the pins have a certain resistance around 5k to 1mega ohm. Measure all pins and if there are shorts suck them away using some solder wick.

Once you get used to Qfn packages and are able to solder the chip  correctly it will only require about two minutes of your precious spare time. Soon you will start to enjoy working with Qfn packages.

MSP430 in QFN package compared to a Dil20 chip

Links
MSP430FR5739
Fram
Demo video

Thursday, 11 July 2013

Meet the Powerscope

Since Ti announced the Launchpad I was very excited to play with this awesome development tool.
It is like a Arduino on steroids, mostly because of it's 16 bit capability and most important it has a debugger.
When your code does not work nothing is more useful than a debugger, maybe  with the exception of a razor sharp brain and years of development experience might not hurt either.

Since the Msp430 line supports low energy consumption and have many different feature sets it is important to verify if the consumption is really as good as it could be. To see exactly what is going on, a scope is the tool of choice, but for a quick estimation the Powerscope is much more comfortable and easier to use.

When measuring very low power devices I would not recommend to use a multimeter, because of their usualy high burden voltage. To circumvent this problem, David Jones from EEVBlog designed the uCurrent , also a great tool.
The Superprobe is a somehow similar device, but it has it's own display so you don't need to connect it to a multimeter.

I also built an usb adapter to attach the Powerscope to a Usb device and measure it's power consumption.
In the attached example pictures I connected the Powersope to an Launchpad which drove a CC2500 radio device.It does not make much sense, because the attached debugger also has a unknown power consumption but it gives an idea of usage and it also shows that the TX mode consumes about 17 mA more than the RX mode .Btw. the code in the moment has no power optimisations what so ever, I was more than happy to get the CC2500 up and running,...

The programming of the Powerscope also was more than easy.
You can either use the Launchpads programmer by removing all the jumpers and insert a programmer cable or you can like me use a Goodfet programmer designed by Travis Goodspeed.
Since I don't like to solder headers just for one time programming, I made a small programming cable with pogo pins. You can use this kind of connection even for debugging.

You can buy an empty pcb at the 43oh store.

Powerscope front side


Powerscope back side

Powerscope connected to Lauchpad in TX mode

Powerscope connected to Launchpad in RX mode

Goodfet 4_1 programmer and programming cable with pogo pins


Links:

Buy Powerscope pcb
Designer thread
Powerscope Code and Info page
Goodfet programmer

Tuesday, 9 July 2013

Spectrum analyzer Part IV Logarithmic Detector

Description (copied from Scotty's web page)

The 8306 Log Detector Module has a dual function.  It is used as a detector to convert RF power to DC voltage (RSSI).  And, it is used as a high gain, RF limited amplifier.
The module has an input impedance of 50 ohms (J1) and a bandwidth of  3 MHz to 160 MHz.  
The RSSI dynamic range is -90 dBm to +10 dBm, with a DC output of +0.4 volts to +2.4 volts, on J2, "MAGVOLTS".  The Limited I.F. Output (J3) is a 50 ohm source with 50 mv peak to peak output.  
The limiter input dynamic range is from -77 dBm to +10 dBm.

Log Detector Rev 0


Build process

So far the Log Detector was one of the easiest modules to solder.
The only problem was to get hold of T1 but fortunately Coilcraft was kind enough to send me two pieces.

Once the module is thoroughly tested and confirmed working it is very important to shield this kind of units properly. 

 Links:
Spectrum analyzer Part I Controller board
Spectrum analyzer Part II Phase Detector  
Spectrum analyzer Part III ADC 16

Log Detector Module
 

Spectrum analyzer Part III ADC 16

There are two Slim modules for the ADC section.
Their main difference is resolution one delivers 16 bit the other module 12 bit.
Although the 12 bit version is cheaper and has a way easier to solder footprint, I choose the 16 bit version.
 
 Description

The ADC-16 is a dual 16 bit, serial, analog to digital converter, using two AD7685's.  
There is no manual adjustment to set the A to D range.  It is not needed to obtain excellent resolution in the MSA and VNA systems.  Each ADC will digitize its input of 0 to 5 volts to a bit value of 0 to  65535 bits.  This equates to 76.3 uv per bit.
Both A/D's will capture, and clock out their data simultaneously


ADC 16 rev A










Spectrum analyzer Part II Phase Detector Module


The  Phase Detector Module is a 360 degree, Phase to Voltage Converter.  It is specifically designed to operate at 10.7 MHz, but will operate in the KHz range up to 30 MHz.  
 The J1 and J2 inputs can be sine or square wave .  The min / max sine input is -20 dBm to +18 dBm.  The min / max square input is 10 mvpp to 5vpp.  Input impedance is nominally 50 ohms, but can be changed to any input impedance.
The output, at J3, is a DC voltage that is proportional to the differential phase of the input signals at J1 and J2.  The 0v to +5v output should be loaded with 100 K or higher.  A realistic phase range is from 20 degrees to 340 degrees with error less than .1 degrees.
Power requirement for the is +7 volts to +15 volts at 50 ma.

To build the RevC module I had to made some component changes and add some capacitors.
The most visible change is the added jumper wire in the bottom right.
It is not easy to solder a jumper to an ic with such a small footprint, but it is manageable as long as you have a good magnifying glass as guidance.

Phase Detector rev C





















Links:
Spectrum analyzer Part I Controller board build notes

Phase Detector Slim Module