hi to all i am using at89c55wd the problem is when i tried to toggle the P3 all bit i.e. P3.0,1,2,3,4,6,7 changes its state expect P3.5 i used timer 0 as timer after 1 sec i invert the P3. position by P3=~P3 but P3.5 unchanged all other toggle between 0 and 1.P3.5 toggle properly on simulator but not at h/w side.
i tried it by changing the perticuler bit i.e. P3.5 but did not work please help me
Hello
This sounds like a very complicated problem.
The port is a quasi-directional one. When you do the compliment, the processor does a read-modify-write operation.
If the port pin is being held at a level by external hardware, then the read will produce a result that might not match what you wrote to the pin.
You say that it works in the simulator - This supports the theory.
One solution would be to have a 'read copy variable' of the port so that you compliment that and then write that value to the port:
char P3Copy; ... P3Copy = 0xFF; P3 = P3Copy; P3Copy = ~P3Copy; P3 = P3Copy;
Give it a try.
i tyied it
char P3Copy; ... P3Copy = P3;// change i made P3 = P3Copy;
P3Copy = ~P3Copy; P3 = P3Copy; but same result
Have you got access to a 'scope?
If you can, check the level of the port pin to see if the input is being forced high or low.
not on the scope but on multimeter it remains at mV i.e. at ground level i wrote a prog. only to assign 0xFF to P3 but level on P3.5 is low other at high. that means i am not able to pull the port3.5 to high level at any point
Sorry, I might misunderstand you ...
Are you saying that when you measure the voltage, at one end of the copper (CPU) you see one level and at the other end you see a different level?
If so, check the circuit and/or board for a missing link.
i can't get you. what you want say
"The port is a quasi-directional one"
That's "quasi-bidirectional"
"When you do the compliment.."
That's "complement"
Andy,
I compliment on your incisive precision.
that all fine but what about P3.5
P3.5
Sorry for the delay, but I am being very precise in my typing so that I don't introduce anything typos that might cause confusion.
Is the following what you're seeing?
| (wire) P3.5 |------------------------------- | ^ ^ | | 0V 5V
If it is, then I think you should check the conductor.
nice explanation but i am measuresing the voltage at the controller pin only so that may not be the problem. i cheacked the same thing on the different board but the same thing happenning
"i cheacked the same thing on the different board but the same thing happenning"
Is that another board to the same design, or a completely different board?
If it's another board to the same design, Could it be a design error - so that both boards have the same problem?
If the at89c55wd is in a socket, remove it and check for shorts to ground...
If the at89c55wd is in a socket yes its in socket i cheacked socket pin and controller pin continuty on multimeter and its fine.
"i cheacked socket pin and controller pin continuty on multimeter and its fine."
What you need to check is for shorts or whatever on the board that are keeping the pin pulled down!
BTW: the spelling is "checked"
i checked it with ground there no shorting nothing wrong with it the port is pullup by 10kohms.