Hello,
I was very hapy with the onewire betacomponent you provided.
I copied the Custom_Code_OneWire.c into the flowcode\component directory and renamed it to Custom_Code.c
Unfortunatly I am not able to compile the code due to following error:
Launching the compiler...
C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\boostc.pic16.flowcode.exe -v -t PIC16F877A "One Wire Example.c"
BoostC Optimizing C Compiler Version 6.70 (for PIC16 architecture)
http://www.sourceboost.com
Copyright(C) 2004-2007 Pavel Baranov
Copyright(C) 2004-2007 David Hobday
Licensed to FlowCode User under Single user Pro License for 1 node(s)
Limitations: PIC12,PIC16 max code size:Unlimited, max RAM banks:Unlimited
One Wire Example.c
Starting preprocessor: "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\pp.exe" "C:\Documents and Settings\Eric\Desktop\One Wire Example.c" -i "C:\Program Files\Matrix Multimedia\Flowcode V3\BoostC\include" -d _PIC16F877A -la -c2 -o "One Wire Example.pp" -v -d _BOOSTC -d _PIC16
C:\Documents and Settings\Eric\Desktop\One Wire Example.c(303): error: missing semicolon
C:\Documents and Settings\Eric\Desktop\One Wire Example.c(303): error: missing right paren
C:\Documents and Settings\Eric\Desktop\One Wire Example.c(299): error: failure
failure
.......
Return code = 1
Flowcode was unable to compile the flowchart's C code due to the following errors:
If your flowchart contains C code, please review this carefully. If your flowchart contains no C-code or you have thoroughly reviewed the code, contact Technical Support.
FINISHED
Do I made a mistake or is something wrong with the provided code?
Thanks for your help.
Error while compiling onewire component code
- 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: Error while compiling onewire component code
Hello
Please open up the custom component properties and for the line beginning %e add Delay in lable and 5 in value.
The 5 represents the number of instruction cycles to represent 1us delay. This depends on your clock speed.
Instruction speed = 1/4 clock speed.
Clock speed = 19.6608MHz
Instruction speed = 4.9152MHz
Instruction time = 1 / Instruction speed = 203.45ns
Number of Instruction cycles in 1us = 1us / 203.45ns = 4.91 = 5
Please open up the custom component properties and for the line beginning %e add Delay in lable and 5 in value.
The 5 represents the number of instruction cycles to represent 1us delay. This depends on your clock speed.
Instruction speed = 1/4 clock speed.
Clock speed = 19.6608MHz
Instruction speed = 4.9152MHz
Instruction time = 1 / Instruction speed = 203.45ns
Number of Instruction cycles in 1us = 1us / 203.45ns = 4.91 = 5
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
Re: Error while compiling onewire component code
Hi Benj,
Partialy success! The code compiles without errors now but the DS1820 generates a CRC error ( which means that the DS1820 is at least detected).
As I understood, you don't give support on these beta components. I can understand, but I need to know the hardware configuration of the DS1820 for which your program is developed, because the DS1820 can function in 2 modes: parasite power or external power. This makes a difference. Can you describe your hardware configuration?
In my configuration, VCC is connected to +5volt, DQ is connected to port D0 and via 10K to VCC ( which is the external power configuration)
Best regards,
Eric
Partialy success! The code compiles without errors now but the DS1820 generates a CRC error ( which means that the DS1820 is at least detected).
As I understood, you don't give support on these beta components. I can understand, but I need to know the hardware configuration of the DS1820 for which your program is developed, because the DS1820 can function in 2 modes: parasite power or external power. This makes a difference. Can you describe your hardware configuration?
In my configuration, VCC is connected to +5volt, DQ is connected to port D0 and via 10K to VCC ( which is the external power configuration)
Best regards,
Eric
- 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: Error while compiling onewire component code
Hello Eric
Yes while I was using the One Wire Sensors I was using the external powered mode of operation.
Are you sure that your clock speed setting in Flowcode matches your crystal. Also make sure that the chip configuration is set to XTAL mode. (HS mode in the expert screen for clocks over 4MHz).
Other then this the example file should be working.
I have also included an example that addresses multiple devices onto the Flowcode example page.
Yes while I was using the One Wire Sensors I was using the external powered mode of operation.
Are you sure that your clock speed setting in Flowcode matches your crystal. Also make sure that the chip configuration is set to XTAL mode. (HS mode in the expert screen for clocks over 4MHz).
Other then this the example file should be working.
I have also included an example that addresses multiple devices onto the Flowcode example page.
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
Re: Error while compiling onewire component code
Hi Benj,
Yes, I have noticed you added the multicomponent example.
But may I suggest you add the delay issue from your previous reply directly to the example program?
Meanwhile the project continues.
The crc error was solved with your previous delay solution in the properties.
22Β°C real life temperature now indicates 2.72 C on the lcd and the value varies with changing temperature.
Still not correct of course, but at least the program reads some values from the scratchpad.
I am using a 8MHZ crystal, Flowcode is set to 8 Mhz and HS mode is selected.
Regards
Yes, I have noticed you added the multicomponent example.
But may I suggest you add the delay issue from your previous reply directly to the example program?
Meanwhile the project continues.
The crc error was solved with your previous delay solution in the properties.
22Β°C real life temperature now indicates 2.72 C on the lcd and the value varies with changing temperature.
Still not correct of course, but at least the program reads some values from the scratchpad.
I am using a 8MHZ crystal, Flowcode is set to 8 Mhz and HS mode is selected.
Regards
Re: Error while compiling onewire component code
i have the same problem the LCD show 3.18c and the room temp is ~25c, Which is the problem ?
16F877
10Mhz
prop.%e.dalay = 2
Ds1820 Power Supply = External Mode
PD
In Parasitie supply = No device Found
Regards
16F877
10Mhz
prop.%e.dalay = 2
Ds1820 Power Supply = External Mode
PD
In Parasitie supply = No device Found
Regards