LM34 Temp sensor

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: LM34 Temp sensor

Post by medelec35 »

Hi Bill.
Issue with flowchart is you have left the osc speed set to 19.66MHz, yet internal osc will only run at:
Internal osc frequencies.png
(54.29 KiB) Downloaded 2049 times
So there is a mismatch.
This means that your microcontroller is running very slow, so delay will take much longer than the 200ms value
I'm surprised that LCD was working at all!

The Clockout is an output function and only produces a waveform of clock/4
so if clock is set at 8MHz then at clockout pin you should see 8MHz/4 = 2MHz

The flowchart I posted in the above post should work on the fastest speed (8MHz).
How I derived osccon (placed at the very top of Main macro) value of:

Code: Select all

osccon=0x70;
See :
http://www.matrixmultimedia.com/mmforum ... 29&#p28829
Although its for a different target device, the principle will still be the same.

Martin
Martin

Bill Felker
Flowcode v5 User
Posts: 47
Joined: Tue Sep 24, 2013 7:21 pm
Has thanked: 18 times
Been thanked: 12 times
Contact:

Re: LM34 Temp sensor

Post by Bill Felker »

medelec it works fine now ,thanks for the lesson on the clock. :lol: Bill

medelec35
Matrix Staff
Posts: 9520
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times
Contact:

Re: LM34 Temp sensor

Post by medelec35 »

Your welcome Bill.
Glad its working for you.
Thanks for letting us know.

Martin
Martin

Post Reply