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

There's something special with PORTC.1 in a PIC18F2455?

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



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

There's something special with PORTC.1 in a PIC18F2455?
PostPosted: Sat Jul 30, 2016 6:49 pm     Reply with quote

I'm trying to read that pin but always get 0 (zero).

I already set TRISC = 0x03

I can read PORTC.0 but not PORTC.1

Is not the program, is not the compiler because I already check the ASM generated and is ok, also make a step by step with that pin with a 3.9K ohm to VDD and check the value in the MPLAB IDE Watch window and bit 1 of PORTC refuse to go to 1.

Timer 1 is off, also CCP2, also USB.

Can the pin be broken or do I forgot something?
_________________
Electric Blue
dyeatman



Joined: 06 Sep 2003
Posts: 1924
Location: Norman, OK

View user's profile Send private message

PostPosted: Sat Jul 30, 2016 7:55 pm     Reply with quote

You might look at the fuses listing at the bottom of the LST file to see if something shows there....
_________________
Google and Forum Search are some of your best tools!!!!
temtronic



Joined: 01 Jul 2010
Posts: 9174
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Jul 30, 2016 8:01 pm     Reply with quote

If it's always 0, remove the PIC from socket and check that the PCB trace is going high when it should. Also 'ring out' the pin C.1 and be sure its not grounded..'somewhere'.

This is one reason I like using DIP packages and DIP sockets, far easier to troubleshoot nasties like ground, side by side pin shorts, etc.

Jay
E_Blue



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

PostPosted: Sat Jul 30, 2016 10:11 pm     Reply with quote

It is a DIP package, I physically tested the voltage at the pin after pull up with a resistor and have 4.9V

The CONFIG bits have a bit that set RC1 or RB3 as CCP2 input or output but since the CCP2 is disabled I think should not matter if set or clear that bit.

I found another PIC18F2455, seems new, I'm going to try with that and see what happen.

Wish me luck.
_________________
Electric Blue
Ttelmah



Joined: 11 Mar 2010
Posts: 19368

View user's profile Send private message

PostPosted: Sun Jul 31, 2016 3:57 am     Reply with quote

What compiler version?.
Show us the code that 'disables' the other peripherals on this pin.

Obvious thing would be that though the USB peripheral itself may be 'off', this still leaves the OE bit on this pin if the external transceiver mode is enabled. It should be off by default.
E_Blue



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

PostPosted: Sun Jul 31, 2016 8:12 am     Reply with quote

V5.048

I don't have a code that disables those peripherals, I just put a breakpoint and see the registers values in the Watch Window and all are ok.
_________________
Electric Blue
E_Blue



Joined: 13 Apr 2011
Posts: 417

View user's profile Send private message

PostPosted: Mon Aug 01, 2016 6:27 am     Reply with quote

I change the PIC and now is working as expected. Very Happy
_________________
Electric Blue
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