View Single Post
  #1   Spotlight this post!  
Unread 09-01-2004, 22:13
Larry Barello Larry Barello is offline
http://www.barello.net
#0492 (Titan Robotics Club)
Team Role: Mentor
 
Join Date: Jan 2002
Location: Bellevue, WA
Posts: 85
Larry Barello has a spectacular aura aboutLarry Barello has a spectacular aura about
ADC problems with C library and new code

Has anyone successfuly manipulated the ADC hardware directly? It appears that the C compiler function "SetChanADC()" doesn't work correctly. I have tried to set the channel manually but can't seem to get it to work correctly.

The PIC (and IFI) defines show the channel # shifted left three bits, but the 18F8520 data sheet shows them shifted only 2 bits. SetChanADC() doesn't shift the bits at all.

OpenADC() does the right thing with the channel, but I don't want the overhead...

Cheers!