I am using a 16F88 for a project and i want to show simultaneous conversion of two ADC channels, AN0 and AN1 on LCD.
My problem is that the LCD shows the clues alternately and no simultaneous
My code
Code:
DEFINE ADC_BITS 10
DEFINE ADC_CLOCK 3
DEFINE ADC_SAMPLEUS 50
adval VAR WORD
adval1 VAR WORD
ANSEL = %00000011
CMCON = 7
TRISA = %00000011
ADCON0 = %11001001
ADCON1 = %10000000
INCLUDE "LCDbar_INC.bas"
loop:
ADCIN 0, adval
adval = (adval */ 500)>>2
LCDOut $fe,1,"L:"
@ BARgraph _adval, 1, 2, 16, 100, lines
ADCIN 1, adval1
adval1 = (adval1 */ 500)>>2
LCDOut $fe,$C0,"R:"
@ BARgraph _adval1, 2, 2, 16, 100, lines
PAUSE 300
GoTo loop
Bookmarks