As usual, have YOU tried it yourself?
Random comments:
* Don't use HIGH/LOW, they're wasting time and program space.
* After STROBE goes LOW (active) there's a 36us (minimum) settling time so I'd wait that amount of time before sampling the output.
* The ADCIN statement is likely to take longer than the needed 18us so there shouldn't be a need to have that delay in there.
* What's being done in the display subroutine? Does it take longer than 18us? If so move things around and eliminate the other delay as wellOr, sample all bands and then display themCode:FOR Band = 0 to 6 STROBE = 0 PAUSEUS 36 ' Wait specified settling time ADCIN 1, Value ' Take a reading, this will take tens of uS depending on how the ADC is setup. STROBE = 1 GOSUB Display ' This will also take time so we'll most likely meet the 72us minimum strobe to strobe time - needs verifying. NEXTThe above has obviously not been tested, it's being provided as food for thought.Code:Spectrum VAR BYTE[7] Band VAR BYTE FOR Band = 0 to 6 STROBE = 0 PAUSEUS 36 ' Wait specified settling time ADCIN 1, Spectrum[Band] STROBE = 1 PAUSEUS 36 ' Can probably be removed altogether since ADCIN will provide the needed "delay". NEXT
/Henrik.




Bookmarks