ATmega168 - Internal Temperature Sensor

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

Does the internal temperature sensor on the ATmega168 work?

It's giving me the run around and all I can seem to get out of it is more or less a full house reading. (0x03FE)

Either I'm doing something very silly and/or I've missed something fundamental in the documentation (quite possible of course!).

Basically its a production project ... it already has functional ADC code in it that works well and consistently, it uses the 1.1v internal reference and does single ended conversion. As I say the new code is the same as the old except that it uses a value of 8 for the MUX setting and returns a value that is one bit off the top of the shop.

Even if I go to the working code and bodge the MUX value there to point to the internal temp sensor the full house result is the same.

As I say, either I'm doing something really stupid or missing something really obvious.

If there's someone out there that has actually had it working at least I'd know it was possible!

Mike.

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

did you check the datasheet??????
I thought there was a very extended description on the use of the internal temp sensor in there....

Might be that you need to set another voltage source as reference...

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

meslomp wrote:
did you check the datasheet??????
I thought there was a very extended description on the use of the internal temp sensor in there....

The data sheet seems a bit 'thin' by the usual AVR standards ... but as far as I can see I've complied with all the requirements, single conversion mode, reference set to internal 1.1v

I've now had a report that someone has definitely had it working so it must be possible -- I just need to find out what I'm doing that's stupid here ...

Mike.

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

Are you using the atmega168 or atmega168A?

The datasheet for the 'A' shows temperature measuring capability, the datasheet for the non-A doesn't....

cheers,
george.

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

georges80 wrote:
Are you using the atmega168 or atmega168A?

The datasheet for the 'A' shows temperature measuring capability, the datasheet for the non-A doesn't....

cheers,
george.

What an inspired man ...

The problem is that the schematic and the build schedule shows a 168A ... but this particular board was built pre-production when they were short of chips and put in a 168!

So I'm reading fresh air!

Now if only ATmel would make their chip markings more legible!

Lots of thanks for helping me get to the bottom of this one.

Mike

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

Its so refreshing to see someone's problem get solved. Inspiring. Cheers up my morning.

Imagecraft compiler user

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

Quote:

Are you using the atmega168 or atmega168A?

The datasheet for the 'A' shows temperature measuring capability, the datasheet for the non-A doesn't....


What about the Mega168P? ;) (in general, P and PA are feature-equivalent.)

Quote:

The data sheet seems a bit 'thin' by the usual AVR standards

LOL--IIRC the 500+ pages are eclipsed only by the '164 and '640 behemoths.

Quote:

I've complied with all the requirements, single conversion mode, reference set to internal 1.1v

Let's see some code.

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

A big thank you to all you guys out there that helped me get to the bottom of this one.

I don't like to bother you folk unless I'm really, really, stuck and have run out of ideas to try and places to search.

But when you're working on your own and you've come up against one of those brick walls that we all hit from time to time it really helps to get some additional input on a problem and a different way of looking at it.

As I say, many thanks for all the input ... you helped me out of the hole.

Mike