Archive for the 'Uncategorized' Category

28
Mar

Adventures in VLSI: D flip-flop with asynchronous set/reset

D flip-flop with asynchronous set/reset (top), compared to a D-FF without set/reset (bottom). The major change is replacing the inverters with NAND gates.

14
Feb

Adventures in VLSI: edge-triggered D flip-flop layout

The next cell is an edge-triggered D flip-flop. Baker’s book introduces the transmission gate version first and from my simulations it seems to work at higher frequencies and use less power than the standard NAND gate implementation.

Here’s the initial layout. It is 190 λ x 105 λ = 20,000 λ2 (λ is half gate Ldrawn)

After some tweaking, now it’s 154 λ x 105 λ = 16,200 λ2

With some more iterations, I’ve kept the size the same but now only two metal layers are used, freeing up vertical routing resources. Also, the power rails are now on M1 instead of higher metal, so that power vias don’t block routing.

28
Jan

XMOS SPI speed

On the ARM Cortex-M3 96MHz mbed, I was able to SPI write out 3456 bits of data at 1.6kHz — plus some integer math and memory look-up time. How fast is the XMOS, where each core is clocked at 400MHz, four times the speed of the mbed? Here’s my XMOS code, which does SPI writes in 32-bit chunks. There is no hardware peripheral specifically for SPI, so you have to make use of their buffered I/O ports.

I clocked it at 2.5kHz (108 transfers of 32-bits), which isn’t that much faster than my mbed code. The mbed had serial at 16MHz, but the XMOS code is 12.5MHz, so the comparison isn’t 100% fair. Below is the main code that writes out data. Note that the XMOS has to do some extra work for each transfer. Reconfiguring the port seems to take around 1 us, which is a waste of time.

Of course, the majority of the time is spent in the serial transfer itself. If there were absolutely no overhead, the maximum transfer rate would have been 12.5MHz / 3456 = 3.61kHz. The nature of XMOS buffered I/O and SPI mode 0 adds around 30% overhead.

void send_word(unsigned int data) {
	//check MSB of data and set MOSI line accordingly
	//skip check if you need SPI mode 3, and set clock pattern to 0xFFFFFFFF

	if (data & 0x80000000)
		configure_out_port(mosi, blk2, 1);
	else
		configure_out_port(mosi, blk2, 0);

	//reverse data to big endian order
	mosi <: (bitrev(data) >> 1);

	//clock pattern
	sclk <: 0x55555555;
	sclk <: 0x55555555;
	// wait until clocked output operation is finalized.
	sync(sclk);
}
06
May

CMOS Op-Amp Design

Here’s a two-stage op-amp I designed for an undergraduate class. Fun times.

Spec Vcm = -0.1V Vcm = 0V Vcm = 0.1V
Open Loop DC Gain > 5000 V/V 5130 V/V 5074 V/V 4996 V/V
Unity Loop Gain Freq. > 10 MHz 10.89MHz 11.0MHz 11.07MHz
Loop Gain Phase Margin > 60° 60.48° 60.25° 60.09°
Input Offset Voltage < 3 mV 11.91uV -3.943uV -15.89uV
Slew Rate Positive > 10 V/us 56.24 V/us 59.34 V/us 56.11 V/us
Slew Rate Negative < -10 V/us -10.2 V/us -10.18 V/us -10.17 V/us
Output Swing Low -300mV -598mV -586mV -545mV
Output Swing High 300mV 497mV 557mV 554mV

 

Current 96.26 uA
Power 115.5 uW
Area 46.68 um^2
Compensation Cap 0.13 pF
Figure of Merit 1.427


11
Mar

Meh, HDL

I’ve given up on my high-speed ADC interface project because I’m unfamiliar with Verilog and don’t have the time to learn it well enough to do an actual real, complex design. Besides, to do anything useful, like interface with a computer via Ethernet or USB, requires a softcore CPU to handle the high-level protocol details that would be painful to implement in HDL. Then, I’d have to create some sort of bridge interface between the high speed ADC and the processor bus. Then, I’d have to do some embedded development for the processor, which is another toolchain to set up and figure out. That’s a pretty big PITA when all I really wanted to do was to try to produce a hobbyist board with a 780-pin BGA and put the signal integrity knowledge I have into practice.

I’d ask my classmates, who all seem to be pursuing digital, but we’re all pretty swamped with our own work. Besides, there probably isn’t a market for some development board with 8GB of ram connected to a cheap $50 – $200 FPGA anyway.

Lately I’ve been getting into analog IC design. Soon I’ll have to choose between pursuing a more academic path and spending an extra year to make time for research projects, or just graduating in four years and pursuing a career in general PCB-level system design. It seems like the latter is way more accessible and easier. However, it seems like there’s limited potential in that career path compared to doing IC design.

06
Jan

Fedex shipping rate table parser in PHP

This isn’t what I’d typically blog about here, but I figure this could save someone some time.

In my other life as a web application developer, I needed to implement a Fedex shipping rate calculator in PHP. Here is a script that parses Fedex’s shipping rate tables and outputs SQL insert queries. Of course, your database schema will vary but it should be simple enough to modify to your needs. I decided to just have it run on the webserver for convenience.

Running live: http://www.allanw.org/fedex/zoneprices.php
Hastily written source is: http://www.allanw.org/fedex/zoneprices.txt

Here are the FedEx Express service rate tables I used:

04
Jan

Slight disappointment

Unfortuntely, the low-end Xilinx Spartan-6 FPGA’s do not support interfacing to DIMMs:

Which means that for practical purposes, the memory storage size will be limited to 512MB (2x 2Gbit memory chips). To interface with DIMM’s, which contain 8 or 16 of these chips, you’d have to go to their Virtex line for which the cheapest is at least $200, too expensive for me.

But Altera’s low-end Cyclone FPGA’s do support DIMM’s. Vendor switching time! Probably should have done some more research before plopping down money for the Digilent Atyls board, but it’s pretty feature packed and could be handy to have around for the future anyway.

30
Nov

Digilent Atlys FPGA board

For those of you coming from Google, much better resources are provided by this guy for the Digilent Atlys. I did not go ahead with my FPGA project.

Just got Digilent’s Atlys board. It’s incredibly cheap for students at $200, discounted from the regular $350.

My plan is to develop a data acquisition system using DDR2 RAM. I’ve been interested in learning about signal integrity and high speed board designs, so I’m going to layout a board with this 900MHz analog bandwidth, 200Msample/s 11-bit dual ADC. Should be interesting. Eventually my plan is to layout my own FPGA board with DDR2 RAM stick slots, but that’s pretty complicated and I don’t have the experience/test equipment for that yet.

Here’s some pics of the Atlys since there don’t seem to be any floating around the internet yet.

Unfortunately it’s difficult to find a matching connector for this VHDCI receptacle they used on the board. It’s easy to get VHDCI receptacles but plugs are another matter. The ones they use for their own expansion boards have to be shipped from Taiwan with a $100 shipping charge, which is pretty ridiculous. I found one alternative, from Samtec:

http://samtec.com/ProductInformation/TechnicalSpecifications/Overview.aspx?series=VHDCP

However, these are edge-mount. The differential pairs go on opposite layers, so that there’ll be an imbalanced via change if you use microstrip routing. Oh well. Shouldn’t matter too much for relatively lower speed signals.

17
Nov

RGB stick daisy-chained

Two RGB sticks daisy chained together, total of 16″.

11
Nov

RGB stick boards

The RGB stick boards just came in. They’re gorgeous in black: