Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ADRESH & ADRESL?
02-12-2011, 08:13 AM,
#1
ADRESH & ADRESL?
Is there an ADRESH & ADRESL equivalent on the pinguino32? From the pic32 online docs it seems to me that if you set AD1CON2bits.BUFM=1 then the high and low parts of the 10 bit analog conversion are sent to ADC1BUF0 and ADC1BUF1 in 8 bit words... but I could be getting that totally wrong.
Reply
04-12-2011, 03:47 PM,
#2
RE: ADRESH & ADRESL?
Hi

There is only one register to read the result of an analog conversion if AD1CON2bits.BUFM=0 else the result can be read in a couple of register ( ADC1BUF0/ADC1BUF7 ).
On Pinguino, the 16 bits configuration is used. The result is in ADC1BUF0 + ( 8*(AD1CON2bits.BUFS&0x01)). The AD1CON2bits.BUFS determine the offset of the result.

JP

(02-12-2011, 08:13 AM)avriot Wrote: Is there an ADRESH & ADRESL equivalent on the pinguino32? From the pic32 online docs it seems to me that if you set AD1CON2bits.BUFM=1 then the high and low parts of the 10 bit analog conversion are sent to ADC1BUF0 and ADC1BUF1 in 8 bit words... but I could be getting that totally wrong.

Reply
04-12-2011, 10:42 PM,
#3
RE: ADRESH & ADRESL?
That looks like the wrong expression. If the alternate buffers are being used you need a different expression and if they're not then there's no point in using the part with .BUFS

John
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)