Base on previous article, there are 2 common types of non-volatile memory:-
SDRAM & SRAM.
SRAM stands for static random access memory. The internal circuit is base on flip-flop. It means it require a lot of transistor to represent a bit of memory.
SRAM advantage:-
- fast access time
- low static power, when there's no access to the memory, it wont drain much power
SRAM disadvantage:-
- expensive, because of many transistor it use, it use high silicon real-estate.
SDRAM stands for synchronous dynamic random access memory. It is most common type of non-volatile memory that you would find on most design. It is base on capacitor to represents a bit. Due to it capacitor base, it require some refreshing to keep the memory.
SDRAM advantage
- very cheap, (cost for 1 byte)
- a lot of R & D been done to improve it's speed comparable to SRAM
SDRAM disadvantge
- need complicated interface to access the memory. Normal I/O bus cannot access SDRAM directly. Usually there will be a SDRAM controller to access it and it require complex configurations.
- it require constant refreshing due to it's capacitive nature. this make the memory consume high power during static operations. The refereshing is usually been handle by the SDRAM controller.
Will SRAM become obsolete..?
If you look some of the embedded design, you sometimes could see design that have both SDRAM and SRAM. Usually for SRAM, it mention "battery backup SRAM". In application that require important data not to be lost, during power outage we to use SRAM backup by battery. This is possible due to it's low static power consumption.
Thursday, May 28, 2009
Tuesday, May 26, 2009
Memory

Memory is place where we store what we call 'data'. Memory divided into 2 main categories.
1) Volatile
2) Non-Volatile
Volatile Memory
Volatile memory basically define as memory that its contents loss if the power to the memory gone. Example of such memory is:-
- SRAM (Static Ram)
- SDRAM or DRAM (Dynamic Random Access Memory)
Non-Volatile Memory
Non-volatile memory basically defines as memory that it's contents will not erase even when the power is gone. Example such memory is:-
- PROM, EEPROM
- Flash
Why not use everything non-volatile?
It will be very good if we could use all the memory in our design as non-volatile. The main issue to do this is speed. Non-volatile memory work much slower than volatile especially during write operations.
Both of this memory also are access differently. All volatile memory can be access randomly. Random access means that any memory location can be read on one instructions. Unlike flash memory, it need to be access semi-sequential. To read a particular byte from the memory, you need to read the whole page of the flash. In flash memory, page is group of 512bytes or 256bytes.
Internal & External Memory
If you look at the datasheets of MCU, it will specify something like internal SRAM - xxx kB, internal program memory - xxx kB. This means that both type of memory is inside the MCU IC itself. But this doesn't mean that the amount of memory it have is limit by that. Sometimes you could have some of the memory internal and some external. The limit of memory space basically depend on how big the address bus is. 16bit address line can adress up to 64K and 32bit can goes up to 4GB.
Sunday, May 24, 2009
Inter IC communications
When design board for embedded applications, very seldom we are lucky that we only require to use one IC that able to meet our requirement. Most of the time, we need to use several IC and these IC need to communicate between one and another.How does it communicate ?
What we learn from data communications class, communications are either serial or parallel.
I'm not gonna explain how each types works, because you could also read it from wikipedia.
I basically will explain several standard that usually use in embedded design.
Serial
Serial are basically for low speed communications. Typical example is use when communicate with EEPROM IC, digital potential meter, low speed ADC & DAC, PLL, etc. Common standard for serial is
I²C
This is standard develop by philips and widely use in a lot of applications. It only require 2 wire for biderectional (half duplex) data transfer and can have communicatins of single master and multiple slave. Slave is addresable using 7bit, slave addrees. Typical speed is around 100kbits/sec and go also go up to 400kbits/sec. I've once develop a device that generate I²C signal to control a PLL IC inside a tv tuner. Inside Linux kernel already have the driver for I2C. You could go to http://www.i2cbus.com/ to look for the standard or wiki it for more detail explaination.
SPI, Serial Perihperal Interface
This standard is develop by motorola and widely use also like the I2C. The main advantage over I²C is it offer full duplex com,unications. But it use more wire, minimum 4 for duplex communications. It also master-slave communications but to add slave need to add extra CS (chip select line).
I2S & AC97
This standard is common use for audio applications (codec). It is use to transport PCM data between codec.
Parallel
Parallel communications are much faster than serial. Because it is parallel, it use more line for data transfer and take up more space on the PCB.
I/O bus
When we talk about I/O bus it can be both memory and normal I/O. For memory device like SDRAM, it communicate with the SDRAM controller which has it own spec. Other I/O device like the SRAM, UART, RTC usually communicate what is call I/O bus. I/O bus come into 2 variants:- Intel style or Motorola style. Both style can be interoperate by applying some simple logic. Most of my work, I use Intel style but I learn Motorola style using my study.
Many device can communicate sharing the same bus but the I/O address must be configured early during installation. If you look at "device manager" inside windows, go to COM1 or LPT1 properties, you will see their base address, such as 0x378. If you change the number, the device wont work because the address decoder inside the device already set to acknowledge that address. There's no spec on how big the address space or how big the data bus but usally either 8bit or 16bit.
PCI
PCI device was develop to replace ISA bus. As a replacement for ISA, it must be faster and solve the base address configurations issue. PCI bus communicate at 33Mhz clock minimum on 32bit/64bit address bus. The 33Mhz, 32bit can give data rate of 132Mbytes/sec. It has plug and play capability, meaning that the base address is assign at during the bootup of the sysem. Detail spec and implementation of the bus is widely available on the net.
What we learn from data communications class, communications are either serial or parallel.
I'm not gonna explain how each types works, because you could also read it from wikipedia.
I basically will explain several standard that usually use in embedded design.
Serial
Serial are basically for low speed communications. Typical example is use when communicate with EEPROM IC, digital potential meter, low speed ADC & DAC, PLL, etc. Common standard for serial is
I²C
This is standard develop by philips and widely use in a lot of applications. It only require 2 wire for biderectional (half duplex) data transfer and can have communicatins of single master and multiple slave. Slave is addresable using 7bit, slave addrees. Typical speed is around 100kbits/sec and go also go up to 400kbits/sec. I've once develop a device that generate I²C signal to control a PLL IC inside a tv tuner. Inside Linux kernel already have the driver for I2C. You could go to http://www.i2cbus.com/ to look for the standard or wiki it for more detail explaination.
SPI, Serial Perihperal Interface
This standard is develop by motorola and widely use also like the I2C. The main advantage over I²C is it offer full duplex com,unications. But it use more wire, minimum 4 for duplex communications. It also master-slave communications but to add slave need to add extra CS (chip select line).
I2S & AC97
This standard is common use for audio applications (codec). It is use to transport PCM data between codec.
Parallel
Parallel communications are much faster than serial. Because it is parallel, it use more line for data transfer and take up more space on the PCB.
I/O bus
When we talk about I/O bus it can be both memory and normal I/O. For memory device like SDRAM, it communicate with the SDRAM controller which has it own spec. Other I/O device like the SRAM, UART, RTC usually communicate what is call I/O bus. I/O bus come into 2 variants:- Intel style or Motorola style. Both style can be interoperate by applying some simple logic. Most of my work, I use Intel style but I learn Motorola style using my study.
Many device can communicate sharing the same bus but the I/O address must be configured early during installation. If you look at "device manager" inside windows, go to COM1 or LPT1 properties, you will see their base address, such as 0x378. If you change the number, the device wont work because the address decoder inside the device already set to acknowledge that address. There's no spec on how big the address space or how big the data bus but usally either 8bit or 16bit.
PCI
PCI device was develop to replace ISA bus. As a replacement for ISA, it must be faster and solve the base address configurations issue. PCI bus communicate at 33Mhz clock minimum on 32bit/64bit address bus. The 33Mhz, 32bit can give data rate of 132Mbytes/sec. It has plug and play capability, meaning that the base address is assign at during the bootup of the sysem. Detail spec and implementation of the bus is widely available on the net.
Wednesday, May 20, 2009
Open source design
I believe we all now quite familiar what open source means. It's been quite a while in the IT industry. Lately there's also been a lot of open source embedded system design. Old design of router or other stuff is release to the web. We can have the complete design document like schematics, PCB drawing, BOM list, firmware, etc.
I wont discuss on which is better between proprietary and open source. They already plenty article about it already.
What is good about open source design?
The good things for sure is, it accelerate the learning process. For people that try to learn about embedded system design, they have source of reference. You could try step by step to develop board and make it work. Along the process you will learn a lot of things. Below is example of few open source design in embedded applications:
Lego Mindstorm
http://mindstorms.lego.com/Overview/NXTreme.aspx
Megasquirt (Open source fuel injection system)
http://www.megasquirt.org/megasquirt.html
Linksys WRT router series
http://openwrt.org
If you have the resource, you could develop the board base on it. Even you don't design it from scratch, to able to make it work is already a huge success.
I wont discuss on which is better between proprietary and open source. They already plenty article about it already.
What is good about open source design?
The good things for sure is, it accelerate the learning process. For people that try to learn about embedded system design, they have source of reference. You could try step by step to develop board and make it work. Along the process you will learn a lot of things. Below is example of few open source design in embedded applications:
Lego Mindstorm
http://mindstorms.lego.com/Overview/NXTreme.aspx
Megasquirt (Open source fuel injection system)
http://www.megasquirt.org/megasquirt.html
Linksys WRT router series
http://openwrt.org
If you have the resource, you could develop the board base on it. Even you don't design it from scratch, to able to make it work is already a huge success.
Friday, May 15, 2009
Reinventing the wheel?
Do you need to reinvent the wheel? In my opinion, yes you do. You just reinvent a better wheel. I heard from someone that, if you want to apply for a government technology grant, you must come out with a very solid proposal. Come out with something that people never did before. On top of that, the stuff you want to develop must have commercialization value. If you go through the title name that manage to get the grant, you notice it look so bombastic. What happen to them now?
Being the first doesnt mean you will be the last to stay there. If you look at history, Microsoft Windows is not the first, you propabaly heard of Apple Lisa. Why would Microsoft create the same thing that flop 10 years ago. The answer is, Microsoft learn from their mistake and improve. This means that, being the first, make u a guniea pig and guniea pig usually die at the end of the experiment. Microsoft never really the first in everthing, your probaly know Excel rather than Lotus 123, Access than dBase, Word than Wordperfect, Wordstar. If you are a programmer, I bet you know Visual Studio than Borland. They are sucessful because they make a better software and clever business strategies. They reinvent a better wheel.
Another good example is China. China now start to dominate the telecomunications industry. More and more backend server in the world start to use their brand. Name like Huawei or ZTE is no longer uncommon to telecomunications engineer. They make same equipment done before by Cisco, Alcatel, Ericsson, Nokia, etc. They came late to the market, but still manage to overtake. They are example of what Warren Buffet said "value propositon". It basically means, to win the market; 1) You make a product that price the same but have more extra features than competitor. or 2) You make product same features like the competitor but cheaper.
Being the first doesnt mean you will be the last to stay there. If you look at history, Microsoft Windows is not the first, you propabaly heard of Apple Lisa. Why would Microsoft create the same thing that flop 10 years ago. The answer is, Microsoft learn from their mistake and improve. This means that, being the first, make u a guniea pig and guniea pig usually die at the end of the experiment. Microsoft never really the first in everthing, your probaly know Excel rather than Lotus 123, Access than dBase, Word than Wordperfect, Wordstar. If you are a programmer, I bet you know Visual Studio than Borland. They are sucessful because they make a better software and clever business strategies. They reinvent a better wheel.
Another good example is China. China now start to dominate the telecomunications industry. More and more backend server in the world start to use their brand. Name like Huawei or ZTE is no longer uncommon to telecomunications engineer. They make same equipment done before by Cisco, Alcatel, Ericsson, Nokia, etc. They came late to the market, but still manage to overtake. They are example of what Warren Buffet said "value propositon". It basically means, to win the market; 1) You make a product that price the same but have more extra features than competitor. or 2) You make product same features like the competitor but cheaper.
Friday, September 5, 2008
SPICE simulations for board level design
What trigger me to write this article is base on a question raise by one of trainee engineer in my present company. While I was drawing some schematics file, he asked me did i use SPICE simulations to get the correct circuits or put the correct value. I answer "no". Then he ask back, how do u know it's correct?.
When you do board level design, many sub-block is basically a recycle of sub-block that u had known before or that u already understand. If u understand very well during electronics course at university, u will know how transistor switch circuit is, class A amplifier, class AB amplifier, low pass filter, high pass filter, etc. This is the sub-block that when connected, it makes a circuits that target your applications. You should have a good sense on the how big the value of resistor should be, the kind of transistor u need to put and u actually can do the calculations by hand.The important things is, you must understand the qualitative analysis first. SPICE just help you to get a very very accurate quantitative analysis.
Another reason for not using SPICE is that, board level design consist of using a lot of ICs. The fact is, no IC manufacturer would give u SPICE models for their IC. You can get SPICE models for transistor, diodes, resistors and other passive elements, but u wont get for the ICs. Imagine design consist of using PIC16F84A MCU, I don't think Microchip release the SPICE models for it.
How do u get the correct circuits? For board level design, you always make prototype first. You get the prototype PCB, solder the componets, load the firmware and you power up the board.From the design, u know that it should behave this way, and the voltage or current value at those point should give this and that value. If it doesn't, you desolder some components, solder other components with different value, repeat this few times until you get what you want. Basically that's how it been done.
What is the purpose of SPICE? SPICE is certainly being use in IC design. I had experience working for fabless IC design company to understand this. The reason is, IC prototype is very very much expensive compare to PCB prototype. The IC designer try to get as accurate as possible the design. If the IC wont work, you cannot desolder or cut some wire to make it work. Basically, it just means that the prototype fails. The way IC being design also, make it possible to use SPICE. Inside the IC, it consist a lot of transistors,diodes,resistor connected together. You don't have another IC inside an IC.
What I try to point to is that, you must have very strong understandings of circuit theory and operations. Stuff like kirchoff voltage law, current law, transistor operations,etc should be well understood. In other way to see it is, you should able to run SPICE simulations inside your head before you could actually use the SPICE programs effectively.
When you do board level design, many sub-block is basically a recycle of sub-block that u had known before or that u already understand. If u understand very well during electronics course at university, u will know how transistor switch circuit is, class A amplifier, class AB amplifier, low pass filter, high pass filter, etc. This is the sub-block that when connected, it makes a circuits that target your applications. You should have a good sense on the how big the value of resistor should be, the kind of transistor u need to put and u actually can do the calculations by hand.The important things is, you must understand the qualitative analysis first. SPICE just help you to get a very very accurate quantitative analysis.
Another reason for not using SPICE is that, board level design consist of using a lot of ICs. The fact is, no IC manufacturer would give u SPICE models for their IC. You can get SPICE models for transistor, diodes, resistors and other passive elements, but u wont get for the ICs. Imagine design consist of using PIC16F84A MCU, I don't think Microchip release the SPICE models for it.
How do u get the correct circuits? For board level design, you always make prototype first. You get the prototype PCB, solder the componets, load the firmware and you power up the board.From the design, u know that it should behave this way, and the voltage or current value at those point should give this and that value. If it doesn't, you desolder some components, solder other components with different value, repeat this few times until you get what you want. Basically that's how it been done.
What is the purpose of SPICE? SPICE is certainly being use in IC design. I had experience working for fabless IC design company to understand this. The reason is, IC prototype is very very much expensive compare to PCB prototype. The IC designer try to get as accurate as possible the design. If the IC wont work, you cannot desolder or cut some wire to make it work. Basically, it just means that the prototype fails. The way IC being design also, make it possible to use SPICE. Inside the IC, it consist a lot of transistors,diodes,resistor connected together. You don't have another IC inside an IC.
What I try to point to is that, you must have very strong understandings of circuit theory and operations. Stuff like kirchoff voltage law, current law, transistor operations,etc should be well understood. In other way to see it is, you should able to run SPICE simulations inside your head before you could actually use the SPICE programs effectively.
Wednesday, September 3, 2008
First MCU Experience
My first experience doing work using MCU was when I work as engineer in one of Japannese multinational company in Malaysia. I was not involve in any embedded product development. I was a design engineer for department that produce TV tuner. The tuner that we use at that time, use Texas Instrument PLL IC for controlling the local oscillator. It is control using I2C protocol. The device that use to send I2C signal to the tuner came from Japan and we had to buy it quite expensive. No one at that time knew how to make our own.
Later, I met this one customer name Mr Vakku. He was embedded engineer developing firmware for LCD TV for one of the company in Shah Alam. I ask him how to get started using MCU because i know it could solve our I2C tuner problem. He asked me to buy one book title "Programming and Customizing PICmicro Microcontrollers" by Myke Predko. (You can get the book from Amazon.com).

The reason he recommend the book for beginner because the book come with a PCB and software to make the MCU programmer. With that, I went to "jalan pasar", quite famous place for electronics hobbyist in Malaysia to get their electronics components. Then, I assemble and solder the component and the programmer finally done.
The MCU I used is the Microchip PIC16F84A. It was chosen because a lot of example in the book was base on that and you could find huge resource on the net base on the IC. Then, when I got free times I slowly learn and develop the product using the IC. Finally I manage to develop a breadboard design for the I2C PLL controller.
Unfortunately, before I could show the design to my management, I resign from the company because I got better opportunities. Whatever it is, the knowledge that I gain from doing that stuff valuable to me until today.
Subscribe to:
Posts (Atom)