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
 

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
 

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
 

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:
**broken link removed**

Regards,
IanP
 

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
 

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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…