'Code by Shaun Wilson July 01/99 'This is code communicates with the MAX187 ADC. It receives 'the 12 bit repersention of the analog input and displays it 'in the debug screen. '----------------Constants-------------------------------------- SCLK con 0 'serial clock pin CS con 1 'chip select pin serData_in con 2 'serial data into the Stamp '----------------Varibles--------------------------------------- adc var word '12 bit result '----------------Program--------------------------------------- main: ' main program loop gosub convert ' conversion subroutine gosub print ' output subroutine goto main '----------------Subroutines--------------------------------------- print: debug dec adc 'displays the result on the PC screen return convert: low CS 'start conversion Shiftin Serdata_in,SCLK,MSBPOST,[adc\12] 'read in converted signal high CS 'stop conversion return
Text file Source (historic): geocities.com/siliconvalley/orchard/6633
geocities.com/siliconvalley/orchardgeocities.com/siliconvalley
(to report bad content: archivehelp @ gmail)
|
|
|
|
|