I have a circuit with an AT89S52 which is too complex to post, but what I did which does not seem to work is to create a case where P0.1 is an activate command pin which connects to the positive enable on the 74HC138, and Pins 2.0 through P2.2 are command selection pins. Each of those connect to pins 1, 2, and 3 of the same 74HC138. The outputs are connected to clock pins of various devices except that one pin is directly connected to an LED.
The odd thing is the LED lights up and turns off several times even though I never used the LED address. This makes me think the 8052 is converting the P0 and P2 lines to address lines, yet my program never requests code outside of the internal code space, nor does it request data from external memory. Also, I have vpp/EA of the microcontroller set to 5VDC. When I tested the same microcontroller on a test board in which P2 and P0 are connected to LED's through pull-up resistors, the output is correct, so I know my code is executing, but I feel somehow the 8052 cheats and converts P0 and P2 to address lines without my knowledge.
Is there a way I can prevent the 8052 (specifically AT89S52) from turning P0 and P2 to address lines, yet still have the ALE continue to pulse?
The odd thing is the LED lights up and turns off several times even though I never used the LED address. This makes me think the 8052 is converting the P0 and P2 lines to address lines, yet my program never requests code outside of the internal code space, nor does it request data from external memory. Also, I have vpp/EA of the microcontroller set to 5VDC. When I tested the same microcontroller on a test board in which P2 and P0 are connected to LED's through pull-up resistors, the output is correct, so I know my code is executing, but I feel somehow the 8052 cheats and converts P0 and P2 to address lines without my knowledge.
Is there a way I can prevent the 8052 (specifically AT89S52) from turning P0 and P2 to address lines, yet still have the ALE continue to pulse?