Hi Seb,
Sebastien Lelong wrote: > I finally did not parse datasheets, as only 7 or 8 was needed to read. The > idea was to know how to configure PCFG bits, that is configure how many ADC > channels. There are 3 ways to select the number of ADC channels: > > - PCFG bits can be found in non-18F PICs, and in this case, there's no > logic at all. I copied the PCFG table in a python map > - PCFG bits can also be found in 18F. In this case, from the few DS I > could read, it appears the meaning is quite straightforward: I have a similar experience: the 18Fs have a pretty consistent architecture, the midrange and baseline is a collection of anarchists. When we want/need a library to support all of 'm, I think we should base it on the 18Fs and then find a way to fit the others. > Original adc_hardware lib was "only" dealing with "PCFG for non-18F" case, > and only for a very few PICs (2 or 3). That's why there was a > "adc_hardware_nchan" constant you had to define before using the lib. In > this case, you can't select which pin will act as ADC, you just can reach a > combination, documented in DS, and controlled by PCFG bits (wanna 4 channels > ? Then they will be AN0, AN1, AN4 and AN5, no choice). > > On the other side, if I understand correctly, with 18F and ANSEL controlled > PICs, you can select which pin will act as ADC, one by one. There's no need > to define a "adc_hardware_nchan" constant here, it's far more flexible here. > Yet we could still provice the ability to pass the number of wanted > channels, and the lib would configure them from AN0 to ANx. Not mandatory > though... > > As a consequence, there will be great improvement here (I think :)). And, > the API won't be the same regarding the ability to independently select ADC > pins, or select them according to a predefined presets. > > > Do you have any suggestions about the future API ? I have no suggestions (yet), but it sounds to me like you are nearing a significant improvement for ADC support. Regards, Rob. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
