Hi Seb,

Sebastien Lelong wrote:
> 
> I've made a quick fix in order to close issue 31 (

I've used ADC only for a few dimmers, and not with JAL, so I'm not an 
expert on this.  But out of curiosity I browsed the adc library and saw 
some questionable thinks:

Is it really necessary to shadow ADCON0? I thought this was only needed 
for registers which have an external connection (to prevent the RMW 
problem). I don't think ADCON0 suffers of this problem and it 
complicates the code (unnecessarily?).

I saw that the 12F675 is handled differently than all others. This could 
be a relic from the time that library makers decided for us which PICs 
are good for us. I don't believe this PIC is so unique as far as ADC 
control is concerned, there are probably other PICs which have to be 
handled similarly.

The lib contains several statements like:
>  ADCON1 = ADCON1 | 0x80
With JalV2 this can better be written as:
    ADCON1_ADFM = TRUE
for more device independency.

I think the 12F675 (and other) specific handling as mentioned above can 
also be overcome by using register subfields (bit groups) in stead of 
'and' and 'or' operations on a whole register.

The 18Fs have an ADRES (word) register and ADRESL and ADRESH (byte) 
registers. I don't know if this would frustrate the quick fix, but it 
might be worth checking.

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