|
|
View previous topic :: View next topic |
Author |
Message |
kmp84
Joined: 02 Feb 2010 Posts: 354
|
port A,F problem |
Posted: Fri Apr 26, 2013 8:20 am |
|
|
Hi all,
I have stange problem with my pic18F67j60 board.
https://www.olimex.com/Products/PIC/Proto/PIC-P67J60/resources/PIC-P67J60-REV-A-sch.gif
My CCS compiler is : ver. 4.104
Code: |
#include <18F67J60.h>
#use delay(clock=25000000)
#fuses NOWDT, NODEBUG, HS, NOFCMEN, PRIMARY, NOETHLED
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, errors)
void main(){
printf("Running TP->main ...");
port_b_pullups (TRUE);
for(;;)
{
printf("\n\rPort_A:%X;",input_A());
printf("Port_B:%X;",input_B());
printf("Port_C:%X;",input_C());
printf("Port_D:%X;",input_D());
printf("Port_E:%X;",input_E());
printf("Port_F:%X;",input_F());
printf("Port_G:%X;",input_G());
}
} |
Port A and Port F doesn't change printed port value when tied GND or Vdd (3v3).Other ports works correct. |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Fri Apr 26, 2013 8:34 am |
|
|
Classic 'read the data sheet'. Quote:
1) "RA5 and RA<3:0> are configured as
analog inputs on any Reset and are read
as ‘0’. RA4 is configured as a digital input."
2) "On device Resets, pins, RF<6:1>, are
configured as analog inputs and are read
as ‘0’."
So RA4 ought to work, the rest won't, till you turn off the analogs.
Best Wishes |
|
|
kmp84
Joined: 02 Feb 2010 Posts: 354
|
|
Posted: Fri Apr 26, 2013 9:28 am |
|
|
Thanks for fast reply! All is OK now. And sorry for my elementary mistake!
best wishes! |
|
|
Ttelmah
Joined: 11 Mar 2010 Posts: 19538
|
|
Posted: Fri Apr 26, 2013 2:42 pm |
|
|
One good 'positive' thing, was that you posted a clear description, and a short clear program. Makes it easier for us to give a short clear answer.
It is one of the basic rules on the PIC, that if a pin doesn't do what you expect, look at 1) analogs. 2) other peripherals on the pin.
We have all had to learn this one at some point....
Mark the thread as 'solved', and have fun.
Best Wishes |
|
|
|
|
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
|