Digital Ohmeter Display Problem

Go To Last Post
6 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi! I've done a project using Atmega16 and Code Vision AVR. It works fine 'til a point, more specific when I am trying to display the adc value it shows a constant value and does not change at all when i am placing a resistance to be read. Hardware part worked fine.

 

 I am attaching you the code of the project and the electrical scheme that i used from this video (https://www.youtube.com/watch?v=...).

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Have you got the mega16 wired correctly? AVCC connected?  You've commented out a perfectly good adc function and replaced it with something suspect. Where do you select which adc input you are using? What mega16 pin are you inputting the voltage into?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, i've got it perfectly functional.Here are some pictures of the layout and how it works(https://postimg.cc/gallery/12581...). Avcc is 5V connected at pin 30, i am using USB-TTL plug in. Firstly, I generated the adc read function by compiler, and then I made it manually because I thought that function was the problem, but it does the same thing.  I do select the adc input beeing pin40(PA0) with adc_init().

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

What reference have you selected? What is the voltage at pin 32 (VREF)? What is the voltage at PA0?

 

You do realise it is next to impossible to figure out how you've wired your board. How about a quick sketch of the schematic? It looks like PA0 is wired to your lcd. The schematic on youtube is not complete - it would be no surprise your circuit does not work.

 

 

 

Last Edited: Sun. Jun 23, 2019 - 09:35 AM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hardware part worked fine.

What do you mean by that---if you were already measuring ohms accurately where is your circuit & schematic?? 

When in the dark remember-the future looks brighter than ever.   I look forward to being able to predict the future!

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your code appears to have the ADC clock set at FOSC/2.  The AVR ADC clock should be about 200000 Hz for about 30K conversions per second and 13 clocks per conversion.  If your FOSC is 20MHz, then you should use ADPS2-0 set to 111 for a 128 prescaler.