Continue to Site

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.

PCF8574 (I2C Send bit)

Status
Not open for further replies.

Help

Advanced Member level 2
Advanced Member level 2
Joined
Feb 15, 2005
Messages
617
Helped
7
Reputation
14
Reaction score
3
Trophy points
1,298
Activity points
7,065
i2c control latch

Hi,

Is it posible the I2C sending bit? Normally they sending in byte form. If the I2C only can sending byte form. So, when the PCF8574 read/write that time is doing the whole byte. Mean's if read(input) that time is read whole 8-bits or write(output) that time is write whole 8-bits.

Do you got any idea how to control the PCF8574 whthin the 8-bits can be read(input) and write(output)?

Thank You
 

The PCF8574 as an I2C device uses the I2C protocol to communicate with the Master ..
Trying to read (or write) from (to) it in any other way is pointless ..

Regards,
IanP
 

    Help

    Points: 2
    Helpful Answer Positive Rating
Hi,

Sorry. Not understand your point.

Thank You
 

To control or read the PCF8574 pins (I/Os) you MUST send and then read bytes in the precisely defined sequence ..
Sending one bit will do nothing and will be ignored by the PCF8574 ..

If you need something faster than I2C take a look at the 82C55 PIA; this device is connected to a microcontroller via the multiplexed address/data bus (Port 0 in 8051) and can be accessed reasonably fast ..
Some of it's pins (Port C) can be read/write directly - within one instruction ..

Regards,
IanP
 

    Help

    Points: 2
    Helpful Answer Positive Rating
Hi,

IanP said:
If you need something faster than I2C take a look at the 82C55 PIA; this device is connected to a microcontroller via the multiplexed address/data bus (Port 0 in 8051) and can be accessed reasonably fast ..
Some of it's pins (Port C) can be read/write directly - within one instruction.
PortC can be read/write. What you mean that?
So, i need to use 1 port which is Port0 from my uController to control the 82c55 data-bus.

Is it i only need to follow the below table to control the 82c55?
 

For simple READ operation this table shows how to address all three ports ..
Just remember that because 8255 is connected through 8051's PORT 0 you need 74373 address latch, as shown on the attached picture ..
CS can be permanently connected to 0V, and you need RD and WR control lines, too ..

So, to read PORT A you will be using something like this:

#asm
MOV R0, #00h ; address of pot A =00h, port B = 01h and port C = 02h
MOVX A, @R0
#endasm

Regards,
IanP
 

    Help

    Points: 2
    Helpful Answer Positive Rating
Hi,

How to control the A0 and A1 on 8255? How to connect to 74373?

Thank You
 

Take a look at the attached picture ..
8255 will be connected to 8051/74373 exactly in the same way as an external data memory, but you dont need to use PORT2 (P2.0 - P2.7) as you don't need adresses above 03h .. only A0 and A1 ..
In fact you will be using only the following addresses:
00h for PORT A
01h for PORT B
02h for PORT C
and
03h for the control register ..

Adresses A0 and A1 are generated automatically by the 8051 and latched in the 74373 by the ALE signal ..

Regards,
IanP
 

    Help

    Points: 2
    Helpful Answer Positive Rating
Hi,

Which's mean the A0 and A1 connect to 74373 Q0 and Q1? and the Q0 and Q1 is control by Enable pin, then the Enable is control by ALE signal from 8051, right?

Thank You.
 

Help said:
Hi,

Which's mean the A0 and A1 connect to 74373 Q0 and Q1? and the Q0 and Q1 is control by Enable pin, then the Enable is control by ALE signal from 8051, right?

Thank You.

Alsmost all what you said is true ..
The ALE signal latches (on the falling edge) whatever is on PORT0 during S5 (see picture below) and what is there are the addresses A0-A7 ..
As the Enable signal is permanently connected to 0V these A0-A7 signals imediately appear on the 74373 outputs ..

Regards,
IanP
 

    Help

    Points: 2
    Helpful Answer Positive Rating
IanP said:
The ALE signal latches (on the falling edge) whatever is on PORT0 during S5 (see picture below) and what is there are the addresses A0-A7 ..

Haha....the picture make me abit confuse...:D

At what situation make the ALE signal falling edge?

Thank You
 

The ALE signal is generated automatically inside the 8051 ..
During External Data Memory Read Cycle its rising edge is between P1 and P2 in S4 and its falling edge is between P1 and P2 in S5 ..
Use an oscilloscope and take a look at the ALE pin: this signal is always there ..

Regards,
IanP
 

    Help

    Points: 2
    Helpful Answer Positive Rating
Hi,

IanP said:
During External Data Memory Read Cycle its rising edge is between P1 and P2 in S4 and its falling edge is between P1 and P2 in S5 ..

So, in this situation what will happen on /RD while /RD=0 and /RD=1? Then what's the P0 and P1 will do?

Thank You.
 

Again, the /RD signal is generated automatically when the 8051 executes READ command, for example: MOVX A, @R0 ..
Anything what appears on PORT0 will be read, and because the R0 register is used as pointer - only 8-bit address cover - no other PORTS are affected ..

In conclusion, first the microcontroller puts 8-bit address on PORT0, then generates ALE - address is latched in the 74373 - then generates /RD and reads data from PORT0, in this case, 82C55 data bus ..

All these signals are generated automatically during execution of "READ MEMORY" commands (MOVX) ..

Regards,
IanP
 

    Help

    Points: 2
    Helpful Answer Positive Rating
Hi,

Thank for your good explanation. Now i know how the ALE, /RD and the P0 function already.

Code:
#asm 
MOV R0, #00h ; address of pot A =00h, port B = 01h and port C = 02h 
MOVX A, @R0 
#endasm

Is it possible we write in C command inorder to use asm?

Do you know got any IC to replace the 82C55 IC, do you got any idea? because very hard to get this IC in my area! :cry:

Thank You.
 

#asm
..
#endasm

The above sequence is C structure ..


If you have troubles with 82C55 maybe you can try 81C55 ..
The latter connects directly to 8051 (no address latch 74373 is required) and in addition has 256X8 built-in RAM ..

Regards,
IanP
 

    Help

    Points: 2
    Helpful Answer Positive Rating
IanP said:
#asm
..
#endasm
The above sequence is C structure ..

What you mean C structure?

I try and find that IC that you recommend.

Thanks
 

Hi,

82C55 and 81C55 need to order then i can get it. Abit troublesome :|

Do you know this type of IC function is available in this market?

IC function:
- 4bit Address
- x1 input (Logic Signal)
- x16 output (depend on input logic signal)
- Some kind of Multiplexer function but the output signal can be latching.

Thank You.
 

If you have problems with 82C55 and 81C55 maybe you can consider 74LS(HCT)373 ..
You can connect, say, 4 (each has 8 latches) of them to 8-bit port and latch outputs using one control input: LE (latch enable) .. see drawing below ..
So, for example, for 32 outputs you will use 8 data bits and 2 (or 4) control pins ..

Regards,
IanP
 

    Help

    Points: 2
    Helpful Answer Positive Rating
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top