Possible PicBasic Pro ADC bug with 18F46k22


Results 1 to 3 of 3

Threaded View

  1. #1
    Join Date
    Feb 2012
    Posts
    64

    Exclamation Possible PicBasic Pro ADC bug with 18F46k22

    I am pretty sure I found a bug in PicBasic Pro when dealing with ADC on a pic18F46k22 device (Of course it could be something I am doing wrong). I stripped my program and wiring down to the very basics to verify the error I am seeing and it would be simple enough for any one of you gurus to verify. I have all 28 Analog pins pulled down to ground with a 10k resistor and I have two pins (RA6 & RA7) being used for serial communication to a terminal program to command the program and see the ADC results.
    The Error:
    Setup any analog pin greater than 15 (AN16, AN17, …) as a digital Output pin and set high, while the other Analog pins are set as Analog inputs, then loop from pins 0-15 reading them with the ADCIN command and they will read zero correctly every time.
    Now read any analog pin greater than 15 just once and it will mess up the lower pin ADC readings until the micro is reset. The Lower analog pins will show a high reading in a sequential order based on which pin is setup as a digital/output/high:
    If RC4 (AN16) is Digital/High then AN0 Reads high, If RC5 (AN17) is Digital/High then AN1 Reads high, If RC6 (AN18) is Digital/High then AN2 Reads high, and so on…
    It looks like a PicBasic error to me, but I would love for someone to prove me wrong (Providing you show me my error!).
    I attached a sample program.

    Thanks,
    Jim
    Attached Files Attached Files

Members who have read this thread : 1

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts