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 feed: Recent Posts Recent Posts

  • Speed control on power tools... October 8, 2026
  • How much does generator frequency stability matter for sensitive electrical equipment? October 7, 2026
  • Curiosity is difficult. October 6, 2026
  • On off switch hack October 6, 2026
  • DBT alternative idea October 4, 2026

Stay Up To Date

Newsletter Signup
EngineersGarage

Copyright © 2026 Arrowfly 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 Arrowfly
Privacy Policy | Advertising

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