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

18F2520 pin B0 not responding???

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



Joined: 29 Dec 2007
Posts: 122
Location: Ireland

View user's profile Send private message

18F2520 pin B0 not responding???
PostPosted: Fri Nov 28, 2008 7:47 am     Reply with quote

Hello every body,

I've got a weird issue with the portB pin 0 of the 18F2520.
I cannot have a low level on this pin.

This pin is connected to a 4.7k pull-up and I've check for short.

the code is very simple:
Code:
void main()
{
   setup_adc_ports(NO_ANALOGS|VSS_VDD);
   setup_adc(ADC_OFF|ADC_TAD_MUL_0);
   setup_spi(SPI_SS_DISABLED);
   setup_wdt(WDT_OFF);
   setup_timer_0(RTCC_INTERNAL);
   setup_timer_1(T1_DISABLED);
   setup_timer_2(T2_DISABLED,0,1);
   setup_comparator(NC_NC_NC_NC);
   setup_vref(FALSE);
//Setup_Oscillator parameter not selected from Intr Oscillator Config tab

   // TODO: USER CODE!!
   
   while(1)
   {
      #asm
         nop
         nop
      #endasm
      output_low(PIN_B0);
      #asm
         nop
         nop
      #endasm
   }
}


Registers after execution (debugging with ICD-U40):
TRISB = 0xFE,
LATB = 0xFE,
PORTB = 0x1F ???

Why does the PORTB register keep b0 set?

Is there a special function for this pin that I haven't seen in the datasheet?

Thanks for any help.
Franck.

PCD 4.083.
Franck26



Joined: 29 Dec 2007
Posts: 122
Location: Ireland

View user's profile Send private message

PostPosted: Fri Nov 28, 2008 9:04 am     Reply with quote

Hi,

I think I found the problem: pin B0 dead on both 18F2520 that I was tested...

Stupid mistake Embarassed ,sorry about that.

Franck.
Wayne_



Joined: 10 Oct 2007
Posts: 681

View user's profile Send private message

PostPosted: Fri Nov 28, 2008 9:11 am     Reply with quote

Sure your not using #use fast_io
As you have left out the #use statements from your listing we cannot tell.
Franck26



Joined: 29 Dec 2007
Posts: 122
Location: Ireland

View user's profile Send private message

PostPosted: Fri Nov 28, 2008 9:34 am     Reply with quote

I was not using the fast io, I checked the asm code to be sure.
I have changed the micro and it's working now.

Thanks,
Franck.
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