Status: Assigned
Owner: [email protected]
Labels: Type-Defect Priority-Medium

New issue 76 by [email protected]: Can not select AN3..AN7 with  
set_analog_pin with PIC18f14k50
http://code.google.com/p/jallib/issues/detail?id=76

What steps will reproduce the problem?
1.
include 18f14k50                    -- target PICmicro

--
-- This program assumes a 12 MHz resonator or crystal
-- is connected to pins OSC1 and OSC2.
-- Configuration bits may cause a different frequency!
pragma target OSC HS               -- HS crystal or resonator
pragma target clock 48_000_000     -- oscillator frequency

const ADC_NVREF                 = 0         -- number of external
references
const ADC_RSOURCE               = 10_000    -- maximum source resistance
const ADC_HIGH_RESOLUTION       = true          -- 10 bits

include adc

--
-- disable analog I/O (if any)
enable_digital_io()

-- select analog input ( RC1 / AN5 )
set_analog_pin(5)
adc_init()

2.
3.

What is the expected output? What do you see instead?
Code Generated:

; 1397    procedure set_analog_pin(byte in an_pin_num) is
l_set_analog_pin
                                movwf    v___an_pin_num_1,v__banked
; 1447          if an_pin_num == 8 then
                                movlw    8
                                subwf    v___an_pin_num_1,w,v__banked
                                btfss    v__status, v__z,v__access
                                goto     l__l205
; 1448             JALLIB_ANS8 = true
                                bsf      v_anselh, 0,v__access ; jallib_ans8
; 1449                  adc_pin_AN8_direction = input
                                bsf      v_trisc, 6,v__access ;
pin_c6_direction
; 1450          end if
; 1451       end if
l__l205
; 1453          if an_pin_num == 9 then
                                movlw    9
                                subwf    v___an_pin_num_1,w,v__banked
                                btfss    v__status, v__z,v__access
                                goto     l__l209
; 1454             JALLIB_ANS9 = true
                                bsf      v_anselh, 1,v__access ; jallib_ans9
; 1455                  adc_pin_AN9_direction = input
                                bsf      v_trisc, 7,v__access ;
pin_c7_direction
; 1456          end if
; 1457       end if
l__l209
; 1459          if an_pin_num == 10 then
                                movlw    10
                                subwf    v___an_pin_num_1,w,v__banked
                                btfss    v__status, v__z,v__access
                                goto     l__l213
; 1460             JALLIB_ANS10 = true
                                bsf      v_anselh, 2,v__access ;
jallib_ans10
; 1461                  adc_pin_AN10_direction = input
                                bsf      v_trisb, 4,v__access ;
pin_b4_direction
; 1462          end if
; 1463       end if
l__l213
; 1465          if an_pin_num == 11 then
                                movlw    11
                                subwf    v___an_pin_num_1,w,v__banked
                                btfss    v__status, v__z,v__access
                                goto     l__l217
; 1466             JALLIB_ANS11 = true
                                bsf      v_anselh, 3,v__access ;
jallib_ans11
; 1467                  adc_pin_AN11_direction = input
                                bsf      v_trisb, 5,v__access ;
pin_b5_direction
; 1468          end if
; 1469       end if
l__l217
; 1536    end procedure


So only code generated for AN8..AN11, not for AN3..AN7

Please use labels and text to provide additional information.


--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"jallib" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to