Showing posts with label Electronics. Show all posts
Showing posts with label Electronics. Show all posts

Monday, November 30, 2009

Assembly Language

Assembly is one of programming languages. It's the closest form of machine's language. When we learn about C programming language, or Pascal, we still use the language that uses human language, especially English. The instructions are, if-then-else, while-do, for-to-do, etc. In Assembly, we don't use it anymore(maybe a little, but the syntax is completely different). We can see clearly how the machine works in this language, like moving memory, decreasing or increasing accumulator, using registers, I/O ports, etc.

I use Pinnacle to compile and simulate the program.
The Pinnacle software can be downloaded in :
here
The 8051 Assembly Language Manual can be downloaded in :
here

Common instructions in Assembly :
DJNZ(Decrease and Jump if Not Zero)
CJNE(Compare and Jump if Not Equal)
SJMP(Short Jump)
MOV
RL,RR(Shift Left, Shift Right)

This is an example :
ORG 0H

START:
MOV A,#0FEH
MOV R3,#008H
CALL LAGI
MOV R3,#004H
CALL SAPI
MOV R3,#004H
CALL KUDA
CALL WOW
SJMP START

LAGI:
MOV P1,A
CALL DELAY
RL A
DJNZ R3,LAGI
RET

SAPI:
CALL DELAY
MOV P1,#0FFH
CALL DELAY
MOV P1,#000H
DJNZ R3,SAPI
RET

KUDA:
CALL DELAY
MOV A,#11110000B
MOV P1,A
CALL DELAY
MOV A,#00001111B
MOV P1,A
DJNZ R3,KUDA
RET

WOW:
CALL DELAY
MOV P1,#01111110B
CALL DELAY
MOV P1,#10111101B
CALL DELAY
MOV P1,#11011011B
CALL DELAY
MOV P1,#11100111B
CALL DELAY
MOV P1,#11011011B
CALL DELAY
MOV P1,#10111101B
CALL DELAY
MOV P1,#01111110B
RET

DELAY:
MOV R0,#05H
ULANG:
MOV R1,#0FEH
ULANG1:
MOV R2,#000H
DJNZ R2,$
DJNZ R1,ULANG1
DJNZ R0,ULANG
RET
end


Just copy this program and save into *.asm and compile in Pinnacle. Simulate this using "play" button and view the ports from menu bar.

This program can be downloaded into a MCS-51 chip, using a downloader circuit. This is the result of the program above.



This is the schematic of the circuit :



If you have any questions, feel free to ask.

Friday, November 13, 2009

H-bridge for motor DC with engine break

List of components :
- 5V DC power supply
- jumper
- 1 IC 74LS08(2 input AND)
- 1 IC 74LS04(inverter)
- 4 transistor NPN(BD139)
- 1 green LED
- 1 red LED
- 2 220 Ohm resistor

Here's the schematics :



if the left direction is given logic 1, the lower LED will be turned on. If the right direction is given logic 1, the upper LED will be turned on. When both of them are given logic 1, the motor will stop and no LED will be turned on. When both of them are given logic 0, the motor won't stop immediately and still running(if previous state is 0 1 or 1 0) until the motor stopped.

Thursday, November 05, 2009

How to Use Seven Segment

Some of you might think that this is actually not important, because you can try this yourself. But, do you know how many volts do you need to light a LED? Do you know about the current limit that will light a LED without breaking it? Of course you can try this yourself, but some of people are just too lazy to do this. :P

Now, what are the limits? LED is a diode that emits light. The LED in seven segment is just a small LED, so it can’t take too much power from the source. A common LED in seven segment only needs approximately 3 V and a current limit of 20 mA. If you have a 5 V battery or 4.5 V battery, you should insert a resistor in the circuit to prevent a current overflow. Usually, the resistor is about 330 Ohm. The LED should be bright enough to be noticed.

How can you light the LEDs? You just need to set a battery and a 220 Ohm resistor with the LED. The positive side of the battery should meet the anode of the seven segment and the negative side of the battery should meet the cathode of the seven segment. If you are using common-cathode seven segments, there are 8 pins of anode that can be paralleled to light every segment of the seven segment. We will give you a simple circuit below.

Tuesday, November 03, 2009

Basic Digital Display : Seven Segment

Seven segment is a display component that have seven segments(actually eight). Each segment represented by a LED. Seven-segment displays are widely used in digital clocks, electronic meters, and other electronic devices for displaying numerical information. Beside seven segment, there are fourteen-segment and sixteen-segment, usually used for making an alphanumeric character.

The segments of a 7-segment display are referred to by the letters A to G, as shown to the right, where the optional DP decimal point (an "eighth segment") is used for the display of non-integer numbers.




The animation to the right cycles through the common glyphs of the ten decimal numerals and the six hexadecimal "letter digits" (A–F). It is an image sequence of a "LED" display, which is described technology-wise in the following section. Notice the variation between uppercase and lowercase letters for A–F; this is done to obtain a unique, unambiguous shape for each letter.


As shown to the right, a seven-segment has ten pins under the display. Based on the pins, seven segment can be divided into 2 kinds, common cathode and common anode. A common anode seven segment consists of 2 pins of anode and 8 pins of cathode. Each cathode pin lead to cathode part of each segment(LED) on the display. Both of anode pins are short-circuited, and lead to anode part of each segment(LED). A common cathode seven segment is the opposite of a common anode seven segment. There are 2 pins of cathode and 8 pins of anode.

The image on the right is the pins of the seven-segment. X is the common pin, if it is a common anode, then X is anode, and vice versa. The other pins are the complement of the common. For the common anode, to turn the LED on, we must place the plus sign of the battery on the common and the minus sign of the battery on other pins.

Monday, November 02, 2009

Electronic Symbol

An electronic symbol is a pictogram used to represent various electrical and electronic devices (such as wires, batteries, resistors, and transistors) in a drawing of an electrical or electronic circuit. These symbols can (because of remaining traditions) vary from country to country, but are today to a large extent internationally standardized. Some symbols (such as those of vacuum tubes) became virtually extinct with the development of new technologies.


Source : Wikipedia

Sunday, November 01, 2009

First of all : Soldering

We will teach you how to solder here :

Whatever it is you are soldering, you should 'tin' both contacts before you attempt to solder them. This coats or fills the wires or connector contacts with solder so you can easily melt them together.
To tin a wire, apply the tip of your iron to the wire for a second or two, then apply the solder to the wire. The solder should flow freely onto the wire and coat it (if it's stranded wire the solder should flow into it, and fill the wire). You may need to snip the end off afterwards, particularly if you have put a little too much solder on and it has formed a little ball at the end of the wire.

Be careful not to overheat the wire, as the insulation will start to melt. On cheaper cable the insulation can 'shrink back' if heated too much, and expose more copper core that you intended. You can cut the wire back after you have tinned it, but it's best simply not to over heat it.

The larger the copper core, the longer it will take to heat up enough to draw the solder in, so use a higher temperature soldering iron for larger cables if you can.
To tin a contact on an audio XLR connector, hold the iron on the outside of the the contact for a second or two, then apply the solder into the cavity of the contact. Once again, the solder should flow freely and fill the contact. Connectors such as jacks have contacts that are just holes in a flat part of the connector. To tin these you put your iron on it, and apply the solder to where the iron is touching. The solder should flow and cover the hole.
Once you have tinned both parts, you are ready to solder them together.

To solder them, you simply need to place your soldering iron onto the contact to melt the solder.
When the solder in the contact melts, slide the wire into the contact.
Remove the iron and hold the wire still while the solder solidifies again.
You will see the solder 'set' as it goes hard.
This should all take around 1-3 seconds.
  • A good solder joint will be smooth and shiny.
  • If the joint is dull and crinkly, the wire probably moved during soldering.
  • If you have taken too long it will have have solder spikes.
If it does not go so well, you may find the insulation has melted, or there is too much stripped wire showing. If this is the case, you should desolder the joint and start again.








Source : http://www.mediacollege.com/misc/solder/

Introduction

If you have browsed all the page in this blog, we only share what we know about hardware and software. So, we will give you something more interesting. Here, we are going to introduce you into a practical electronics. We add this page for those who want to make a simple electronic circuit, but never even touch a soldering tool. It’s ironic, isn’t it? We’ll give you a simple instructions or modules on how to make a simple electronic circuit. Of course we’ll teach you also how to solder, for it’s a basic to all practical electronics. Although there’s an easier method to make a better soldered circuit, we think it’s better for you to know the basics.