I got something that could be considered as a potential yet hypothetical
good news. From a first analysis, it seems the rule "ANSx corresponds to
analog pin x" is somewhat honored in most cases. Few PICs don't honor them,
and most of them as from 16f72X family.
This raises one proposal and one question:
- another file could be created for this specific PICs, and would describe
the relation between ANS and analog pins. From this file, we have two
options:
1. either the relation between ANS bits and analog pins is directly put
into device files. This means dev2jal script have to take this file as input
so it knows what are the exceptions and produce correct JANSEL_ANSx
declaration accordingly.
2. this exception is dealt with directly into ADC lib generator. I
think this option makes more sens.
- Albert, how have you been able to exactly point this exception ?... :)
Here are the guilty PICs:
my scripts recognized them from all device files and said:
"""
PIC 12f609.jal has more ANS bits (4) than total ADC channel 0
PIC 12hv609.jal has more ANS bits (4) than total ADC channel 0
PIC 16f610.jal has more ANS bits (6) than total ADC channel 0
PIC 16f722.jal has more ANS bits (12) than total ADC channel 6
PIC 16f723.jal has more ANS bits (12) than total ADC channel 6
PIC 16f724.jal has more ANS bits (23) than total ADC channel 6
PIC 16f726.jal has more ANS bits (12) than total ADC channel 6
PIC 16f727.jal has more ANS bits (23) than total ADC channel 6
PIC 16hv610.jal has more ANS bits (6) than total ADC channel 0
PIC 16lf722.jal has more ANS bits (12) than total ADC channel 6
PIC 16lf723.jal has more ANS bits (12) than total ADC channel 6
PIC 16lf724.jal has more ANS bits (23) than total ADC channel 6
PIC 16lf726.jal has more ANS bits (12) than total ADC channel 6
PIC 16lf727.jal has more ANS bits (23) than total ADC channel 6
"""
Note: I also wonder why 12f609, for instance, has ANS bits while no ADC
module at all...
Ooops: I think my script qualitatively identified the guilty PICs, but the
quantitative part is wrong. For instance, 16f722 actually 11 ADC channels,
while my last device files says 6. Since you guys have "decided" to PM these
device files and not sharing on the group, I can't update these data...
Please guys, share if you want everybody to help !
Cheers,
Seb
--
Sébastien Lelong
http://www.sirloon.net
http://sirbot.org
2009/8/5 Sebastien Lelong <[email protected]>
> I got your message (wouldn't it be easier to share these files on the group
> ?) with device files.
> Bloody hell ! This case is absolutely not handle by ADC libs... There's a
> strong (but false...) assumption about ANS bits: ANSx corresponds to analog
> pin x. Bad...
>
> I could make sure pin_AN5_direction exist before setting it as input, but
> it won't fix the problem, and having an error shows limitation of the lib.
> (gosh I can't even know which pin corresponds to ANS5).
>
> Here are the options I can think of:
>
> - rename ANS bits so the rule "ANSx corresponds to analog pin x" is
> honored
> - enrich ADC libs generation by including special cases for ANS bits
> (some more manual work I guess).
>
> As a temporary workaround, I can still check pin_ANx_direction exists, and
> it not, just warn about it. It'll let you use ADC libs with 16f722 in a
> limited fashion.
>
> Cheers,
> Seb
> --
> Sébastien Lelong
> http://www.sirloon.net
> http://sirbot.org
>
>
> 2009/8/5 Sebastien Lelong <[email protected]>
>
> Hi,
>>
>> Can you provide full code to compile and the device file so I can check ?
>> As for gaps in numbering, ADC libs should be able to handle this IIRC.
>>
>> Seb
>> --
>> Sébastien Lelong
>> http://www.sirloon.net
>> http://sirbot.org
>>
>>
>> 2009/8/5 AlbertF <[email protected]>
>>
>>
>>>
>>> Hi seb,
>>> I tried the new files from Rob, but got the following error when
>>> trying to use the ADC Lib
>>>
>>> ...projects\jallib_svn\include\peripheral\adc/adc_channels.jal:1708:
>>> "pin_an5_direction" not defined
>>> ...\projects\jallib_svn\include\peripheral\adc/adc_channels.jal:1714:
>>> "pin_an6_direction" not defined
>>> ...\projects\jallib_svn\include\peripheral\adc/adc_channels.jal:1720:
>>> "pin_an7_direction" not defined
>>>
>>> The device files are looking OK, there is a gap in the numbering of
>>> AN,looks
>>> like the ADC lib can not handle this situation, any idea how to
>>> resolve this issue?
>>> Albert
>>> >>>
>>>
>>
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---