Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

how to program 8255 and 8254

Status
Not open for further replies.

staind

Newbie level 5
Joined
May 1, 2006
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,326
control 8255 program

how to program 8255 and 8254 .....how te addresses are generated
 

IanP

Advanced Member level 5
Joined
Oct 5, 2004
Messages
7,942
Helped
2,310
Reputation
4,622
Reaction score
531
Trophy points
1,393
Location
West Coast
Activity points
66,416
Which addresses are you talking about: A0 and A1?

They are generated by the system microcontroller and, in systems based on 8051 or 8085, for example, which use multiplexed address/data bus, they are latched in the address latch just before microcontroller attempts to read from or to write to the 8255 ..

Regards,
IanP
 

staind

Newbie level 5
Joined
May 1, 2006
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,326
ok listen if i have to use it in mode 0 with port a and b and inpts and ouputs repeectively i have to write a program for the command word then how ill be able to change the values of a0 and a1 weather to access port a or port b
can i have an example in assembly language
 

IanP

Advanced Member level 5
Joined
Oct 5, 2004
Messages
7,942
Helped
2,310
Reputation
4,622
Reaction score
531
Trophy points
1,393
Location
West Coast
Activity points
66,416
I don't know which microcontroller are you talking about but here is an example on how to control 8255 with 8051-derivative:
Code:
		MOV		DPTR, #0003h	; 03h - address of control register
		MOV		A, #10000001b	; Group A & B as outputs..C as required..
		MOVX		@DPTR, A

		MOV		DPTR, #0000h	; Address of port A
		MOV		A, #01h		; Only Bit0 is H..
		MOVX		@DPTR, A
		MOV		A, #11111110b
		INC		DPTR			; set PB as 11111110b..
		MOVX		@DPTR, A

A short description of the MOVX instruction you can find here:
https://www.8052.com/51movx.phtml

Regards,
IanP
 

staind

Newbie level 5
Joined
May 1, 2006
Messages
9
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,281
Activity points
1,326
what about 8254
if i use counter 1 of 8254 and base address is 300 . For counter 1 it will become 301
what will be the address control word ?how can i calculate it
 

IanP

Advanced Member level 5
Joined
Oct 5, 2004
Messages
7,942
Helped
2,310
Reputation
4,622
Reaction score
531
Trophy points
1,393
Location
West Coast
Activity points
66,416
As far as addressing is concern the 8254 timer is almost identical to the 8255 PIA .. see table below ..

If the base address is 300 then:
counter 0 = 300
counter 1 = 301
counter 2 = 302
Control register = 303

Regards,
IanP
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Top