Page 1 of 1

I2C eating memory

Posted: Fri Aug 28, 2020 6:39 pm
by Clive44
Hi

I'm using Flowcode 6 on a PIC16F1827 to read the temperture on an LM75 via I2C.
Just writing a simple routine using the I2C Master has 'eaten 4355 words of memory, but the PIC16F1827 only has 4096.
So it doesn't have enough memory to complile to hex.

Has anyone else seen this? Am I missing something somewhere? Would an upgrade to Flowcode8 help?

Thanks!

Clive

Re: I2C eating memory

Posted: Fri Aug 28, 2020 9:26 pm
by Benj
Hi Clive,

Might be worth trying the 30-day free trial of Flowcode 8 and seeing if this helps at all. It uses a different compiler and we have come a long way since v6 so is certainly worth a go.

Re: I2C eating memory

Posted: Sun Sep 13, 2020 8:21 pm
by Bachman
LM35 have only 0.5 °C resolution. Why are you using 0.125 multiplier? Try DS18B20, it has a resolution of 0.0625 °C, what is enough for displaying 0.1 °C precision.

The main problem is the "TempdegC" variable, what is FLOAT. Try to never use FLOAT, you can make some tricks.

From "calculate temperature":

Code: Select all

Temperature = Temperature >> 7
Data = Temperature and 1			//'Data' contains the decimal, LSB of Temperature
Temperature = Temperature >> 1			//cut off decimal from 'Temperature'
LCD_PrintNumber 'Temperature'
LCD_PrintString "."				//decimal point
if data=1 //decimal is 5
LCD_PrintNumber '5'
else
LCD_PrintNumber '0'