|
|
View previous topic :: View next topic |
Author |
Message |
Guest Guest
|
BSF RA1 overwrites RA0 |
Posted: Tue Apr 05, 2005 4:39 pm |
|
|
Hello all,
we tested this little code for the 12F675:
----------------------------------------
#if defined(__PCM__)
#include <12F675.h>
#include <12F675io.h>
#fuses INTRC_IO,NOWDT,NOMCLR,NOPROTECT,NOBROWNOUT,NOPUT
#endif
int1 oo;
void main()
{
r0io=0; //Port RA0 is Output (IO- Register)
r1io=0; //Port RA1 is Output (IO- Register)
while(1)
{
oo=~oo; //xor bit oo
ra0=oo;
ra1=oo;
}
}
-----------------------------------------
The behavior of the code after download the hex to Pic is as follow:
First, RA0 ist setting everything is fine.
But if the RA1 is setting the RA0 goes low with the rising Edge of RA1.
Whats the problem?
And why cant the Compile xor RA0 directly like this RA0=~RA0
Thank you all in advance and sorry for my bad english, im German
Frank |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Tue Apr 05, 2005 5:37 pm |
|
|
What is your version of the compiler ? |
|
|
Ttelmah Guest
|
|
Posted: Wed Apr 06, 2005 9:52 am |
|
|
It could be a classic 'read modify wite' problem. You say that RA0 goes high. How high?. To be 'seen' as high, RA0, needs to be at 0.25Vdd+0.8v. If there is significant capacitance, or a reasonable load on the pin, it may not be actually reaching this voltage. Then when you set RA1, the processor actually reads the port, and sets RA0 in this value, then writes the result back out to the port. If the pin is not high enough, it will be turned off at this point...
Best Wishes |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|