|
|
View previous topic :: View next topic |
Author |
Message |
kramerr
Joined: 21 Jun 2006 Posts: 1
|
ADC CONFLICT |
Posted: Mon Aug 07, 2006 3:57 pm |
|
|
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
|
|
Posted: Tue Aug 08, 2006 2:30 am |
|
|
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 |
|
|
|
|
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
|