Yahoo Groups archive

AVR-Chat

Index last updated: 2026-04-28 22:41 UTC

Message

Re: [AVR-Chat] Atmega Analog to Digital

2005-12-10 by Kevin Bentley

Here's some code I recently wrote for a tiny13. It uses the internal 1.1v reference, so you'll need to use a different value for ADMUX I think.:
; use the internal 1.1v reference. select ADC2 (charger2 input)
ldi Temp,(1< out ADMUX,Temp

; Start a read on ADC1
ldi Temp,(1< out ADCSRA,Temp

WAITFORCHANNEL2:
in Temp,ADCSRA
andi Temp,(1<<ADSC) ; mask out ADSC
cpi Temp,0 ; is ADSC clear?
;brne WAITFORCHANNEL2 ; if not, loop and try again.

Hope that helps,
Kevin

On 12/9/05, nzrh2003 <roy.h@ihug.co.nz> wrote:
Newbe to Atmega.
Can anyone help with an example of seting up an A/D conversion in
assembler using the 5v supply as the reference.
I want to do a simple conversion fo 5v signals to digital.
Thanks in advance.








SPONSORED LINKS
Avr microcontroller Microcontrollers Pic microcontrollers 8051 microprocessor
YAHOO! GROUPS LINKS



Attachments

Move to quarantaine

This moves the raw source file on disk only. The archive index is not changed automatically, so you still need to run a manual refresh afterward.