Errors using SensLib and tutorial Temperature Probe

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

Moderators: Benj, Mods

Pascal
Posts: 5
Joined: Tue Jan 24, 2006 11:20 pm
Contact:

Errors using SensLib and tutorial Temperature Probe

Postby Pascal » Mon Sep 11, 2006 8:56 pm

Hi,

I'm very interrested in driving LCD and acquiring analogue signal. I tried your tutorial (Temperature probe projet) and followed all steps (included variables creation), but when I did Compile To ASM there were errors like :

ERROR 112 : TP8.ASM 114 : Missing operator
same errors lines : 171,183,204,217,311
ERROR 124 : TP8.ASM 204: Illegal argument (expected single character)
same errors lines: 204,217,311,345

I'm working with developpement board V3 and 16F88, and sames errors append when I'm targeting a 16F874 (only Compile To ASM).


Have you got any idea ?

Thanks in Advance.

Pascal

User avatar
Steve
Matrix Staff
Posts: 3073
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 87 times
Been thanked: 387 times
Contact:

Postby Steve » Tue Sep 12, 2006 9:06 am

Hello Pascal,

Please send the FCF, C, ASM and ERR files to our tech support address (support@.....co.uk) and we'll have a look.

Pascal
Posts: 5
Joined: Tue Jan 24, 2006 11:20 pm
Contact:

Postby Pascal » Fri Sep 15, 2006 12:37 pm

Hi

I send you all the files on wenesday. I do hope you've got 2 minutes in order to have a look and inform me about what's wrong with my .fcf file.

Thanks in advance.

Pascal.

Ian
Posts: 110
Joined: Thu Sep 29, 2005 10:53 am
Location: Matrix Multimedia
Been thanked: 1 time
Contact:

Postby Ian » Fri Sep 15, 2006 2:27 pm

Flowcourse uses C Code icons to access pre-written C libraries. Whilst these work with the original device they were created for, in the original compiler they were created for, when used with other devices or different compilers they can faile to compile, or not work as intended.
In short it is best not to use the SensLib functions.
(We are intending to totally redo that entire section as soon as we get the chance to do so).

A better and more flexible way to do this is to use the Thermometer component as an analogue input, and to use the LCD Display Component as well.
One advantage is that the ADC channel setup and the associated code is generated by Flowcode for the actual Device that is used, unlike the fixed SensLib code that can often be wrong for a particular chip.


Check the help file for the components for more details on how to use them, and also the Flowcode tutorial files. These were written with macros not C Code so demonstrate what we intended to be done.

Connect the Thermometer to the required ADC port.
Use an LCD Start macro to set up the LCD.
Use the SampleADC macro to sample the current analogue value.
This gets split into 2 values due to how the PIC works.
Use the ReadHigh and ReadLow macros to get the values.
Output the values to the LCD.
You can output one or both of the High or Low byte Analogue values, or do some calculations and display the full 10 bit number.

There is an Analogue/thermometer tutorial file (Tutorial 26) that you can look at. This displays the value in its full 10bit 0-1023 value so has the maths and display routines set out as well.