EngineersGarage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools
You are here: Home / Replies / Hello,I have found this

Hello,I have found this

|

Microcontroller › AVR › How could these program compiled? › Hello,I have found this

June 29, 2012 at 7:50 pm #8155
Ghulam Mustafa
Participant

Hello,

I have found this program and is working wel for AVR ATmega16 for ADC conversion and wanted to share

 

I found it in Avr Microcontroller’s Book by Mazidi
.INCLUDE “M16DEF.INC”
LDI R16,0xFF
OUT DDRB,R16
OUT DDRD,R16
LDI R16,0
OUT DDRA, R16
LDI R16,0x87
OUT ADCSRA,R16
LDI R16,0xC0
OUT ADMUX, R16
 
READ_ADC:
SBI ADCSRA,ADSC
KEEP_POLING:
SBIS ADCSRA,ADIF
RJMP KEEP_POLING
SBI ADCSRA,ADIF
IN R16,ADCL
OUT PORTB,R16
IN R16,ADCH
OUT PORTD,R16
RJMP READ_ADC
 

RSS Recent Posts

  • Drill speed controller fault August 10, 2022
  • alternate of 80386/486 microprocessor August 10, 2022
  • looking for resistor for my treadmill. August 10, 2022
  • Trying to troubleshot 1960s Panasonic transistor radio August 10, 2022
  • LTSpice DC-AC August 10, 2022

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2022 WTWH Media LLC. All Rights Reserved. The material on this site may not be reproduced, distributed, transmitted, cached or otherwise used, except with the prior written permission of WTWH Media
Privacy Policy | Advertising | About Us

Search Engineers Garage

  • Engineers Garage Main Site
  • Visit our active EE Forums
    • EDABoard.com
    • Electro-Tech-Online
  • Projects & Tutorials
    • Circuits
    • Electronic Projects
    • Tutorials
    • Components
  • Digi-Key Store
    • Cables, Wires
    • Connectors, Interconnect
    • Discrete
    • Electromechanical
    • Embedded Computers
    • Enclosures, Hardware, Office
    • Integrated Circuits (ICs)
    • Isolators
    • LED/Optoelectronics
    • Passive
    • Power, Circuit Protection
    • Programmers
    • RF, Wireless
    • Semiconductors
    • Sensors, Transducers
    • Test Products
    • Tools