CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to support@ccsinfo.com

BSF RA1 overwrites RA0

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
Guest
Guest







BSF RA1 overwrites RA0
PostPosted: Tue Apr 05, 2005 4:39 pm     Reply with quote

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

View user's profile Send private message

PostPosted: Tue Apr 05, 2005 5:37 pm     Reply with quote

What is your version of the compiler ?
Ttelmah
Guest







PostPosted: Wed Apr 06, 2005 9:52 am     Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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