Hi,
I am using AT89S52 MCU as a target device. The idea here is to access (Read/Write) internal registers of an peripheral IC DS21554 from Dallas. I will be accessing this registers as external RAM memory locations.
Now, i checked whether the pins RD(P3.7) & WR(P3.6) are asserted (goes low) automatically using Logic Analyzer while executing the following code:
volatile unsigned char xdata ptr _at_ 0x4000; void main(void) { unsigned char charVal; ptr = 0x55; // Write. charVal = ptr; // Read. }
But, it didn't happen the way expected.
Since, in this code a we are trying to read and write to external data memory location, ideally RD(P3.7) and WR(P3.6) should go low. So, is there anything wrong with the code i am using and if it is then please suggest the right way to do so.
The first thing that's wrong with it is that you didn't read the instructions for posting source code on this forum.
Look at this picture: www.danlhenry.com/.../keil_code.png - it shows you that the instructions are very simple, and clearly stated.
If you can miss simple, clearly stated instructions here, then there must be a high likelihood that you have also missed something in the AT89S52 Datasheet - so you need to go back and study the Datasheet carefully.
Pay particular attention to how the chip decides whether to access its on-chip XDATA space, or off-chip...
Also check the Atmel site for other supporting information - application notes, examples, etc, ...