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 CCS Technical Support

Need a sanity check

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



Joined: 21 Aug 2004
Posts: 8

View user's profile Send private message Send e-mail

Need a sanity check
PostPosted: Mon Jul 18, 2005 9:52 am     Reply with quote

Maybe I'm missing something. I'm using a PIC18F452. I'm trying to use bit E2 (which is also AN7 and CS for the PSP) as an input. The problem is, that it always drags down the 5 volt signal it's being fed to about .25 volts.

First I checked the board. Looked at all the traces, etc... and they're just fine. If I remove the PIC chip, the signal doesn't get dragged down. So it must be how I have the PIC intialized.

I set the ADC parameters so that bit is used as a digital IO line and used TRISE to make sure it was an input. No joy.

I disabled the PSP using setup_psp(DISABLED), the signal is still dragged down.

I used TRISE again to disable the PSP and set the IO directions. Still not working.

I tried using output_float to see if I could at least get it to go high impedance. You can guess it didn't work.

Doe E2 perform some function besides the PSP Chip Select and Analog input 7?

I suppose that the chip itself could be the problem. Of course, I won't have another one for a few days.

Any ideas?
asmallri



Joined: 12 Aug 2004
Posts: 1635
Location: Perth, Australia

View user's profile Send private message Send e-mail Visit poster's website

PostPosted: Mon Jul 18, 2005 10:02 am     Reply with quote

My guess is you have defined a register address incorrectly.

Here is a section of operational code using the PIC18F452 using PORTE (E2 used as an output)

Code:

#define   PE_DefData   0b00000111
#define   PE_DefTRIS   0b00000011   //; USB control
//      ; 2   Flush USB FIFO output
//      ; 1   USB_RDF USB Read ready flaginput
//      ; 0   USB_WRF USB Write ready flag input

   setup_adc_ports(NO_ANALOGS);
   setup_adc(ADC_OFF);
   setup_psp(PSP_DISABLED);
   setup_spi(FALSE);
   setup_wdt(WDT_OFF);

   // .. other unrelated stuff deleted

   // initialise port E
   output_e(PE_DefData);
   set_tris_e(PE_DefTRIS);

_________________
Regards, Andrew

http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!!
bfmitch



Joined: 21 Aug 2004
Posts: 8

View user's profile Send private message Send e-mail

It's the chip
PostPosted: Mon Jul 18, 2005 10:38 am     Reply with quote

My sample PIC18F4525 just arrived. I already had the fuses, etc... worked out just waiting for it to show up. I programmed the new chip, plugged it in and the problem was gone.

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