Hi Seb,

Maybe I was not clear. It is *supported*; no issue to solve.

Joep

2010/10/5 Sebastien Lelong <[email protected]>:
> I didn't see any "unsupported combination" in the datasheet, that's why I
> thought it was ok (at least in this case). If it's really unsupported, I'd
> need to change this. Keeping the logic (which I'd like to...), I can see
> another step I could implement: when pruning table's columns, if a column
> contains an analog pin ("A" or "VREF+/-"), then remove the configuration
> bits.
> Would that sound reasonable ?
>
> Cheers,
> Seb
> 2010/10/5 Joep Suijs <[email protected]>
>>
>> Okay, I understand.
>> I can imagine there are other ways to go around this for this specific
>> case, but as you said: there are many other cases to consider.
>> At least for this chip it works (and even the specs say 'the pins are
>> not there' and not 'usupported combination'. So it okay until proven
>> otherwise.
>>
>> Joep
>>
>> 2010/10/5 Sebastien Lelong <[email protected]>:
>> >
>> >
>> > 2010/10/4 Joep Suijs <[email protected]>
>> >>
>> >> > No, I don't think so, if you look at adc_channels.jal, line 460,
>> >> > ADC_PCFG_MAP is defined for 16f877a. If you read the array triplet by
>> >> > triplet, you'll see 5 ADC channels config is different from 6. You'll
>> >> > also
>> >> > see 5/0 is configured with 0b0010 in this case, and 6 is configured
>> >> > with
>> >> > 0b1001... If you want more information, I need to use print...
>> >>
>> >> So why is this different for 16f876a?
>> >
>> > Because 16f876 has less analogs than 16f877 (5 vs. 8). Now how does it
>> > impact bits configuration ? The algorithm goes like this (see
>> > tools/adc/adc_channels.jal.tmpl):
>> >   - for each PICs found in a datasheet, groups them using the number of
>> > available analog pins. For datasheet 39582, we have 4 PICs, grouped by
>> > 2.
>> > One group has 5 analogs (16F876A, 16F873A), another has 8 analogs
>> > (16F877A, 16F874A). See line ~160 in tmpl file, there's a comment,
>> > unfinished though :)
>> >   - now, for each group, we consider the table declaring the different
>> > bit
>> > combinations (page 128). This can be found in pinmap.py in a more
>> > programmatic fashion. The "problem" is this is a full representation of
>> > the
>> > table (all columns, that is, all analog pins).
>> >   - so a first step is to "prune" this table to match the number of
>> > available analog pins. For our first group with 5 analogs, it's just as
>> > if
>> > we've removed the first three column (AN7, AN6, AN5). Ignoring these
>> > cols
>> > and re-computing again the number of configured analogs (5/0, 6/1, ...),
>> > you
>> > now understand why there are multiple combination for 5 analogs in our
>> > first
>> > group.
>> >   - for the second group, all analog pins found in this table are found
>> > in
>> > the PICs (8). so the table isn't pruned, all combination are kept.
>> >
>> > I hope this explains better why 16f876 and 16f877 aren't processed the
>> > same
>> > way. As I said, there are many information to be compiled/considered
>> > when
>> > generating ADC libs, this can make it tricky. I tried to comment as much
>> > as
>> > I can (in tmpl mostly - the right  place), provided I finish my
>> > sentences :)
>> >
>> > Cheers,
>> > Seb
>> >
>> > --
>> > 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.
>> >
>>
>> --
>> 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.
>>
>
>
>
> --
> Sébastien Lelong
> http://www.sirloon.net
> http://sirbot.org
>
> --
> 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.
>

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