Wednesday, 18 December 2013

DDR memory interfacing - Part 1

DDR memory short form for Dual Data Rate memory is a type of RAM. As we know, RAM is a volatile memory. There are several types of random access memories like SRAM, DRAM, SDRAM. DDR comes under SDRAM category. The main difference between other types of RAM and DDR is that data is transmitted on rising and falling edge of clock and hence it's name. There are several types of DDR namely DDR, DDR2, DDR3, LPDDR2, LPDDR3, DDR3L, DDR3U. We shall go into details of each types of memory later. We shall have a look into the differences also in later parts. For now, let us discuss some of the terminologies used in DDR and techniques used in DDR interfacing which helps to achieve throughput, bandwidth, power consumption, etc.


Memory interleaving:

DRAM is arranged as banks internally and each bank is selectable using a BANK ADDRESS signal. Each bank in turn is accessed as rows and columns. Option is that memory address can be assigned bank after another which is the normal way of doing. While accessing a memory bank, it takes time to respond and this effects the throughput of DDR. One way of increasing throughput is to assign addresses to banks in an alternate manner. This is nothing but addressing memory in a interleaved manner. For example, for a byte addressable memory, 0-7 address will be assigned to first bank, 8-15 to second bank and so on. This helps to increase throughput of RAM. But one question arises for a designer and he wants to where he should use this type of interleaving. Interleaving is used when there is a slow DRAM interfaced to core.

Channel count:

We generally see datasheets of processors mentioning support for single channel, dual channel. This means that it can support up to two independent DRAM parts. For example let us assume that a processor supports 64-bit DDR memory. In this case, dual channel means a 64-bit DDR can be connected to one channel and another 64-bit DDR to another channel. Or as per design needs user can use only one channel and connect 4 16-bit or 2 32-bit devices to one channel. This again depends on support from processor and for this you have to refer processor datasheet. But one may raise a question, why should i use 4 16-bit devices instead of 1 64-bit device? As cost wise also, it doesn't help. The main reason is that my throughput is much higher in the case of 4 devices compared to 1 device. It is almost x4 times. So, it is always the case of trade-off between speed and cost. Make your choice!!!

Monday, 9 December 2013

Validation Devices - Oscillioscope

One of the most important validation devices is Oscilloscope. Raging from graduate to hobbyist and technical guy everyone must have oscilloscope. Oscilloscopes basically are analog or digital type. The age old CRT based scopes mostly used in educational institutions are analog type. The modern scopes are all digital type. The main difference between analog and digital scope is that in a analog oscilloscope measured analog signal is directly applied against a time base where as digital oscilloscopes sample the signal and process before displaying them. An analog  and it has vertical, horizontal amplifier and other circuitry where as digital oscilloscope has sampling circuitry, signal processor and advanced displays with good resolutions. Before going further let us define what an oscilloscope is, in few words. A oscilloscope is nothing but a measuring instrument which gives a visual representation of electrical signal. This visual representation helps in debugging the circuit. An oscilloscope measures signal in a graph of voltage vs time.

Want to buy a oscilloscope from market for your debugging purposes? then you have to consider following criteria:

1. Bandwidth
2. Channel count
3. Sampling Rate
4. Memory Depth
5. Triggering capability
6. Probes and their types
7. Resolution of display screen
8. Connectivity of scope like USB, GPIB, serial port, Ethernet, Etc
9. Analysis of signals
10. Memory Depth
11. Pricing
12. Oscilloscope type
13. Accuracy of measurement
14. Vendor ratings
15. Test suits available

Let us assume you want to measure a 1 MHz signal with scope then you must a scope of 5 MHz min. band-width. the rule of thumb is that bandwidth of the scope must be 5 times of the signal to be measured. The reason for this is that the energy of signal is distributed among it's harmonics and it needs minimum of 5 harmonics for the signal to be reconstructed properly. 

Sampling rate is inverse of the signal to be measured. If we want to measure the 1ns signal over a scope the sampling rate of that scope must be minimum 1Msps.

Channel count defines the number of signals that can be captured in parallel. Based on your requirement choose the scope. Note that if you are using a scope at maximum sampling rate, the rate will be divided as per the number of channels used.

Memory depth measured in Kpts, Mpts defines the amount of storage capability of oscilloscope.

You might have seen x1, x10 marking on the probes. this represents the attenuation. If you take a signal of 1 volt and measure with x1 setting, then the attenuation is 0 and you see a exact representation of 1 volt an the screen. If you use the same scope with x10 setting, then you see 0.1 volt on the screen.

Before buying a scope check the support for communication interfaces like USB, GPIB, ETHERNET, serial ports. Pricing always as per the interfaces available.

Vendors like Agilent, Tektronix, Lecroy, Fluke, Instek are leaders in market and choose a vendor as per your choice. Check the support and servicing facilities of these vendors before making a decision.

Sometimes, you may need special test suites for signal integrity analysis of high speed interfaces like USB, PCIe, etc. These are additions to the scope and if miss them on a buy, you may may have to shell out additional amount later. Also, check out if the vendor is providing free add on boards or on discounted price which are used for these analysis purposes.

Saturday, 7 December 2013

Selecting a microcontroller

Ask a beginner in embedded systems, he might probably have worked on microcontroller for sure if not an any other. Microcontroller is like a heart for any low end embedded system. Yes, high end systems are for sure dominated by microprocessor or FPGA whether it be because of high performance of microprocessor/FPGA or any other factors. 

So, while choosing a microcontroller, it is always important to know the selection criteria. From the project point of view, we do get the requirements based on which selection is done. Microcontrollers are available from various vendors and selecting the best one among them is the toughest decision for a designer.Here are the list of factors based on which we will be selecting a microcontroller.
  • Flash memory size
  • RAM size
  • GPIO availability
  • Package of microcontroller
  • Board size occupied by microcontroller/pin count
  • 8/16/32-bit 
  • Frequency of operation (DMIPS, DMIPS/MHz)
  • Power consumption (sleep current, standby current, peripheral consumption)
  • If pin compatibility among controllers from same vendor
  • Pricing of microcontroller
  • Development environment (IDE) availability
  • Debugging tools
  • Design support from microcontroller vendor
  • Functions available (UART, SPI, I2C, ADC, PWM, etc)
  • Availability Safety functions like Internal temperature sensor, watchdog timer, etc
While selecting a microcontroller, we make a list of microcontrollers and compare the controllers with the above features. some give ratings based on the differences and some based on visual inspection of differences tend to make a decision.