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
  • Advertise
You are here: Home / Replies / well i assume that there’s no

well i assume that there’s no

|

Microcontroller › AVR › Interfacing LM35 and avr controller with use of internal ADC of ATMEGA32 › well i assume that there’s no

January 2, 2012 at 8:31 am #6978
jinay
Participant

well i assume that there’s no problem with your LCD CODE…so you are getting output on LCD but you have a problem in ADC CODE and Interfacing

 

Interfacing is quite simple : Simply Connect LM35 to your ADC PIN

 

CODE ERROR:

 

I have found in your code that you are returning ADCH in adc_conv() function but my friend ADCH carries only upper bits of the resulting step as ATMEGA16/32 supports 10bit resolution ADC

 

ADCH :- 9:8

ADCL :-  7:0

 

thus whole ADCL and ADCH combine gives the result of ADC

 

and for that you only need to change ADC instead of ADCH

 

where ADC register is 10 bit register and it combines ADCL and ADCH

 

and don’t forget to change the return type of your function to unsigned short int adc_conv() for 10bit return

 

 

Try this i am sure this will surely clears your problem….

 

and still you find problem try to refer DATASHEET.. it will explain you very well…

RSS Recent Posts

  • Beginner Questions About CNC Machines – G-code, Control Systems & Accuracy April 21, 2026
  • S1MJ ? April 20, 2026
  • timing delay code statements using Swordfish April 20, 2026
  • Selection Criteria and Safe Usage of Cable Ties in Electronics Applications April 20, 2026
  • properly producing TDR on PNA network analyzer N5224B April 20, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 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
  • Advertise