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

write into a register

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



Joined: 12 Jul 2007
Posts: 32

View user's profile Send private message

write into a register
PostPosted: Thu Jul 26, 2007 8:52 am     Reply with quote

Hi,
how can I write directly 0xff into RC4 of my PIC 18F2480 without using output_high(PIN_C4)?

Thanks!
kevcon



Joined: 21 Feb 2007
Posts: 142
Location: Michigan, USA

View user's profile Send private message

PostPosted: Thu Jul 26, 2007 9:23 am     Reply with quote

RC4 is only 1 bit wide so you can't write 0xFF to it.

You can assign a 0 or 1 to it.

Code:

#pragma byte LATC= getenv( "sfr:LATC" )
#pragma bit RC4= LATC.4

RC4 = 0;

RC4 = 1;




edit:
you could do this and get the same effect

Code:

#pragma use fast_io( C )

output_high( PIN_C4 );
output_low( PIN_C4 );
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