On 03/25/10 11:13 am, Sebastien Lelong wrote:

I've missed something... In 16f722.jal, JANSEL_ANSx bits aren't
contigous anymore !

True, like there are gaps and irregular sequences in the pin/bit nummering of AN-pins in their respective registers. The 16F722 for example has pin_AN0 to pin_AN3 on RA0 to RA3, but pin_AN4 is on RA5. This PIC does not have pin_AN5 to pin_AN7 and pin_AN8 to pin_AN13 are spread over RB0 to RB5 (typically Microchip style I would say!).
There are similar 'irregularities' with many other PICs.

The idea behind JANSEL_ANSx is to normalize these numbers and hide
complexity for ADC libs (in general, not for these PICs). Specifically,
there exception handling for these PICs: 16F722, 16F723, 16F724, 16F726,
16F727 + LF versions. So I'll update the extra normalization step, but
can you confirm there aren't such change in other PICs ? (for which ANSx
bits aren't contigous anymore)

There is obviously a misunderstanding! The idea of JANSEL was (in my view) to obtain a one-to-one relationship between JANSEL_ANSx and pin_ANx (with the same value of 'x'). So for example when using ADC channel 4: pin_AN4 is the input pin and control its analog setting is with JANSEL_ANS4. This sounds very obvious to me and is also similar to the PICs which use ANCON1_PCFGx bits for this purpose.

I could make a list of all PICs with irregularities in their AN-pin numbering. But I'm pretty sure it will contain almost all PICs with JANSEL_ANSx (except for the very small ones with 2 or 3 ADC channels which are difficult to randomize!). You might as well use the FindJANSEL wiki, which was really meant to show how AN-pins are organised.

I'm sorry when I've caused trouble, of course unintentionally.

Regards, Rob.

--
Rob Hamerling, Vianen, NL (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 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/jallib?hl=en.

Reply via email to