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.
In Mode1 if you want to send or receive a byte you can use only registers A and B. Register C is used to generate/receice control signals for data exchange with acknowlegment.. As inputsPC5=IBFA, PC4=STBA, PC3=INTA, PC2=STBB, PC1=IBFB, PC0=INTB)..As outputs: (PC7=OBFA, PC6...)
If you want to write a byte to RegA or RegB the CPU clears bit STB and the 8255 then sets bit IBF (busy). On the rising edge of the STB the 8255 sets INT A (or B), on the falling edge of the INT the CPU generates RD and on the rising edge of RD the IBF is cleared... I better include a small diagram which explains the way INTs are set..
Just remember (as inputs) RD and STB are set and cleared by CPU, IBF and INT are set and cleared by 8255; (as outputs) WR and ACK from CPU, OBF and INT from 8255..
I understand what you mean Ian, but the datasheet says that the INT is active for port A if you set to one INTE A and INTB is active if you set the INTE B por port b of course, i understand perfect how the PPI works and i make it work, but as i said before i dont know how can i make te INT active, for the PORTS!!. I mean how i should "program" the ppi to make it active, not how to make the hard.
It is not you who will set/clear the INTA,B pins. This will be done by 8255 after you follow the write or read byte sequence.
First you have to Command Register (address A0=1, A1=1) and select MODE 1 for both ports and select Port as Input or Output.
Next step will be to connect INTA and B trough NEGATION (most of CPUs accept interrupts as active LOW level or edge).
Select port A (A0 and A1 =0)
Say, you would like to read byte from PORTA. One of your I/Os from CPU has to be connected to STA, another one to IBF. Clear this bit: this will set STBA=0. The 8255 will respond by setting bit IBF=1. Set the STB bit back to 1, 8255 will set INTA=1 and within the Interrupt subroutine you will read byte from PORTA (MOV A, xxx, depending on the type of CPU that you intend to use)...it is like command-response..
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.