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

port A,F problem

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



Joined: 02 Feb 2010
Posts: 345

View user's profile Send private message

port A,F problem
PostPosted: Fri Apr 26, 2013 8:20 am     Reply with quote

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: 19326

View user's profile Send private message

PostPosted: Fri Apr 26, 2013 8:34 am     Reply with quote

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: 345

View user's profile Send private message

PostPosted: Fri Apr 26, 2013 9:28 am     Reply with quote

Thanks for fast reply! All is OK now. And sorry for my elementary mistake!

best wishes!
Ttelmah



Joined: 11 Mar 2010
Posts: 19326

View user's profile Send private message

PostPosted: Fri Apr 26, 2013 2:42 pm     Reply with quote

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. Smile

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
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