Hi Toon,
On 2011/02/03 20:13, phalox wrote:
Okay :-) Now I know what they mean! In the table it says 'Device frequency'. What frequency is that then ? Mine is connected to a 20Mhz crystal, upscaled to 96Mhz for USB and divided by 2 for the rest of the 湣 operations. Since The max in that table is 40Mhz, I guess that's the crystal speed? (which is strange, since you can also have an internal clock...). I can't find anything about it in the section about Oscillator Config.
The device frequency is the frequency with which the PIC runs, and for the compiler it is what is specified with "pragma target clock". The ADC library (adc_clock.jal) uses the latter value and with that value it determines the mask for the ADCS bits. When I compile the sample 18f4550_adc.jal the ADCS bits are set to 0x110, which is the correct value according to the datasheet (39887C, table 2-1) for a 48 MHz clock.
BTW: I see 48 MHz as highest value for the clock. In which datasheet and table do you see 40 MHz as maximum?
But (at least for this type), that table should be incorporated in one of the files... (or another parameter is needed). the acquisition time is handled manually in the library (as far as I understand).
I wonder if you use the latest ADC libraries, in particular adc_clock.jal. It should be at least revision 2313, but the latest is revision 2452.
Regards, Rob. -- R. Hamerling, Netherlands --- 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.
