All pastes #31216 Raw Edit

Anonymous

public text v1 · immutable
#31216 ·published 2005-11-25 19:28 UTC
rendered paste body
reset:
sbi  PORTB, TxD	;Set TX pin to output
sbi	DDRb,TxD

sbi DDRB, 1		;Set OC1A (PWM_out) pin to output
sbi PORTB, 1	;and enable normal PWM mode (no clock)
ldi temp, 0b01100000
out TCCR1, temp

ldi temp, 0b00100010;ADC results left adjusted (8bit)
out ADMUX, temp	;PB3 (ADC2) selected as input

ldi temp, 0b11100101;Enable the ADC at 50khz, free running?
out ADCSR, temp

;ldi txbyte, 13		;Sends a carriage return to indiciate
;rcall putchar		;Code is running.


newforever:
in byte1, ADCL
in byte2, ADCH
mov txbyte, byte2
rcall putchar
rjmp newforever