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

18F4550 PORT E0,E1

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



Joined: 11 Oct 2017
Posts: 141

View user's profile Send private message

18F4550 PORT E0,E1
PostPosted: Sun Jun 30, 2019 12:12 pm     Reply with quote

I do not know why E0 and E1 are not functioning properly as input.
E1 stopped reading and E0 blended with E1.
Can it be some peripheral set?
I'm starting the ports like this:
Code:
#use fast_io(a)
#use fast_io(b)
#use fast_io(c)
#use fast_io(d)
#use fast_io(e)

Code:
   setup_psp(PSP_DISABLED);
   SETUP_ADC( ADC_OFF );
   setup_adc_ports(NO_ANALOGS|VSS_VDD);
   setup_comparator(NC_NC_NC_NC);
   setup_spi(FALSE);
   SETUP_CCP1(CCP_OFF);
   SETUP_CCP2(CCP_OFF);


   port_b_pullups(true);
   set_tris_a(0b11111111);
   set_tris_b(0b11111111);   
   set_tris_c(0b11111111);
   set_tris_d(0b11111111);
   set_tris_e(0b11111111);

Code:
#fuses XTPLL,NOWDT,PROTECT,NOLVP,NODEBUG,USBDIV,PLL1,CPUDIV1,VREGEN,MCLR,CPB,CPD  //4MHZ,USB-48MHZ,CPU-48MHZ
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Jun 30, 2019 12:42 pm     Reply with quote

Post the code that reads the pins on PortE. Also post what external
circuits are connected to those pins.

Ideally, post a complete, but very short test program that shows the
problem. Don't post code fragments.
vtrx



Joined: 11 Oct 2017
Posts: 141

View user's profile Send private message

PostPosted: Tue Jul 02, 2019 3:14 pm     Reply with quote

Solved.
The trail linking the E0 pin was broken.
But why E0 without 5v, would disrupt E1?
temtronic



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

View user's profile Send private message

PostPosted: Tue Jul 02, 2019 4:17 pm     Reply with quote

without seeing a schematic it's hard to tell however according to ..
set_tris_e(0b11111111);
... you've enabled the weak pullups on PortE.

Jay
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