I am using the following subroutine to read the ADC input. Just enabling the ADC function then looping through this subroutine over and over shows me, on my scope, that NU2, pin 3 of the ATTiny, goes high for .9 ms. It takes the ADC that long to complete a single read. Really? That's pretty slow. I am using the internal RC oscillator set at 8 MHz and the divide by function on the clock. How can I speed the ADC read time up without adding an external crystal? I am watching a string of pulses that are clocking at about 4KHz and the ADC takes 1.111KHz to complete a single read.
; ;=================================== ;READ THE ADC ;RESULTS ARE AUTOMATICALLY STORED ;IN ADCH AND ADCL REGISTERS ;=================================== ; ; READ_ADC: sbi portb, NU2 ;turn on "ADC running" pulse on pin 3 of MCU sbi ADCSRA, ADSC ;start conversion ADSC to 1 (zeros when done) loopX: sbic ADCSRA, ADSC ;ADSC bit goes low when conversion complete rjmp loopX ;not complete, keep checking cbi portb, NU2 ;turn off "ADC running" pulse on pin 3 of MCU ret ; ;