modtronix.com

MicroX and Presto Range (8-Bit PIC board, mixed 3.3/5V) => Programming => Topic started by: Jason.Regnier on April 04, 2013, 10:05:26 AM

Title: Editing the Acquisition Time in the appcfg.c
Post by: Jason.Regnier on April 04, 2013, 10:05:26 AM
Hello all,

I would like to slow down the ADC Acquisition rate of my SBC65EC board in the c code. I found the settings i need to change in the appcfg.c file but not sure how to change it.

Code: [Select]
        0x2e, // xxxx x110 - Fosc/64 clock = 1.6us @ 40MHz
                 // xx10 1xxx - 12 Tad = 12 x 1.6 = 19.2uS conversion time
                 // 0xxx xxxx - Left justified

I know that I need to change bits 4-6 it doesn't make sense to me since I would like to change the Acquisition rate to 32uS and can't see how to fit 14 (32/1.6 = 14) into 3 bits. any help would be greatly appreciated. Thank you
Title: Re: Editing the Acquisition Time in the appcfg.c
Post by: Jason.Regnier on April 18, 2013, 09:57:42 AM
Any help would be greatly appreciated..
Title: Re: Editing the Acquisition Time in the appcfg.c
Post by: modtro2 on April 25, 2013, 03:00:02 PM
Hi, you can increase 12 Tad to the maximum value of 20 TAD. See PIC18F6627 datasheet for details. Try changing to:
Code: [Select]
        0x3e, // xxxx x110 - Fosc/64 clock = 1.6us @ 40MHz
                  // xx11 1xxx - 20 Tad = 20 x 1.6 = 32uS conversion time
                  // 0xxx xxxx - Left justified