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 CCS Technical Support

18F4580 CAN doubt

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



Joined: 12 Dec 2005
Posts: 50
Location: Curitiba - Brazil

View user's profile Send private message Send e-mail

18F4580 CAN doubt
PostPosted: Mon Dec 12, 2005 7:27 am     Reply with quote

We are using a PIC18F4580 to communicate via CAN interface, but when I include the "#zero_ram" statment at the top of my code (main.c), it gets locked at the "can-18F4580.c" file, whcih was included. If I do not include the "#zero ram" statment the code runs well. Why is it ?

void can_set_mode(CAN_OP_MODE mode) {
CANCON.reqop=mode;
while( (CANSTAT.opmode) != mode ); //<<<---- never ending loop
} // if #zero ram is included
// in my code

Why CANSTAT does no change its register according to the can_set_mode ?

Thanks in advance,
Pasini
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Mon Dec 12, 2005 12:48 pm     Reply with quote

Quote:
If I do not include the "#zero ram" statment the code runs well. Why is it ?

Sometimes people report problems with #zero_ram. See these threads:
http://www.ccsinfo.com/forum/viewtopic.php?t=21251
http://www.ccsinfo.com/forum/viewtopic.php?t=23286

What is your compiler version ?
pasini



Joined: 12 Dec 2005
Posts: 50
Location: Curitiba - Brazil

View user's profile Send private message Send e-mail

PostPosted: Tue Dec 13, 2005 1:00 pm     Reply with quote

I am using MPLAB 7.20 + CCS 3.23
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