Microcontrollers and SMD Electronics

lankavee

Member
Apr 24, 2009
41
2
0
Microcontrollers and its usage should be common knowledge in this 21st century. However, all books are written in English so average electronics guy in Sri Lanka finds it difficult to grasp the technology. If we think carefully, the majority of people who repairs and builds electronic systems are not graduates or diploma holders. They tend to be average do-it-yourselfer, learned most by poking. So it is very clear the knowledge of Microcontrollers, the next logical evolution of basic electronics, should be taken out of Universities and spread across the general public.

It is a shame that both education and supply of martial are both scares in local market, so this has much become a taught-subject even at university level, except Engineering faculties and few technical schools.

Simply put, 555 Timer IC became a huge hit, since of its versatility, so do 741 OP Amp. They were used in many different ways to achieve solutions for most common problems in circuit design while dropping component count onboard. In the same sense, a microcontroller can be used replacing many analog and logic components needed otherwise. PIC microcontrollers (by Microchip) has done the same revolution in 90ties where 555 revolutionized circuit design in 70ties. In another words, PIC made microcontroller based electronic design to reach the mass.

:yes: Open for questions and clarifications on the subject


If anybody wants PIC / ATMEL microcontrollers, SMD resistors and capacitors, I may help you out.


Kavee
 
Last edited:

lankavee

Member
Apr 24, 2009
41
2
0
PIC range of microcontrollers can be programmed using easy to use language like BASIC or C with minimal effort. However, learning assembly for PIC is not that hard, since most of the chips in this range only contains 32 instructions in total.
 

newborn

Member
Apr 29, 2009
1
0
0
I have problem about EPROMs, EPROM need special UV erasers and anyone know how can we build it / buy it from Sri Lanka ?


I'm looking several places but still I have bad luck :(.
 

lankavee

Member
Apr 24, 2009
41
2
0
If your EPROM is generic type, any general purpose UV eraser will do the trick. A decent unit can be bought from ebay under US$ 50.

If you wan to build one, then need to find a UV light first. Purple color UV tubes are available (pettah electrical shops), and you may try it first. I am sure these common UV tubes are not ideal, thus will take a lot longer exposure time to get the data erased.

You ideally need 254 nM wave for erasing EPROM data. Sunlight, floresent lights etc. have some amount of this, which can damage the data if exposed. But for a compleate erasure, you need lots of wave.

You can do it dirt cheep if you expose the UV window to sunlight, for a week or two. This is not a gurenteed method, but will work eventually.


newborn said:
I have problem about EPROMs, EPROM need special UV erasers and anyone know how can we build it / buy it from Sri Lanka ?


I'm looking several places but still I have bad luck :(.
 

lankavee

Member
Apr 24, 2009
41
2
0
I have fair bit of requests for a beginners guide, and will put together some information as time permits.

induru sanjeewa said:
wow,nice ko matath dena ganna ona,mula edala wishthara dannako,kawuru hari
 

lankavee

Member
Apr 24, 2009
41
2
0
Microcontroller is a self-contained system, which can process input signals, with the help of built-in memory, and the program code resides in non-volatile memory, and finally output processed signals. A Microcontroller is sometimes called a computer, since it contains input, output, ALU, peripheral, memory etc. built into a single silicone chip.

Well, how big is this, you may ask! Big as my home computer?

Microcontrollers come in different sizes and shapes, starting from few pins to many dozens. But an average microcontroller you may see can be no more than your small finger. If I put it in another way, you can easily miss identifying 555 timer IC and PIC12F675 Microcontroller, if the label is faded. Both has 8 pins, and looks almost the same outside. But inside, they are different beasts.



Humm, what is PIC and ATMEL, you would ask. They are brand names by chip manufactures. Microchip company produces its line of microcontrollers under the name PIC and dsPIC. ATMEL, company produces microcontrollers under the name of AVR, ATMEGA and ATINY, among others.



Following is a partial list of famous microcontrollers available at the moment.
  • 68HC11 (Motorolla inc)
  • 8051 (Intel Corp)
  • ARM (ARM limited)
  • AVR ( ATMEL)
  • Freescale CF (Freescale Semiconductor)
  • H8, SuperH (Hitachi Semiconductor)
  • MIPS (MIPS Computer Systems)
  • V850 (NEC)
  • PIC/dsPIC33 (Microchip)
  • PowerPC ISE (Apple–IBM–Motorola)
  • PSoC (Cypress Semiconductor,)
  • Rabbit 2000 (Rabbit Semiconductor)
  • TI MSP430 (Texas Instruments)
  • TLCS-870 (Toshiba)
  • eZ8, eZ80 (ZiLOG)
http://www.elakiri.com/forum/attachment.php?attachmentid=10692&stc=1&d=1243830479
http://www.elakiri.com/forum/attachment.php?attachmentid=10693&stc=1&d=1243830479
http://www.elakiri.com/forum/attachment.php?attachmentid=10694&stc=1&d=1243830479
http://www.elakiri.com/forum/attachment.php?attachmentid=10695&stc=1&d=1243830479

Continued…
 

Attachments

  • L_Intel-P8051AH (refl).jpg
    L_Intel-P8051AH (refl).jpg
    23.9 KB · Views: 189
  • z80-1.jpg
    z80-1.jpg
    24.9 KB · Views: 172
  • atmega8l_pl.jpg
    atmega8l_pl.jpg
    20.9 KB · Views: 173
  • PIC_microcontrollers.jpg
    PIC_microcontrollers.jpg
    22.3 KB · Views: 166
  • 555vs12f675.jpg
    555vs12f675.jpg
    10.8 KB · Views: 397
Last edited:

Thushara-SL

Member
Oct 30, 2008
566
10
0
i also need to know every thing about micro controllers, how to programe it .....etc...

and thanx for sharing your knowledge......
 

lankavee

Member
Apr 24, 2009
41
2
0
For Simplicity, I would use few microcontrollers produced by Microchip throughout the articles. However the information mostly would be generic thus you may readily apply the knowledge to other microcontrollers with a bit of trial and error.
The Microcontroller of my choice for the articles will be PIC16F84A (18 pin DIP). This is a very basic chip produced by Microchip, which is simple to program and use.

Most interestingly, this chip is available in Pettah electronic stores, but you should not go and ask for a PIC microcontroller (cuz they say haven’t heard), instead ask for 16F84A. Mostly you will pay for the pin count, rather than the chip. Later, I will try to locate a specific store and mention the name, if I happen to go there.

At the moment, you can download the spec sheet for PIC16F84A (http://ww1.microchip.com/downloads/en/DeviceDoc/35007b.pdf) . Don’t worry if you cannot figure out anything on the document at this point in time, but you will eventually read it like a pro. First few articles would not require you to have a chip in hand nor the literacy to read the spec sheet. But both will be helpful later.

Continued...
 

lankavee

Member
Apr 24, 2009
41
2
0
Microcontrollers can be classified into many categories, based on different criteria. You may already aware that a microcontroller can (and should) be programmed in order to make it for any use. In another words, you can write a program (basic, C or assembly language, details will follow later) and save it on the chip, where it will run your code as long as the power is applied, each time and every time.

You may already know how to write a program on your computer either basic, C, Java, pascal, PHP etc. With the computer, your program mostly dealing with inputs from keyboard and mouse, where as output goes to screen. Nowadays, TCP/IP communication is very common, and it is not surprising if you know how to program a computer to talk to another computer through Ethernet. Occasionally, some people get the chance to program the computer to deal with serial port, parallel ports, USB etc. communicating with outside world.

In any case, it is simple as you save the code in hard disk, and run the compiler or interpreter of your language to “run” it.

You will have to do the same in microcontroller; however you don’t necessarily have a keyboard, a mouse or a video display connected to it. So how can this be? Easy, you program the chip with an external device (will explain later), fix the chip in circuit, power it up, and you are in the game.

Continued...
 
Last edited:
  • Like
Reactions: Thushara-SL

lankavee

Member
Apr 24, 2009
41
2
0
Since now we know a microcontroller needs to have a program put inside to make it do something worthwhile, it is time to see how.

Humm, the above statement carries lot of questions, right?
  • Program – language, syntax and semantics, how many code lines etc.
  • Put inside – how to write the program, how to put it into the chip, how to run, how to debug
  • Do something worthwhile – how fast it runs, how external signals interrupt the code, how to take the inputs, how external interfaces driven (LEDs, LCDs, motors etc.)
Questions are good, which means you know that there is something to learn

Continued...
 
Last edited:

lankavee

Member
Apr 24, 2009
41
2
0
Have I missed something…

What is the difference between a microprocessor (found in my pc) and microcontrollers? You would ask.

Microprocessor is intend to process signals (Data) in large chunks at very high speeds, with the help of external sub-systems such as memory, storage etc. where as Microcontrollers are intended to drive something discreet all by itself.
Most intriguingly, I have told you microcontrollers contain input, output, memory, peripherals etc. but the physical foot print tends to be much smaller than a microprocessor found today.

Microprocessor does not have its own memory, storage for application code, peripherals etc. It depends on external system for these services. Thus a Microprocessor itself cannot be much of a use, if you don’t have other devices connected to it. The fact that microprocesors has to communicate with external systems to get routine services done (example temporary storage of a value on memory), requires wires (we call them system buses). This adds to the pin count, thus makes the packaging larger. Another fact is microprocessors runs very fast (couple of Gigahertz is common), and contains lot of registers (described later) internally for facilitating large amount of data processing. The actual chip inside may be very small, but heat produced with the high clock rates needs larger surface area to dissipate properly. All these facts make microprocessors larger.

On the other hand microcontrollers runs relatively slow (4-20MHz or little more) and have all the communication buses inside the silicone chip. Only the external input and output, power, reset and sometimes a clock reference is all exposed as pins from the package. Heat produces is very low, and natural ventilation would be more than enough to keep the chip cool. All these factors into the low profile packages.

If we take PIC12F675 microcontroller, this only has 8 pins, with two dedicated for power (ground and VCC). Remaining 6 pins can be used for input or output (configurable).

For a little surprise, I will paste the section from the datasheet, which outlined the chip features

Peripheral Features:
  • 6 I/O pins with individual direction control
  • High current sink/source for direct LED drive
  • Analog comparator module with:
    • One analog comparator
    • Programmable on-chip comparator voltagereference (CVREF) module
    • Programmable input multiplexing from device inputs
    • Comparator output is externally accessible
  • Analog-to-Digital Converter module (PIC12F675):
    • 10-bit resolution
    • Programmable 4-channel input
    • Voltage reference input
  • Timer0: 8-bit timer/counter with 8-bit programmable prescaler
  • Enhanced Timer1:
    • 16-bit timer/counter with prescaler
    • External Gate Input mode
    • Option to use OSC1 and OSC2 in LP mode
    • as Timer1 oscillator, if INTOSC mode selected
  • In-Circuit Serial ProgrammingTM (ICSPTM) via two pins
Even if you don’t figure out heads or tails, this is an impressive list of features as it sounds, right. An innocent looking chip has all these features packaged in to an 8 pin humble unit? Yes it is.

Don’t worry, you will learn all about these things quite easily.

Continued..
 

lankavee

Member
Apr 24, 2009
41
2
0
That is a fundamental problem you will have to deal with on your own. Hatred can take many things away from you, including knowledge. I have decided to start the journey with a humble PIC, not because I am paid by Microchip, but the fact that many projects and help is already out there for this range.

And the knowledge you gain from PIC, can be readily applicable to other products, so there should be some point to start.



sanzilla jackcat said:
but the problem is I hate the microchip company.

they're technology is high cost !
 

lankavee

Member
Apr 24, 2009
41
2
0
Just thought a clarification would be needed before moving forward....

My write-ups on this subject wont go into comparing different microcontrollers by different manufacturers, nor would imply one product superior/better than other. PIC range of chips by Microchip company was selected due to the fact that learning resources out there are plenty and can source it from Pettah for few hundred buks, if willing to waste some good few hours in the alley.

If somebody loves one brand, and hate another, I simply feel sorry for them, but not my slightest intention to make them feel bad.

One can choose to hate intel and love AMD, while hating windows and Bill Gates where love is with Linux and Linus Torvalds. Different mindes differnt choices. One will not win over the other, but all will suite for differnt occations differntly!