Canon Ixy 60 CCD experiments Part 2

Continuing on from my previous post on the Canon Ixy 60, I’ve been playing around a bit more and seem to have got some data out. Some rambling in the following video:

I also tried throwing some data into the camera and seeing if it would show up on the camera LCD in the following video:

The code used in the video on the USRP is as follows. Next set is to build this out a bit and see if I can decode some image data:

#include <uhd/types/tune_request.hpp>
#include <uhd/utils/thread_priority.hpp>
#include <uhd/utils/safe_main.hpp>
#include <uhd/usrp/multi_usrp.hpp>
#include <uhd/exception.hpp>
#include <iostream>
#include <fstream>
#include <csignal>
#include <complex>

using namespace std;

int UHD_SAFE_MAIN(int argc, char *argv[]){
    uhd::set_thread_priority_safe();

    uhd::usrp::multi_usrp::sptr usrp = uhd::usrp::multi_usrp::make(string(""));

    usrp->set_clock_source("internal"); // set clock

    //always select the subdevice first, the channel mapping affects the other settings
    usrp->set_rx_subdev_spec(string("A:A"));

    std::cout << "Using Device: " << usrp->get_pp_string() << std::endl;
    double rate = 1000000; // trying 1MSPS
    usrp->set_rx_rate(rate);

    //set the center frequency
    double freq=0;
    uhd::tune_request_t tune_request(freq);
    usrp->set_rx_freq(tune_request);

    //usrp->set_rx_gain(5);
    //usrp->set_rx_bandwidth(100);

//    ant = "";
//    usrp->set_rx_antenna(ant);

//   cout << usrp->get_mboard_sensor("lo_locked", 0).to_bool() << endl;

    sleep(1);

/////////////// RECEIVE CODE

    //create a receive streamer
    uhd::stream_args_t stream_args("sc16","");
    uhd::rx_streamer::sptr rx_stream = usrp->get_rx_stream(stream_args);

    uhd::rx_metadata_t md;
    std::vector<std::complex<short> > buffer(1000000);

    //setup streaming
    uhd::stream_cmd_t stream_cmd(uhd::stream_cmd_t::STREAM_MODE_START_CONTINUOUS);
    stream_cmd.num_samps = 0;
    stream_cmd.stream_now = true;
    stream_cmd.time_spec = uhd::time_spec_t();
    rx_stream->issue_stream_cmd(stream_cmd);

    for(;;) {

        size_t num_rx_samps = rx_stream->recv(&buffer.front(), buffer.size(), md, 3.0, false);

        if (md.error_code == uhd::rx_metadata_t::ERROR_CODE_TIMEOUT) { cerr << "timeout"  << endl; }
        if (md.error_code == uhd::rx_metadata_t::ERROR_CODE_OVERFLOW){ cerr << "overflow" << endl; }
        if (md.error_code != uhd::rx_metadata_t::ERROR_CODE_NONE)    { cerr <<  md.strerror() << endl; }
 
/*
        double avg=0; double samps=0;
        for(int n=0;n<1000;n++) {
          if(n>0) avg -= avg/samps;
          avg += buffer[n].real()/(samps+1);
          samps++;
        }
*/
        cout << avg << endl;
  //      cout << "data size: " << num_rx_samps << " first: " << (&buffer.front())[0] << endl;
    }

    // Will never get here
    stream_cmd.stream_mode = uhd::stream_cmd_t::STREAM_MODE_STOP_CONTINUOUS;
    rx_stream->issue_stream_cmd(stream_cmd);
}

Nginx caching reverse proxy configuration

I was pretty impressed by how easy it was to get Nginx to work as a caching reverse proxy. I run a slightly odd configuration where my host throws out ssh tunnels to an EC2 instance, this then feeds into Cloudflare for CDN.

I decided to put Nginx in the middle. While Cloudflare is good, it doesn’t really do much by way of aggressive caching and the SSH tunnels were still getting hit pretty hard. In the free Cloudflare plan you don’t get much control over this anyway.

So I switched up my tunnels and installed Nginx on the EC2 instance. Configured this as a reverse proxy and set reasonably aggressive caching. Config follows:

user www-data;
worker_processes 4;
pid /run/nginx.pid;

events {
	worker_connections 768;
	# multi_accept on;
}

http {

	##
	# Basic Settings
	##

	sendfile on;
	tcp_nopush on;
	tcp_nodelay on;
	keepalive_timeout 65;
	types_hash_max_size 2048;
	# server_tokens off;

	# server_names_hash_bucket_size 64;
	# server_name_in_redirect off;

	include /etc/nginx/mime.types;
	default_type application/octet-stream;

	##
	# Logging Settings
	##

	access_log /var/log/nginx/access.log;
	error_log /var/log/nginx/error.log;

	##
	# Gzip Settings
	##

	gzip on;
	gzip_disable "msie6";
	proxy_cache_path /data/nginx/cache keys_zone=one:10m;

	server {
		listen 80;
		proxy_cache one;
		proxy_cache_min_uses 100;
		proxy_cache_valid 200 302 30m;
		proxy_cache_valid 404      1m;
		    proxy_set_header Host $host;
		location / {
            		proxy_pass http://localhost:8090;
        	}
    	}
}

Canon Ixy 60 (Powershot SD450)

ixy60_frontpcb

I’ve been playing with some Canon Ixy 60s which I picked up for 5USD in the junk bins of Akihabara. The camera uses a 5MP CCD sensor. I’m interested in understanding the protocol used to communicate with this sensor better. This post documents my notes so far.

I could just about get the thing to power up while disassembled by jaming the battery door sensor closed and pressing the power button:

ixy_jam

I then taped everything down, so I could probe around. It’s still annoying that it powers off every 30s or so:

ixy_60_tape1

I assigned pin numbers to the CCD pins as follows:
ixy_60_ccd

I then removed the CCD from the FPCB, hopefully I didn’t damage the FPCB in the process. Interestingly the camera still powers up. If you short the pins in the bottom left corner you even get something on the screen.

ixy_ccd_fpcb

Notes

I saved scope traces for all the pins below (clearly a bunch are ground, but hey).

Pin1: 1
Pin2: 1
Pin3: 1
Pin4: 1
Pin5: 1
Pin6: 1
Pin7: 1
Pin8: 1
Pin9: 1
Pin10: 1
Pin11: 1
Pin12: 1
Pin13: 1
Pin14: 1
Pin15: 1
Pin16: 1
Pin17: 1
Pin18: 1
Pin19: 1
Pin20: 1
Pin21: 1
Pin22: 1
Pin23: 1
Pin24: 1
Pin25: 1
Pin26: 1
Pin27: 1
Pin28: 1

DPReview

BGA Reballing experiments

bga_final

I removed the BGA part for the board, using a WEP 858D hot air rework station (flow rate 8, 350degrees). I let the part heat up for some time before applying pressure, to try and avoid pulling any pads off the chip.

I then cleaned up the part, apply a bunch of flux (any flux I had lying around, I think at this point I used goot BS-75B). Dragged a soldering iron (FX888, 350degrees) across the chip to pick up big blobs of solder.

Then I set the BGA in a vice and applied heat with the hot air rework station (350degrees, flowrate 8). I gently scraped across the chip with a craft knife:

bga_cleanup

And after that went over it once more with a soldering iron. This seemed to clean things up pretty well. Though it was tempting to go over the part with some solder braid, I was concerned I’d lift pads off.

I taped the BGA part to the stencil with some off-brand kapton tape:

bga_tape2

Reballing with balls – fail

BGA reballed using balls. I used 0.5mm balls (Sn63Pb37 Yue Cheng Electronics Co. Ltd). And a 0.5mm stencil. I fluxed the chip with Amtech No-clean NC-SS9 flux. As you can see this was pretty much a fail. Most of the balls just kind of stuck to stencil. They were supplied as a kit, but my guess is that actually you should use 0.45mm balls with a 0.5stencil? If you know please comment.

Update: I’ve heard from Akiba, that what a really need to do is force the balls through. I’ve ordered 0.45mm balls anyway but will try this at some point.

The balls that did go through looked ok:

using_balls

Reballing with paste – partial success

Solder paste, the paste I have is called “Classical Mechanic Solder Paste”. XG-50 Sn63/Pb37. 25-45um.

bga_paste_add

Ball made using solder paste method (I think flow rate 3.5, 200 degrees). It seems to be important to apply the flow directly downward, rather than at an angle. Also, don’t apply too much paste. Clean off excess with a Q-tip, but it’s likely excess paste will smear under the stencil anyway so you want to avoid applying too much.

bga_paste

As you can see a few balls are missing. Looking at the picture again, I think the ball sizes are a bit inconsistant as well. I decided to place it anyway, the unballed pins are unused, and I figured it would be interesting to try the whole process.

The board was plated (ENIG). I used the above AMTECH flux and spread this around with the rework station (300degrees IIRC). Then applied the above paste to tin. Cleaned with flux cleaner (goot BS-R20B), refluxed, tinned. Finally left a layer of flux on the board. Then placed the chip, spent way too much time trying to get it aligned properly.

I used a flow rate of 3.5 at 350 degrees to solder the part. I tapped the board and nudged the chip a bit which I’ve heard helps the chip align.

bga_final

Everything looks good up a loupe. But I’ve yet to test it!