Saturday, June 16, 2012

Micro-Controller part (1)




Intro:
Whenever we are talking about a micro controller we eventually talk about some lump of silicon inside a chip and of course programmable.
So, Micro controller is just a chip having having lots of logical gates which perform some arithmetic operation.Most of the micro controller actually execute some predefined assembly level operation  such as increment,move , copy , add etc.As an example most of the pic (vendor microchip) based micro controller execute only 30 instructions.
so, technically a micro controller can be define as a single chip having a processing unit (microprocessor), a define size of memory (that will depend on the device model) and a sort of peripheral interfaces (IO port,ADC,Serial etc).Firmware is the program that run inside a micro controller.

Depending on how to accesses the program memory hardware structure is defined by two possible architectures 
(1) Von Neumann, and 
(2) Harvard.
It will be describe later in the next blogs..


Elements of Micro Controller:

Fig: MicroController Structure


PORT:
When a device need to communicate out side the world, it need some structural interface through that it can communicate. Port is the physical interface through that it communicate with peripheral devices or outside of the world i.e with sensor.The communication can be done in bidirectional way means micro controller exchange some information as a passing out some information and taking in some information .(I/O ).So, 
these input output communication peripheral are called PORT which are use to receive some inputs from the outside world (port is configured for input )and manipulate data within inside the processing unit and give the output through PORT (port is configured for output )

REGISTER:

Fig: Register(D-FlipFlop)


Register is a digital electronic memory where 8bit (for 8 bit MCU)  data is saved.Data saved into register is volatile means whenever the microcontroller rebooted register will be cleared. Register is part of Central Processing Unit of the micro controller that means CPU has faster access to the register data.
Perhaps before any operation (before enter to the arithmetic logic unit ALU)
data are placed into register.

According to the functional definition registers are two types 
1. Register 
2.Special Function Register (SFR)

Register :
I always consider it is as an general type register because of it is a register (by definition) and its function is not defined. It eventually used to store some data and program may use those data for further processing according to the programmer. As an example PORTA register

SFR :
Unlike register , it also temporary save data but their functional behavior is defined by the manufacturer.Every bits of the SFR register has a defined function when ever it holds some bits (0 or 1 ) it will perform some function. It is a controller register.
As a example TRISA register is a SFR register associated to the PORTA register. But every bits of TRISA register means something special which is defined.For PIC based micro controller TRISA register can contain 0 or 1. 
but if TRISA contain 0 corresponding PORTA register bit will be configured as a OUTPUT pin and if it is 1 corresponding PORTA register bit will be configured as a INPUT pin

ROM :
ROM stand for read only memory which is a structured array of memory.The data which is written into the memory is not volatile.

the structure of the ROM is organised into three modules 
1) An array of memory with a fixed size 
2) A address decoder 
3) A buffer


The address decoder is use to decode the address of the memory block 
As an example we have 1024x8 block of memory array.So there are 1024 row and 8 column in the memory array. Memory array contain the memory cells i.e TTL Memory cell.The word size of the block memory that we are considering guess that it is 8 bit long. So, to address the column cells only 3 bit Colum address decoder is need to address the memory array.on the other hand to select 1024 bit of the row cells 10 bit row address decoder is sufficient. When the row and column decoder decode an address (i.e row 512, column 1 , row 512 colum 2 ) associated data which reside inside the memory is place into the buffer. Then the data is available to the data bus in the next clock cycle. 

ROM



The whole operation need some time to complete. This is know as a ROM speed.

according to it programming (data write inside the memory , the way we put data into the ROM memory cell)  ROM can defined as 
1. Mask Programmed ROM

The programming is done on manufacturer side according the customer demands. Once it is done it can not be modified.We known term is OTP ( one time programming.)

2.Programmable ROM 
The programming is done on customer side. It is like burn the memory cell to have value 0 / 1 but once it is done it can not be reprogrammed.

3.Erasable Programmable ROM
(nonvolatile read/write, re programmable )
The programming is done on customer. It can be reprogrammed. The programming is done by ultra violet ray or electrically (EEPROM , in-circuit electrical erasability ).

4.Flash 

re programmable memories are high density. it combines the low cost and high density features of an UV EPROM /EEPROM.It is called a flash memory because of its rapid erase and write times.
Most flash memory devices use a ‘bulk erase’ operation in which all the memory cells on the chip are erased simultaneously. Some flash memory devices offer a ‘sector erase’ mode in which specific sectors of the memory device can be erased at a time .

No comments:

Post a Comment