This is default featured slide 1 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 2 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 3 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 4 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

This is default featured slide 5 title

Go to Blogger edit html and find these sentences.Now replace these sentences with your own descriptions.This theme is Bloggerized by Lasantha Bandara - Premiumbloggertemplates.com.

Showing posts with label Parallel Port Interfacing. Show all posts
Showing posts with label Parallel Port Interfacing. Show all posts

Friday, 25 January 2013

Seven Segment Display with Parallel Port

Interfacing Seven Segment Display with Parallel Port

This is basicaly sort of assignment for you to write code for seven segment display. I am providing you circuit diagram and hint and you can try it. Its very easy and simple. 


  • Seven Segment Common Cathode Counter:
  • Common Cathode means all –ve terminals of LEDs are grounded & 1 for on, 0 for off.
  • Connect 8 LEDs to the data port of the parallel port as shown in the figure. 



  • 1st construct the table for 7-segment


Digits
Hex
0
3f
1
06
2
5b
3
4f
4
66
5
6d
6
7d
7
07
8
7f
9
6f
  • This is basically 7-segment counter & timer in which you can set/reset, and pause it.

Enjoy playing with parallel port. 


LED Chaser using Parallel Port

LED Chaser using Parallel Port

In this tutorial you will learn about connections to parallel port and Assembly Language Programming of microprocessor. 

  1. Connect 8 LEDs to the data port of the parallel port as shown in the figure. 
  2. Connect ground to pin # 25.
  3. Copy and paste the assembly program link it (in MASM) & create .exe file.
  4. This program is basically LED chaser in which LEDs blink from left to right when you press ‘r’ and from right to left when you press ‘l’. to off these LEDs just press ‘ 0’ and ‘Esc’ button to exit.

Assembly code for LED chaser: 

Dosseg
.model small
.stack 100h
.data
msg db 13,10,'Press r for right movement',13,10,'Press l for left movement',13,10, 'Press 0 to Off',13,10, 'Press Esc to exit','$'
.code
main proc
mov ax,@data
mov ds,ax
mov ah,09h
lea dx,msg
int 21h
set: mov al, 0ffh
mov dx, 378h
out dx,al
call delay
call delay
call delay
mov al,00h
out dx,al
call delay
call delay
call delay
mov al,10000000b
lop1:
push ax
push dx
mov ah,06h
mov dl,0ffh
int 21h
cmp al,27
je exit
cmp al,'0'
je off
cmp al,'r'
je loop2
pop dx
pop ax
ror al,1
ror al,1
out dx,al
call delay
call delay
jmp lop1
loop2:
mov dx,378h
mov al,01h
strt: out dx,al
call delay
call delay
rol al,1
rol al,1
push ax
push dx
mov ah,06h
mov dl,0ffh
int 21h
cmp al,27
je exit
cmp al,'0'
je off
cmp al,'l'
je set
pop dx
pop ax
jmp strt
off: mov al, 0h
mov dx, 378h
out dx, al
exit: mov ax, 4c00h
int 21h
main endp
delay proc
push ax
push dx
mov bx,00h
mov ah,2ch ;To Get System Time
int 21h
mov bh,dl ;Copy seconds into bh reg
getsec: mov ah,2ch
int 21h
cmp bh,dl
jne back ;Jump to back when get 1 sec.
jmp getsec
back: pop dx
pop ax
ret
delay endp
end main



Unserstanding Parallel Port Interfacing

Parallel Port Interfacing


A Parallel port is a type of socket which is use to interface various peripherals to your personal computer. It is commonly known as printer port.
PC Parallel port is 25 pin, D-shaped female connector in the back of computer. It is not necessary to every time you will use 25 pins, you can use 8 output pins (Data Lines) and single ground to achieve your task.

DB25 (Printer Port)

The DB25 (originally DE-25) connector is an analog 25-pin plug of D-subminiature connector family (D-Sub of Sub-D).
With the DB9 connector, the DB25 is mainly use for serial connections, allowing for the asynchronous transmission of data as provided by standard RS-232 (RS-232C).
it is also used for parallel port connections, and was originally used to connect printers, that is why it is known as "printer port" (LPT for short).
some time there is confusion so you should be very much clear that DB25 serial port in computer generally have male connectors, while parallel port connectors are DB25 female plugs.

Pins configuration (serial connection)

Pin number
Name
2
TXD - Transmit Data
3
RXD - Receive Data
4
RTS - Request To Send
5
CTS - Clear To Send
6
DSR - Data Set Ready
7
GND - Signal Ground
8
CD - Carrier Detect
20
DTR - Data Terminal Ready
22
RI - Ring Indicator

Pins configuration (parallel connection)

Pin number
Name
1
_STR - Strobe
2
D0 - Data bit 0
3
D1 - Data bit 1
4
D2 - Data bit 2
5
D3 - Data bit 3
6
D4 - Data bit 4
7
D5 - Data bit 5
8
D6 - Data bit 6
9
D7 - Data bit 7
10
ACK - Acknowledgement
11
Busy
12
Paper Out
13
Select
14
Auto feed
15
Error
16
Reset
17
Select Input
18
Ground
19
Ground
20
Ground
21
Ground
22
Ground
23
Ground
24
Ground
25
Ground

The Original IBM-PC's parallel port had a total of 12 digital outputs and 5 digital inputs accessed via 3 consecutive 8-bit ports in the processor's I/O space.

Pin out:

Pin description:

Because of security purpose you can not directly access parallel port in windows XP, vista etc. To access the port follow these steps.
  1. first go to the BIOS setting.
  2. then select advanced option.
  3. under this option select peripheral configuration
  4. then change the setting of parallel port as
    1. enable
    2. bi-directional
    3. IRQ-7

After doing these steps download the user port and follow the instructions. A window will open, when you will run userport.exe, asking the range.
To find this:
  1. right click on my computer icon
  2. select manage
  3. from device manager select ports(com &LPT)
  4. double click on printer port
  5. a window will open, choose the resources tab you will find



Fill this range in both the spaces and then click on add button. Then click on start button three times, a message will appear just click ok.
Now your port is ready for interfacing.