Author Topic: Editing the Acquisition Time in the appcfg.c  (Read 2384 times)

Jason.Regnier

  • Newbie
  • *
  • Posts: 2
    • View Profile
Editing the Acquisition Time in the appcfg.c
« 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

Jason.Regnier

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Editing the Acquisition Time in the appcfg.c
« Reply #1 on: April 18, 2013, 09:57:42 AM »
Any help would be greatly appreciated..

modtro2

  • Administrator
  • Hero Member
  • *****
  • Posts: 564
    • View Profile
Re: Editing the Acquisition Time in the appcfg.c
« Reply #2 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