Hi Rob,
IIRC I did have a warning but I didn't specify a ADC_MIN_TAD value.
Something I should dig when I get a chance.
Anyway, what I'm suggesting is to take care ADC_MIN_TAD value within
adc_clock.jal. When I write first version, I remembered 18F had Tad(min) =
0.8µs and 16F had Tad(min) = 1.6µs. Since 16F rules had less restrictive
rules, I kept these. But we could adjust according to the family type (as
well as for Tad(max)):
-- adc_clock.jal
if defined(ADC_MIN_TAD) == false then
if target_cpu = PIC_16 then -- 18F family
const ADC_MIN_TAD = 8 -- 0.8 usec minimum
else -- non-18F
const ADC_MIN_TAD = 16 -- 1.6 usec minimum
end if
end if
if defined(ADC_MAX_TAD) == false then
if target_cpu = PIC_16 then -- 18F family
const ADC_MAX_TAD = 250 -- 25 usec minimum
else -- non-18F
const ADC_MAX_TAD = 60 -- 6 usec maximum
end if
end if
Would that make sense to you ?
Cheers,
Seb
2011/2/3 Rob Hamerling <[email protected]>
>
> Hi Seb,
>
> The library adc_clock.jal is OK (I think). But as I wrote in my msg to Toon
> the application program should specify ADC_TAD_MIN when the actual minimum
> value for the chip is lower than the default of 1.6 us, especially when
> running at 48 MHz.
> I assume you do that in your program, otherwise you should get a warning.
>
> Regards Rob.
>
>
>
>
> On 2011/02/03 21:34, Sebastien Lelong wrote:
>
> so, do we need to work on this to make the lib more generic ? i used adc
>> recently with 18f4550 (jaluino) running @48mhz, results via usb serial,
>> no troubles.
>>
>> cheers
>> seb
>> --
>> Sébastien Lelong
>>
>> Le 3 févr. 2011 à 21:20, [email protected] a écrit :
>>
>> Revision: 2453
>>> Author: robhamerling
>>> Date: Thu Feb 3 12:19:49 2011
>>> Log: Added specification of actual value (0.8 us) for minimum Tad
>>> (ADC_TAD_MIN = 8) for 18f4550, since the default value (1.6 us)
>>> is too high with a clock speed of 48 MHz and would cause Frc being used.
>>>
>>>
>>> http://code.google.com/p/jallib/source/detail?r=2453
>>>
>>> Modified:
>>> /trunk/sample/18f4550_adc.jal
>>>
>>
--
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.