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
I2C eating memory
Moderator: Benj
I2C eating memory
- Attachments
-
- I2C read temperature experiment 2 stripped down code.fcfx
- (25.59 KiB) Downloaded 292 times
- 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
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.
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.
Regards Ben Rowland - MatrixTSL
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
Flowcode Product Page - Flowcode Help Wiki - Flowcode Examples - Flowcode Blog - Flowcode Course - My YouTube Channel
- Bachman
- Posts: 116
- Joined: Sun Sep 07, 2014 11:37 am
- Location: Hungary
- Has thanked: 9 times
- Been thanked: 53 times
Re: I2C eating memory
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":
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'