A little bug in V5
Moderator: Benj
- Crenwick
- Posts: 127
- Joined: Sun Aug 07, 2011 1:40 pm
- Location: Belgium
- Has thanked: 7 times
- Been thanked: 21 times
- Contact:
A little bug in V5
Hello,
I'm working today for the first time on V5 with a new project and are facing a little bug (maybe the first )
When I try to write to Eeprom the result is allways 0. When I try the same prog on V4 it's ok so ...
I attached a little demo.
My project is an automatic phonedialer for my alarm system and I need to store my cell number in Eeprom
Can you please check ?
Is it also possible to create a V5 folder on the forum ?
And how can I change the version of Flowcode in my signature ?
Sorry for all the questions
Bernard
I'm working today for the first time on V5 with a new project and are facing a little bug (maybe the first )
When I try to write to Eeprom the result is allways 0. When I try the same prog on V4 it's ok so ...
I attached a little demo.
My project is an automatic phonedialer for my alarm system and I need to store my cell number in Eeprom
Can you please check ?
Is it also possible to create a V5 folder on the forum ?
And how can I change the version of Flowcode in my signature ?
Sorry for all the questions
Bernard
- Attachments
-
- Eeprom test.fcf
- (6 KiB) Downloaded 325 times
Last edited by Crenwick on Wed Jan 18, 2012 3:01 pm, edited 1 time in total.
Bernard
Flowcode 6 / EB006-V9
Flowcode 6 / EB006-V9
- petesmart
- Valued Contributor
- Posts: 395
- Joined: Thu May 06, 2010 11:42 am
- Location: Sydney, Australia
- Has thanked: 187 times
- Been thanked: 140 times
- Contact:
Re: A little bug in V5
Hi,
I understand that you do not have the issue with V4, however on certain chips under circumstances that I have yet to fully identify, I have had reliability issues with writing to location 0 on the physical chip. Simulation works fine, however to ensure repeatable success on the hardware I have adopted a practice of starting from address location 1 skipping address location 0.
Not sure if this helps, however it might be worth a try.
All the best
Pete
I understand that you do not have the issue with V4, however on certain chips under circumstances that I have yet to fully identify, I have had reliability issues with writing to location 0 on the physical chip. Simulation works fine, however to ensure repeatable success on the hardware I have adopted a practice of starting from address location 1 skipping address location 0.
Not sure if this helps, however it might be worth a try.
All the best
Pete
sorry about that Chief!
- Crenwick
- Posts: 127
- Joined: Sun Aug 07, 2011 1:40 pm
- Location: Belgium
- Has thanked: 7 times
- Been thanked: 21 times
- Contact:
Re: A little bug in V5
Hi,
Well I tryed on two different chips on the ten first positions and wathever I try to write it's allways 0.
Sorry for Matrix Staff to give you extra work
Bernard
Well I tryed on two different chips on the ten first positions and wathever I try to write it's allways 0.
Sorry for Matrix Staff to give you extra work
Bernard
Bernard
Flowcode 6 / EB006-V9
Flowcode 6 / EB006-V9
- 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: A little bug in V5
Hello,
I can confirm that this is a simulation only bug and that the code is working as expected on the hardware. At least for the 16F88 device which I have just tested.
I can confirm that this is a simulation only bug and that the code is working as expected on the hardware. At least for the 16F88 device which I have just tested.
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
- Crenwick
- Posts: 127
- Joined: Sun Aug 07, 2011 1:40 pm
- Location: Belgium
- Has thanked: 7 times
- Been thanked: 21 times
- Contact:
Re: A little bug in V5
Thanks Ben,
By the end of the week I will be ready with my PCB.
You all at Matrix have done a big job
Regards,
Bernard
By the end of the week I will be ready with my PCB.
You all at Matrix have done a big job
Regards,
Bernard
Bernard
Flowcode 6 / EB006-V9
Flowcode 6 / EB006-V9
- STibor
- Posts: 263
- Joined: Fri Dec 16, 2011 3:20 pm
- Has thanked: 116 times
- Been thanked: 113 times
- Contact:
Re: A little bug in V5
Hello!
I would like to write a lcd screen UINT, ULONG, and Long variables.
I see the V5 Flowcode LCD screen print numbers are manageable variables<= Int. A later improvement in the macro lcd?
I would like to write a lcd screen UINT, ULONG, and Long variables.
I see the V5 Flowcode LCD screen print numbers are manageable variables<= Int. A later improvement in the macro lcd?
- Attachments
-
- counter.fcf
- (9 KiB) Downloaded 326 times
- JonnyW
- Posts: 1230
- Joined: Fri Oct 29, 2010 9:13 am
- Location: Matrix Multimedia Ltd
- Has thanked: 63 times
- Been thanked: 290 times
- Contact:
Re: A little bug in V5
Hello.
Create a calculation and type:
buffer = ToString$(variable)
Where buffer is a string and variable is a long or UINT.
You can then display 'buffer' on the LCD.
Jonny
You can write signed long integers to a string using the ToString$(variable) function. You can then write this string to the LCD.I would like to write a lcd screen UINT, ULONG, and Long variables.
Create a calculation and type:
buffer = ToString$(variable)
Where buffer is a string and variable is a long or UINT.
You can then display 'buffer' on the LCD.
Jonny
- 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: A little bug in V5
The NumberToHex function will also work with Long variable types to give you a hexadecimal string you can send to the LCD.
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
- STibor
- Posts: 263
- Joined: Fri Dec 16, 2011 3:20 pm
- Has thanked: 116 times
- Been thanked: 113 times
- Contact:
Re: A little bug in V5
Decision errors when testing two variables.
a = 1 AND b = 64 then c = 4
a = 1 AND b = 64 then c = 4
- Attachments
-
- decision.fcf
- (10 KiB) Downloaded 259 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: A little bug in V5
Hi STibor
When using multiple conditions and using 'AND' you will need to use brackets.
Try either
(a = 1) AND (b = 64)
or
you should be able to use a = 1 && b = 64
since though discussions with MM staff it is generally accepted that AND should be use for bitwise only.
Whereas && should be used for bytewise operations.
I would recommend
(a = 1) && (b = 64) as the correct format so I don't believe its a bug
Martin
Edit after testing I have come to the conclusion that:
(a = 1) AND (b = 64) = bytewise operation
and
a = 1 AND b = 64 is bitwise that's why it does not work!
But
a = 1 AND b = 1 will work since either value is not >1
When using multiple conditions and using 'AND' you will need to use brackets.
Try either
(a = 1) AND (b = 64)
or
you should be able to use a = 1 && b = 64
since though discussions with MM staff it is generally accepted that AND should be use for bitwise only.
Whereas && should be used for bytewise operations.
I would recommend
(a = 1) && (b = 64) as the correct format so I don't believe its a bug
Martin
Edit after testing I have come to the conclusion that:
(a = 1) AND (b = 64) = bytewise operation
and
a = 1 AND b = 64 is bitwise that's why it does not work!
But
a = 1 AND b = 1 will work since either value is not >1
Martin
- STibor
- Posts: 263
- Joined: Fri Dec 16, 2011 3:20 pm
- Has thanked: 116 times
- Been thanked: 113 times
- Contact:
Re: A little bug in V5
Thank you for your response.
I wrote Flowcode4.5 program continue in Flowcode5 .
Flowcode5 was only a simulation of a faulty, coded program is good.
I wrote Flowcode4.5 program continue in Flowcode5 .
Flowcode5 was only a simulation of a faulty, coded program is good.
- Attachments
-
- decision Flowcode 45.fcf
- Flowcode 4.5
- (4.5 KiB) Downloaded 210 times
-
- Matrix Staff
- Posts: 9520
- Joined: Sat May 05, 2007 2:27 pm
- Location: Northamptonshire, UK
- Has thanked: 2585 times
- Been thanked: 3815 times
- Contact:
Re: A little bug in V5
Ah, so a = 1 AND b = 64 works on hardware and not simulation.STibor wrote: Flowcode5 was only a simulation of a faulty, coded program is good.
So it is a simulation bug, but work round is easy.
I would not have niticed that since if multiple statements I enclose with brackets.
Thanks for that information
Martin
Martin
- JonnyW
- Posts: 1230
- Joined: Fri Oct 29, 2010 9:13 am
- Location: Matrix Multimedia Ltd
- Has thanked: 63 times
- Been thanked: 290 times
- Contact:
Re: A little bug in V5
Yes. The Flowcode simulation works on a grammar which defines which order to eveluate the operators in, like the C compiler. I thought I had all the operators in the same order as C but maybe not for AND. I'll check this on Monday. As you say, the workaround is easy, but I hope this does not effect too many legacy programs.
Jonny
Jonny
- Steve
- Matrix Staff
- Posts: 3422
- Joined: Tue Jan 03, 2006 3:59 pm
- Has thanked: 114 times
- Been thanked: 422 times
- Contact:
Re: A little bug in V5
If the intention of your code is to check that the value of a is 1 and the value of b is 64, then I recommend you use the "logical" operator "&&" as suggested by Martin. Also, using brackets will help make the code's intention more obvious:
Code: Select all
(a = 1) && (b = 64)
- STibor
- Posts: 263
- Joined: Fri Dec 16, 2011 3:20 pm
- Has thanked: 116 times
- Been thanked: 113 times
- Contact:
Re: A little bug in V5
Thank you all for your help!
There will be an example-program package to Flowcode5?
Eeprom->Storing and retrieving Long(ULong) variables.
New adc functions. etc.
There will be an example-program package to Flowcode5?
Eeprom->Storing and retrieving Long(ULong) variables.
New adc functions. etc.