View previous topic :: View next topic |
Author |
Message |
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
There's something special with PORTC.1 in a PIC18F2455? |
Posted: Sat Jul 30, 2016 6:49 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
dyeatman
Joined: 06 Sep 2003 Posts: 1924 Location: Norman, OK
|
|
Posted: Sat Jul 30, 2016 7:55 pm |
|
|
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!!!! |
|
![](templates/subSilver/images/spacer.gif) |
temtronic
Joined: 01 Jul 2010 Posts: 9174 Location: Greensville,Ontario
|
|
Posted: Sat Jul 30, 2016 8:01 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
|
Posted: Sat Jul 30, 2016 10:11 pm |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
Ttelmah
Joined: 11 Mar 2010 Posts: 19368
|
|
Posted: Sun Jul 31, 2016 3:57 am |
|
|
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. |
|
![](templates/subSilver/images/spacer.gif) |
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
|
Posted: Sun Jul 31, 2016 8:12 am |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
E_Blue
Joined: 13 Apr 2011 Posts: 417
|
|
Posted: Mon Aug 01, 2016 6:27 am |
|
|
I change the PIC and now is working as expected. ![Very Happy](images/smiles/icon_biggrin.gif) _________________ Electric Blue |
|
![](templates/subSilver/images/spacer.gif) |
|