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

ADC CONFLICT

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



Joined: 21 Jun 2006
Posts: 1

View user's profile Send private message

ADC CONFLICT
PostPosted: Mon Aug 07, 2006 3:57 pm     Reply with quote

I am using a pic18f4550 to run a robot. The pic can succesfully communicate over RS232 to another pic, send USB data to a PC, and detect digital inputs on it's pins.

The pic is also required to read twelve analog signals, but whenever I include the function: setup_adc(ADC_CLOCK_INTERNAL); my program dies. I programmed an LED to flash, and it continues to do so; meaning the program is not stuck in a loop. My PC tells me that the USB device is malfunctioning, and the rs232 communication between the pics stops. If I call: setup_adc(ADC_OFF); these problems do not occur, but then I cannot use the adc port. I just don't understand how activating the ADC can interfere with USB and rs232.

Please help.
Ttelmah
Guest







PostPosted: Tue Aug 08, 2006 2:30 am     Reply with quote

How are you driving the USB?. Internal driver, or external transceiver?. If you are using the external transceiver, then you have a problem, since the pins for this are on portB, and ideally you will probably need to use the 'NOPBADEN' fuse to stop this being affected by the ADC, but will then only have nine ADC inputs available....
Generally, it is safer to perform the 'setup_adc_ports' call, before the 'setup_adc' call. Are you doing this?.

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