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

changing a port bit value in #asm

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



Joined: 19 Nov 2003
Posts: 45
Location: Oxford

View user's profile Send private message Visit poster's website

changing a port bit value in #asm
PostPosted: Fri Mar 05, 2004 5:50 am     Reply with quote

I am using 18F452

In my main C code I have the folllowing section in asm

Code:

void setup()
{
   #asm
      bsf PORTE, 2
      bsf SSPSTAT, SMP
      bsf SSPCON1, SSPM3
      bsf SSPCON1, SSPEN
      movlw   0x10
      movwf SSPADD
   #endasm
}


As i have never used this before I want to flick on a LED so I know that I have entered this section of code. The problem I get is that I get an error saying

Undefined identifier PORTE

what do I write instead as I am sure I have written this in asm code before

regards

dave Question
mpfj



Joined: 09 Sep 2003
Posts: 95
Location: UK

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Fri Mar 05, 2004 8:08 am     Reply with quote

The .h files do not inclide definitins for PORTx.

So you will have to include the following declaration ...

Code:
#define PORTE 0xF84

... which allows the compiler to know where to look.

You will probably have to do the same for the SSP stuff as well.

Mark
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