Hi Seb,
On 01/29/12 04:23 pm, Rob Hamerling wrote:
For example: I see that the 16f1527 has 30 ADC channels, but I cannot find anything in adc_channels that allows using pin_AN28 or pin_AN29. Is that an omission in the library or a misunderstanding of me?
I have a test board for 64-pin PICs with all kinds of inputs and outputs, but pin_E2 was still free and with the 16f1527 this is happens to be pin_AN29! So I made a little program to see if I could get this pin working as ADC input and worked, although not without some tweaking!!
1. The device file of the 16f1527 has ADCON1_ADPREF bits, but not enumerated like adc_channels.jal expects. All 16F15xx's have these bits defined as bit*2, while all others have 'm enumerated. Please tell us if you want 'm all enumerated or all as bit*2 (in which case you need to change adc_channels.jal).
2. The 16f1527 does not have an ADCON1_ADNREF bit, but adc_channels insists to set it to 0 (with const byte ADC_NVREF = ADC_NO_EXT_VREF).
After I added enumerated ADPREF bits in the device file and commented out the setting of NVREF in adc_channels the program worked! But there were a few warnings left:
adc_channels.jal:145: warning: operation is always FALSE adc.jal:238: warning: value out of range (1000:0...255) adc.jal:238: warning: value out of range (915:0...255) adc.jal:238: warning: value out of range (1000:0...255)
Maybe the first can be suppressed for a 'normal' user. Maybe the last three require some type casting. 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.
