This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problem connecting a P89C51RC2BN to a memory mapped '374

I can't send data from a P89C51RC2BN to a 74374 using the memory mapped I/O tecnique. I have connected P0 to the input of the latch, and the _wr pin of the MCU to the LE of the '374.The output of the '374 is connected to a LED array to see the output.
To test the hardware i loaded the mcu with a non memory mapped version of a program that counts forever and sends the
output to P0 see below:

#include <sfr51.inc>
org 0
mov a,#0
setb P3.5
setb P3.6
Loop:
inc a
cpl P3.5 ; just to see a led blinking
acall Delay
mov P0,a
clr P3.6 ; _wr pin used this way to latch up 74374
nop ; give it a uS
setb P3.6 ; restore high level
ajmp Loop

This program works fine controlling _wr directly with setb, clr .
This proves to me that the hardware is OK
On the other hand this other version of the program doesn't work
see below:

#include <sfr51.inc>
org 0
mov a,#0
setb P3.5 ; same reason as above and this led blinks even in this prog.
mov dpl,#0 ; address not needed since the 74374
mov dph,#0 ; is simply connected to _wr ( no address resolution needed )
Loop:
inc a
cpl P3.5
acall Delay
movx @dptr,a ; a memory mapped write to the 74374
ajmp Loop

The address of dpth doesn't need to be specified since there is no logic network to enable the '374. I simply connected the _wr (MCU) to the le ('374). About the other pins of the MCU I connected the EA (31) to +5v and i left ale (30) and _psen (29) not connected. Could you find where's the bug ? Thank you

Francesco Fontana

0