I forgot to deal with ANS29 in set_digital_pin()...

Seb

2012/1/30 Sebastien Lelong <[email protected]>

> Here's what I can find:
>  - compiling with "-debug" shows ADC pins are set with ANS bits (_debug
> "ADC channels config: independent pins, via ANS bits") (I just mention this
> for the record, -debug will show which configs adc_channels.jal decides to
> use)
>  - asm shows ANS up to 27 are considered, so at runtime, it is very
> probable set_analog_pin(29) does nothing... as you report. Also remember I
> can't produce an error at runtime, so I can't do nothing about
> set_analog_pin(29) when 29 case isn't considered.
>  - ADCON1_ADPREF0 should be defined to get rid of error avbut Vref-. If
> defined, Vref will be set with _adc_vref_adpref_adnref(). So, I think
> ADPREF should enumerated (ADPREF0, ADPREF1)
>  - about ADNREF, this code:
>
>         if ADC_NVREF > ADC_VREF_POS & !defined(ADCON1_ADNREF) then
>             _error "You seem to want to configure a Vref- pin, but
> selected PIC doesn't support this feature"
>         end if
>
> doesn't work. I've also notived the following:
>
> if !defined(bla) then
>   _error "bla is not defined, stop !"
> end if
> bla = 3
>
> if not defined, it won't shortcut on _error, bla = 3 will still be tried
> by the compiler. But:
>
> if !defined(bla) then
>   _error "bla is not defined, stop !"
> else
>    bla = 3
> end if
>
> works properly.
>
>
> Given all of this, I've adapted adc_channels.jal, can I ask you to try
> attached lib ? If it's working I'll report modification on template file.
>
>  I couldn't look for "value out of range", though pretty weird...
>
>
> Thanks & cheers,
> Seb
>
>
>
> 2012/1/30 Sebastien Lelong <[email protected]>
>
>> Hi Rob,
>>
>> adc libs are highly resilient, that's why it works even if not expected :)
>>
>> I'll have a look at your example and report accordingly.
>>
>> Cheers,
>> Seb
>>
>>
>> 2012/1/30 Rob Hamerling <[email protected]>
>>
>>>
>>> Hi Seb,
>>>
>>>
>>> On 01/30/12 10:42 am, Rob Hamerling wrote:
>>>
>>>  After I added enumerated ADPREF bits in the device file and commented
>>>> out the setting of NVREF in adc_channels the program worked!
>>>>
>>>
>>> And now I would like to know _why_ it works too! The procedure
>>> set_analog_pin() as generated in in the .asm output does not cover channel
>>> #29 (and it doesn't report an error either).
>>> I've attached the source (but not the device modified file and
>>> adc_channels library, see previous msg for changes).
>>>
>>>
>>> Regards, Rob.
>>>
>>> --
>>> R. Hamerling, Netherlands --- http://www.robh.nl
>>>
>>> --
>>> 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 jallib+unsubscribe@**
>>> googlegroups.com <jallib%[email protected]>.
>>> For more options, visit this group at http://groups.google.com/**
>>> group/jallib?hl=en <http://groups.google.com/group/jallib?hl=en>.
>>>
>>>
>>
>>
>> --
>> Sébastien Lelong
>>
>>
>>
>
>
> --
> Sébastien Lelong
>
>
>


-- 
Sébastien Lelong

-- 
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