I2C eating memory

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 6.

Moderator: Benj

Post Reply
Clive44
Posts: 52
Joined: Tue Oct 18, 2011 12:35 pm
Has thanked: 3 times
Contact:

I2C eating memory

Post 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
Attachments
I2C read temperature experiment 2 stripped down code.fcfx
(25.59 KiB) Downloaded 239 times

User avatar
Benj
Matrix Staff
Posts: 15312
Joined: Mon Oct 16, 2006 10:48 am
Location: Matrix TS Ltd
Has thanked: 4803 times
Been thanked: 4314 times
Contact:

Re: I2C eating memory

Post 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.

User avatar
Bachman
Posts: 116
Joined: Sun Sep 07, 2014 11:37 am
Location: Hungary
Has thanked: 9 times
Been thanked: 53 times
Contact:

Re: I2C eating memory

Post 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'

Post Reply