Yesterday 21:46
Forum: Proton Plus Compiler v3
Starter: joesaliba
Views: 0
Replies: 9
Go to last post By: joesaliba
Yesterday 19:57
Forum: Proton Plus Compiler v3
Starter: johngb
Views: 0
Replies: 16
+ Reply to Thread
Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Junior Member petemilligan's Avatar
    Join Date
    Jun 2017
    Posts
    8
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    150.22 MB

    0 Not allowed!

    Default ADC with 18F24K40 - seem to be getting nowhere. Please help.

    I used to be Pete.Milligan on this forum BTW - Old email address registered, so can't reset the password. Doh.


    Hi, Been away since 2010, so much of this has been steep. I have a project to check the charge status of 24 individually charged SLA batteries via a current sense. Approx 0.0V to 0.7V. The 18F24K40 looks suitable enough, though I noticed that much of the ADCON's for more contemporary PICs have changed since. So starting afresh.

    I get zero in ADRESL & ADRESH. External voltage to PORTA.1 is 2.5v (Just for testing - will adjust ADFVR later, once this device stops acting like a teenager)

    ADSTAT returns 00000000

    I'm probably missing something really obvious.

    I've read the datasheet over and over. Can anyone here shed some light on what might be absent?

    Pete.

    Code:
    Device = 18F24K40
    Xtal = 64
    
    Config_Start
            FEXTOSC = OFF               ; Oscillator not enabled
            RSTOSC = HFINTOSC_64MHZ     ; with HFFRQ = 64 MHz and CDIV = 1:1
            CLKOUTEN = OFF              ; CLKOUT function is disabled
            FCMEN = OFF                 ; Fail-Safe Clock Monitor disabled
            MCLRE = EXTMCLR             ; If LVP = 0, MCLR pin is MCLR; If LVP = 1, RE3 pin function is MCLR
            PWRTE = On                  ; Power up timer enabled
            BOREN = OFF                 ; Brown-out Reset disabled
            Debug = off                 ; Background debugger disabled
            WDTE = OFF                  ; WDT Disabled
    Config_End
    
    Declare LCD_DTPin PORTC.0
    Declare LCD_RWPin PORTB.1
    Declare LCD_ENPin PORTB.2
    Declare LCD_RSPin PORTB.0
    Declare LCD_Interface 8
    Declare LCD_Lines 4
    Declare LCD_DataUs 100
    Declare LCD_CommandUs 40
    
    Declare Adin_Res = 10       ' 10-bit ADC result required
    Declare Adin_Tad = 128_fosc ' RC oscillator chosen for the ADC per page 427 at 2.0uS
    Declare Adin_Stime = 50     ' Allow 50us sample time
    
    Dim counterx As Byte
    
    TRISA=000011       ' Configure AN0 & AN1 (PortA.0, PortA.1) as an input
    TRISB=000000       ' configure pins of port B as output
    TRISC=000000       ' configure pins of port C as output
    
    '********************************************************************************
    'ADREF: ADC REFERENCE SELECTION REGISTER
    'bit 7-5 Unimplemented: Read as ‘0’
    'bit 4 ADNREF: ADC Negative Voltage Reference Selection bit
    '1 = VREF- is connected to external VREF-
    '0 = VREF- is connected to AVSS
    'bit 3-2 Unimplemented: Read as ‘0’
    'bit 1-0 ADPREF: ADC Positive Voltage Reference Selection bits
    '11 = VREF+ is connected to internal Fixed Voltage Reference (FVR) module
    '10 = VREF+ is connected to external VREF+
    '01 = Reserved
    '00 = VREF+ is connected to VDD
    
    ADREF=000000 '(ADNREF = AVSS & ADPREF = Internal fixed Reference)
    '********************************************************************************
    
    '********************************************************************************
    'FVRCON: FIXED VOLTAGE REFERENCE CONTROL REGISTER
    'bit 7 FVREN: Fixed Voltage Reference Enable bit
        '1 = Fixed Voltage Reference is enabled
        '0 = Fixed Voltage Reference is disabled
    'bit 6 FVRRDY: Fixed Voltage Reference Ready Flag bit(1)
        '1 = Fixed Voltage Reference output is ready for use
        '0 = Fixed Voltage Reference output is not ready or not enabled
    'bit 5 TSEN: Temperature Indicator Enable bit(3)
        '1 = Temperature Indicator is enabled
        '0 = Temperature Indicator is disabled
    'bit 4 TSRNG: Temperature Indicator Range Selection bit(3)
        '1 = VOUT = VDD - 4VT (High Range)
        '0 = VOUT = VDD - 2VT (Low Range)
    'bit 3-2 CDAFVR<1:0>: Comparator FVR Buffer Gain Selection bits
        '11 = Comparator FVR Buffer Gain is 4x, (4.096V)(2)
        '10 = Comparator FVR Buffer Gain is 2x, (2.048V)(2)
        '01 = Comparator FVR Buffer Gain is 1x, (1.024V)
        '00 = Comparator FVR Buffer is off
    'bit 1-0 ADFVR<1:0>: ADC FVR Buffer Gain Selection bit
        '11 = ADC FVR Buffer Gain is 4x, (4.096V)(2)
        '10 = ADC FVR Buffer Gain is 2x, (2.048V)(2)
        '01 = ADC FVR Buffer Gain is 1x, (1.024V)
        '00 = ADC FVR Buffer is off
    
    FVRCON=000011 '(Ref enabled, Temp low range, Comp off, ADC gain 1x = 1.024V )
    '********************************************************************************
    
    '********************************************************************************
    'ADCON0: ADC CONTROL REGISTER 0
    'bit 7 ADON: ADC Enable bit
        '1 = ADC is enabled
        '0 = ADC is disabled
    'bit 6 ADCONT: ADC Continuous Operation Enable bit
        '1 = ADGO is retriggered upon completion of each conversion trigger until ADTIF is set (if ADSOI is
        'set) or until ADGO is cleared (regardless of the value of ADSOI)
        '0 = ADC is cleared upon completion of each conversion trigger
    'bit 5 Unimplemented: Read as ‘0’
    'bit 4 ADCS: ADC Clock Selection bit
        '1 = Clock supplied from FRC dedicated oscillator
        '0 = Clock supplied by FOSC, divided according to ADCLK register
    'bit 3 Unimplemented: Read as ‘0’
    'bit 2 ADFM: ADC results Format/alignment Selection
        '1 = ADRES and ADPREV data are right-justified
        '0 = ADRES and ADPREV data are left-justified, zero-filled
    'bit 1 Unimplemented: Read as ‘0’
    'bit 0 ADGO: ADC Conversion Status bit
        '1 = ADC conversion cycle in progress. Setting this bit starts an ADC conversion cycle. The bit is
        'cleared by hardware as determined by the ADCONT bit
        '0 = ADC conversion completed/not in progress
    
    ADCON0.7=1 ' (ADC is enabled)
    ADCON0.6=0 ' (ADC is Cleared after each conversion)
    ADCON0.2=1 ' (Left justified output)
    
    '********************************************************************************
    
    
    
    '********************************************************************************
    
    'ADCON1: ADC CONTROL REGISTER 1
    
    'bit 7 ADDPOL: Precharge Polarity bit
    '    ADPPOL
    '    Action During 1st Precharge Stage
    '    External (selected analog I/O pin) Internal (AD sampling capacitor)
    '    1 Shorted To AVDD CHOLD shorted To VSS
    '    0 Shorted To VSS CHOLD shorted To AVDD
    '    If ADPRE>0x00:
    '    Otherwise:
    '    The bit is ignored
    'bit 6 ADIPEN: A/D Inverted Precharge Enable bit
    '    If ADDSEN = 1
    '    1 = The precharge and guard signals in the second conversion cycle are the opposite polarity of the
    '    first cycle
    '    0 = Both Conversion cycles use the precharge and guards specified by ADPPOL and ADGPOL
    '    Otherwise:
    '    The bit is ignored
    'bit 5 ADGPOL: Guard Ring Polarity Selection bit
    '    1 = ADC guard Ring outputs start as digital high during Precharge stage
    '    0 = ADC guard Ring outputs start as digital low during Precharge stage
    'bit 4-1 Unimplemented: Read as ‘0’
    'bit 0 ADDSEN: Double-sample enable bit
    '    1 = Two conversions are performed on each trigger. Data from the first conversion appears in
    '    ADPREV
    '    0 = One conversion is performed for each trigger
    ADCON1=100001
    '********************************************************************************
    
    '********************************************************************************
    'ADPCH<5:0>: ADC Positive Input Channel Selection bits
        '111111 = Fixed Voltage Reference (FVR)(2)
        '111110 = DAC1 output(1)
        '111101 = Temperature Indicator(3)
        '111100 = AVSS (Analog Ground)
        '111011 = Reserved. No channel connected.
        '000111 = ANA7
        '000110 = ANA6
        '000101 = ANA5
        '000100 = ANA4
        '000011 = ANA3
        '000010 = ANA2
        '000001 = ANA1
    ADPCH =00000001 ' (ANA1)
    '********************************************************************************
    
    
    
    Dim ADC_Result As Word ' Create a word variable to hold the ADC value
    
    
    Main:
    Clear
    Cls
    
    While 1 = 1
        Inc counterx                        'Just to keep an indication of aliveness
        Print At 1,1,"Running:           "
        Print At 1,1,"Running: ", Dec counterx
     
        DelayUS 10                   'wait a bit
        ADCON0.1 = 1                 'start the A/D by setting ADGO
        While ADCON0.1 = 1           'wait until it finishes
        Wend
        
        ADC_Result.LowByte = ADRESL      'put the result in the variable
        ADC_Result.HighByte = ADRESH
        
        Print At 2,1, Dec ADC_Result
        Print At 3,1, "FVRCON: ",Bin FVRCON
        Print At 4,1, "ADSTAT: ",Bin ADSTAT
        
    Wend
    Last edited by petemilligan; 13th November 2017 at 12:16.

  2. #2
    Prolific Poster See_Mos's Avatar
    Join Date
    Feb 2004
    Posts
    1,177
    Thumbs Up
    Received: 2
    Given: 0
    Total Downloaded
    435.78 MB

    0 Not allowed!

    Default Re: ADC with 18F24K40 - seem to be getting nowhere. Please help.

    Hi Pete, welcome back.

    The first thing I spotted is that you are setting TrisA to decimal 11 instead of binary %00000011 and there should be eight bits for each setting and not 6 as in your code
    My RAM is failing

  3. #3
    Developer Les's Avatar
    Join Date
    Feb 2002
    Posts
    3,232
    Thumbs Up
    Received: 229
    Given: 83
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Adin replacement for 18FXXK40 devices

    For some unknown, and very silly reason. They have changed the way most peripherals operate on the newer 18F devices. So I am currently creating new library routines for them for the next update, but it's a lengthy process.

    Here's a replacement library routine for the Adin command. It has been somewhat tested, but not 100% tested on all K40 devices.

    Copy the code below and make a file named "Adin_K40.inc" then include this in your program. You can still use the ADin command, but it will use the routine written in BASIC instead. To make the include file available to all programs, place it in the "C:\Users\Your Name\PDS\Includes\" directory.

    Code:
    $ifndef _ADIN_K40_INC_
    $define _ADIN_K40_INC_
    '
    ' Replacement ADin Library routine for teh ADin command on the silly 18FXXK40 devices
    ' That have changed peripheral operations just for the sake of it!
    '
        #disable ADIn                        ' Disable the compiler's ADin library routine 
           
        Dim PP7 As Word System               ' Create compiler system variables PP7 and PP7H 
       
        GoTo _Adin_Main_                     ' Jump over the subroutine 
    
    '-------------------------------------------------------------------------------------------------
    ' Replacement ADIn library routine for the 18FXXK40 devices
    ' Input     : WREG holds the channel
    ' Output    : PP7/H and WREG
    ' Notes     : None
    '   
    __adin_:
        ADPCH = WREG                ' Set the channel
        Set ADCON0bits_ADON         ' Turn on the ADC
        
    #ifSym __ADIN_DELAY             ' Has the Declare Adin_Stime been used in the program?
        DelayUS __ADIN_DELAY        ' Yes. So delay the required time
    #endIfSym
    #ifnSym __ADIN_DELAY            ' Has the Declare Adin_Stime been used in the program?
        DelayUS  10                   ' No. SO default to 10us
    #endIfSym
    
        Set ADCON0bits_GO_DONE      ' Start a conversion
        DelayCS  1                    ' Delay for 1 cycle after setting the Go_Done Bit
        While ADCON0bits_GO_DONE =  1 : Wend  ' Wait for a conversion to complete
    
    #ifSym __ADIN_RES               ' Has the Declare Adin_Res been used in the program?
    #if (__ADIN_RES ==  8 )           ' Yes. So is it Adin_Res = 8?
        Clear PP7H                  ' \
        WREG = ADRESH               ' | Yes. So get the 8-bit result into PP7 and WREG
        PP7 = WREG                  ' /
    #else                           ' Otherwise... 
        PP7H = ADRESH               ' \ 
        PP7 = ADRESL                ' | Get the 16-Bit Result into PP7/H and WREG
        WREG = ADRESL               ' /
    #endif
    #endIfSym
    
    #ifnSym __ADIN_RES              ' Has the Declare Adin_Res been used in the program?
        PP7H = ADRESH               ' \
        PP7 = ADRESL                ' | No. So place the 16-bit result into PP7/H and WREG
        WREG = ADRESL               ' /
    #endIfSym
        Return    
    
    '-------------------------------------------------------------------------------------------------    
    _Adin_Main_:
    $endif      ' _ADIN_K40_INC_
    For more example programs for Proton and Proton24 or updates, please visit: Proton WIKI or Proton Files

  4. #4
    Junior Member petemilligan's Avatar
    Join Date
    Jun 2017
    Posts
    8
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    150.22 MB

    0 Not allowed!

    Default Re: ADC with 18F24K40 - seem to be getting nowhere. Please help.

    Quote Originally Posted by See_Mos View Post
    Hi Pete, welcome back.

    The first thing I spotted is that you are setting TrisA to decimal 11 instead of binary 000011 and there should be eight bits for each setting and not 6 as in your code
    Thanks See_Mos - The interface here is stripping out %'s when I post. They're there. You got me excited for a moment there. :-)

    Pete

  5. #5
    Junior Member petemilligan's Avatar
    Join Date
    Jun 2017
    Posts
    8
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    150.22 MB

    0 Not allowed!

    Default Re: Adin replacement for 18FXXK40 devices

    Thanks Les, I'll give this a shot in the morning. Much appreciated.

    Pete

  6. #6
    Junior Member petemilligan's Avatar
    Join Date
    Jun 2017
    Posts
    8
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    150.22 MB

    0 Not allowed!

    Default Re: Adin replacement for 18FXXK40 devices

    Hi Les, Before I drive myself into a a darker hole this morning. I assume that this new routine is now;

    Word = AdIn Channel

    Where channel (ADPCH) is any one of these (and some) on the 18F24K40?

    111111 = Fixed Voltage Reference (FVR)(2)
    111110 = DAC1 output(1)
    111101 = Temperature Indicator(3)
    111100 = AVSS (Analog Ground)
    111011 = Reserved. No channel connected.
    011000 = Reserved. No channel connected.
    010111 = ANC7
    010110 = ANC6
    010101 = ANC5
    010100 = ANC4
    010011 = ANC3
    010010 = ANC2
    010001 = ANC1
    010000 = ANC0
    001111 = ANB7
    001110 = ANB6
    001101 = ANB5
    001100 = ANB4
    001011 = ANB3
    001010 = ANB2
    001001 = ANB1
    001000 = ANB0
    000111 = ANA7
    000110 = ANA6
    000101 = ANA5
    000100 = ANA4
    000011 = ANA3
    000010 = ANA2
    000001 = ANA1

    Thanks for your help here - P

  7. #7
    Junior Member petemilligan's Avatar
    Join Date
    Jun 2017
    Posts
    8
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    150.22 MB

    0 Not allowed!

    Thumbs up Re: ADC with 18F24K40 - seem to be getting nowhere. Please help.

    Thanks Les, Your solution was a good one. I'm up and running. Very much appreciate the support.

    Code provided below for others reference.

    All the best,

    Pete


    Code:
    Device = 18F24K40
    Xtal = 64
    
    Config_Start
            FEXTOSC = OFF               ; Oscillator not enabled
            RSTOSC = HFINTOSC_64MHZ     ; with HFFRQ = 64 MHz and CDIV = 1:1
            CLKOUTEN = OFF              ; CLKOUT function is disabled
            FCMEN = OFF                 ; Fail-Safe Clock Monitor disabled
            MCLRE = EXTMCLR             ; If LVP = 0, MCLR pin is MCLR; If LVP = 1, RE3 pin function is MCLR
            PWRTE = On                  ; Power up timer enabled
            BOREN = OFF                 ; Brown-out Reset disabled
            Debug = off                 ; Background debugger disabled
            WDTE = OFF                  ; WDT Disabled
    Config_End
    Include "adin_k40.inc"
    Declare LCD_DTPin PORTC.0
    Declare LCD_RWPin PORTB.1
    Declare LCD_ENPin PORTB.2
    Declare LCD_RSPin PORTB.0
    Declare LCD_Interface 8
    Declare LCD_Lines 4
    Declare LCD_DataUs 100
    Declare LCD_CommandUs 40
    
    Declare Adin_Res = 8       ' 8-bit ADC result required
    Declare Adin_Tad =  128_fosc ' RC oscillator chosen for the ADC per page 427 at 2.0uS
    Declare Adin_Stime = 31  ' Allow 31us sample time
    
    
    Dim counterx As Byte
    All_Digital = false
    TRISA=%11111111       ' Configure AN0 & AN1 (PortA.0, PortA.1) as an input
    TRISB=%00000000       ' configure pins of port B as output
    TRISC=%00000000       ' configure pins of port C as output
    ANSELA=%11111111
    'WPUa=%00000000
    '********************************************************************************
    'ADREF: ADC REFERENCE SELECTION REGISTER
    'bit 7-5 Unimplemented: Read as 0
    'bit 4 ADNREF: ADC Negative Voltage Reference Selection bit
    '1 = VREF- is connected to external VREF-
    '0 = VREF- is connected to AVSS
    'bit 3-2 Unimplemented: Read as 0
    'bit 1-0 ADPREF: ADC Positive Voltage Reference Selection bits
    '11 = VREF+ is connected to internal Fixed Voltage Reference (FVR) module
    '10 = VREF+ is connected to external VREF+
    '01 = Reserved
    '00 = VREF+ is connected to VDD
    
    ADREF=%00000011 '(ADNREF = AVSS & ADPREF = Internal fixed Reference)
    '********************************************************************************
    
    '********************************************************************************
    'FVRCON: FIXED VOLTAGE REFERENCE CONTROL REGISTER
    'bit 7 FVREN: Fixed Voltage Reference Enable bit
        '1 = Fixed Voltage Reference is enabled
        '0 = Fixed Voltage Reference is disabled
    'bit 6 FVRRDY: Fixed Voltage Reference Ready Flag bit(1)
        '1 = Fixed Voltage Reference output is ready for use
        '0 = Fixed Voltage Reference output is not ready or not enabled
    'bit 5 TSEN: Temperature Indicator Enable bit(3)
        '1 = Temperature Indicator is enabled
        '0 = Temperature Indicator is disabled
    'bit 4 TSRNG: Temperature Indicator Range Selection bit(3)
        '1 = VOUT = VDD - 4VT (High Range)
        '0 = VOUT = VDD - 2VT (Low Range)
    'bit 3-2 CDAFVR<1:0>: Comparator FVR Buffer Gain Selection bits
        '11 = Comparator FVR Buffer Gain is 4x, (4.096V)(2)
        '10 = Comparator FVR Buffer Gain is 2x, (2.048V)(2)
        '01 = Comparator FVR Buffer Gain is 1x, (1.024V)
        '00 = Comparator FVR Buffer is off
    'bit 1-0 ADFVR<1:0>: ADC FVR Buffer Gain Selection bit
        '11 = ADC FVR Buffer Gain is 4x, (4.096V)(2)
        '10 = ADC FVR Buffer Gain is 2x, (2.048V)(2)
        '01 = ADC FVR Buffer Gain is 1x, (1.024V)
        '00 = ADC FVR Buffer is off
    
    FVRCON=%11000001 '(Ref enabled, Temp low range, Comp off, ADC gain 1x = 1.024V )
    '********************************************************************************
    
    '********************************************************************************
    'ADCON0: ADC CONTROL REGISTER 0
    'bit 7 ADON: ADC Enable bit
        '1 = ADC is enabled
        '0 = ADC is disabled
    'bit 6 ADCONT: ADC Continuous Operation Enable bit
        '1 = ADGO is retriggered upon completion of each conversion trigger until ADTIF is set (if ADSOI is
        'set) or until ADGO is cleared (regardless of the value of ADSOI)
        '0 = ADC is cleared upon completion of each conversion trigger
    'bit 5 Unimplemented: Read as 0
    'bit 4 ADCS: ADC Clock Selection bit
        '1 = Clock supplied from FRC dedicated oscillator
        '0 = Clock supplied by FOSC, divided according to ADCLK register
    'bit 3 Unimplemented: Read as 0
    'bit 2 ADFM: ADC results Format/alignment Selection
        '1 = ADRES and ADPREV data are right-justified
        '0 = ADRES and ADPREV data are left-justified, zero-filled
    'bit 1 Unimplemented: Read as 0
    'bit 0 ADGO: ADC Conversion Status bit
        '1 = ADC conversion cycle in progress. Setting this bit starts an ADC conversion cycle. The bit is
        'cleared by hardware as determined by the ADCONT bit
        '0 = ADC conversion completed/not in progress
    
    ADCON0.7=1  ' (ADC is enabled)
    
    ADCON0.4=1  'Clock supplied from FRC dedicated oscillator
    
    
    '********************************************************************************
    
    
    
    '********************************************************************************
    
    'ADCON1: ADC CONTROL REGISTER 1
    
    'bit 7 ADDPOL: Precharge Polarity bit
    '    ADPPOL
    '    Action During 1st Precharge Stage
    '    External (selected analog I/O pin) Internal (AD sampling capacitor)
    '    1 Shorted To AVDD CHOLD shorted To VSS
    '    0 Shorted To VSS CHOLD shorted To AVDD
    '    If ADPRE>0x00:
    '    Otherwise:
    '    The bit is ignored
    'bit 6 ADIPEN: A/D Inverted Precharge Enable bit
    '    If ADDSEN = 1
    '    1 = The precharge and guard signals in the second conversion cycle are the opposite polarity of the
    '    first cycle
    '    0 = Both Conversion cycles use the precharge and guards specified by ADPPOL and ADGPOL
    '    Otherwise:
    '    The bit is ignored
    'bit 5 ADGPOL: Guard Ring Polarity Selection bit
    '    1 = ADC guard Ring outputs start as digital high during Precharge stage
    '    0 = ADC guard Ring outputs start as digital low during Precharge stage
    'bit 4-1 Unimplemented: Read as 0
    'bit 0 ADDSEN: Double-sample enable bit
    '    1 = Two conversions are performed on each trigger. Data from the first conversion appears in
    '    ADPREV
    '    0 = One conversion is performed for each trigger
    'ADCON1=%00100001
    '********************************************************************************
    
    '********************************************************************************
    'ADPCH<5:0>: ADC Positive Input Channel Selection bits
        '111111 = Fixed Voltage Reference (FVR)(2)
        '111110 = DAC1 output(1)
        '111101 = Temperature Indicator(3)
        '111100 = AVSS (Analog Ground)
        '111011 = Reserved. No channel connected.
        '000111 = ANA7
        '000110 = ANA6
        '000101 = ANA5
        '000100 = ANA4
        '000011 = ANA3
        '000010 = ANA2
        '000001 = ANA1
    'ADPCH =%00000001 ' (ANA1)
    '********************************************************************************
    
    
    
    Dim ADC_Result As Word ' Create a word variable to hold the ADC value
    
    
    Main:
    Clear
    Cls
    'pmd2=%00000000
    While 1 = 1
        Inc counterx                        'Just to keep an indication of aliveness
                 
        Print At 1,1,"Running: ", Dec counterx, " "
        
        DelayUS 10                   'wait a bit
        ADC_Result=ADIn %00000001
        Print At 2,1, "ADC Result:", Dec ADC_Result,"   "
         Print At 3,1,  Bin ADRESH, " ",Bin ADRESL
    Wend

  8. #8
    Junior Member petemilligan's Avatar
    Join Date
    Jun 2017
    Posts
    8
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    150.22 MB

    0 Not allowed!

    Default Re: ADC with 18F24K40 - seem to be getting nowhere. Please help.

    Incidentally, if not obvious, the parameter for the K40 Adin is the ADPCH value from the datasheet.

    P


  9. #9
    Developer Les's Avatar
    Join Date
    Feb 2002
    Posts
    3,232
    Thumbs Up
    Received: 229
    Given: 83
    Total Downloaded
    1.50 GB

    0 Not allowed!

    Default Re: ADC with 18F24K40 - seem to be getting nowhere. Please help.

    Glad it worked Pete. The trouble was, Microchip made no announcements that they had significantly, and I do mean "significantly" made changes to the K40 and K42 devices (for very little reasons) , so I added the devices to the compiler through the normal method of the mpasm inc files. I then found out about the changes so I'm currently having to create new libraries within the compiler for K40 and K42 devices because the changes are huge. Even RAM access is different, and they've added a Movffl mnemonic for high up RAM.

    Microchip now, don't give a damn about the people who made it a significant player in the market in the first place. i.e the third parties who developed languages before even Microchip bought other compilers and re-labeled them as their own. Unfortunately this is typical of companies :-( Money, money money!!!!!!! "Don't give a damn about people"

    My money is on Microchip eventually dropping PIC, PIC24 and PIC32 devices, and going over 100% to Atmel devices and Arm processors. Why else would they buy it?
    Last edited by Les; 14th November 2017 at 16:10.
    For more example programs for Proton and Proton24 or updates, please visit: Proton WIKI or Proton Files

  10. #10
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,329
    Thumbs Up
    Received: 49
    Given: 123
    Total Downloaded
    2.37 GB

    0 Not allowed!

    Default Re: ADC with 18F24K40 - seem to be getting nowhere. Please help.

    My money is on Microchip eventually dropping PIC, PIC24 and PIC32 devices, and going over 100% to Atmel devices and Arm processors. Why else would they buy it?
    Wow, interesting comment. Les, do you consider Atmel hardware "better" than PIC for bottom end usage?
    George

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. 10f322 adc
    By Oldhack in forum Analog-to-Digital Converter Module
    Replies: 4
    Last Post: 2nd May 2012, 19:24
  2. Need Help with ADC!!!
    By CHulla in forum Labcenter Proteus VSM
    Replies: 3
    Last Post: 16th February 2011, 15:54
  3. Touchscreen ADC Help
    By fgcity in forum Proton Plus Compiler v3
    Replies: 5
    Last Post: 15th May 2007, 15:17
  4. ADC help please
    By richardy in forum Proton Plus Compiler v3
    Replies: 2
    Last Post: 8th November 2006, 09:59

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