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

problem with PIC18F46K80

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



Joined: 29 Aug 2010
Posts: 14
Location: SPAIN

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

problem with PIC18F46K80
PostPosted: Fri Jun 22, 2012 12:03 pm     Reply with quote

I have written this code for test this micro, and all is Ok except for C0 and C1, this don't change. Thinking that was one broken micro I have change, but happen the same.
Somebody knows the reason?
Thanks for your help.
Code:

#include <18F46K80.h>
#fuses XT, NOWDT, PUT
#use delay (internal=8000000 )

void main(void)

    output_A(0x00);
    output_B(0x00);
    output_C(0x00);
    output_D(0x00);
   
    delay_ms(5000);
   
    while(1)
    {
      output_A(0xFF);
      output_C(0xFF);
      output_D(0xFF);
      output_B(0xFF);
      delay_ms(500);
      output_A(0x00);
      output_B(0x00);
      output_C(0x00);
      output_D(0x00);
     
      delay_ms(500);
    }
   
  }
jeremiah



Joined: 20 Jul 2010
Posts: 1353

View user's profile Send private message

PostPosted: Fri Jun 22, 2012 12:21 pm     Reply with quote

One of the first things you should ask yourself if you have a problem with only a few pins is "what is special about those pins?" If you take a look at the datasheet, you can see the pin diagram near the beginning and see all the functions associated with them. For RC0 and RC1, a common functionality is the secondary oscillator. Nine times out of 10, you need to set a fuse to turn those pins from SOSC pins to digital pins. See the bottom of page 56 of the data sheet to verify this for your particular PIC.

The next step is to figure out how CCS handles those fuses. If you use the "Valid Fuses" option from the IDE menu, you can see all the valid fuses for each chip. Select your chip and look for the ones concerning SOSC. I would guess it is something like SOSC_DIG based on other chips I have used. Add whatever fuse it is to your list.
amate



Joined: 29 Aug 2010
Posts: 14
Location: SPAIN

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

PIC18F46k80 problem solved
PostPosted: Sat Jun 23, 2012 8:46 am     Reply with quote

Was enough to include the fuse SOSC_DIG.
You are right, thanks a lot.
antonio mate
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