AVR BUG!

For Flowcode users to discuss projects, flowcharts, and any other issues related to Flowcode 5.
To post in this forum you must have a registered copy of Flowcode 5 or higher.

Moderator: Benj

Post Reply
nnnnff
Posts: 107
Joined: Tue Oct 04, 2011 8:55 am
Has thanked: 3 times
Been thanked: 6 times

AVR BUG!

Post by nnnnff »

AVR 5.5,“NOT”No effect.Can the Flowcode simulation.Burn wrote chip is no reaction.Inside the proteus also no response!Help me.Thank you very much!
AVR bug.rar
(38.8 KiB) Downloaded 300 times

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: AVR BUG!

Post by medelec35 »

Hi nnnnff,
Have you tried

Code: Select all

b = !b
?

Martin
Martin

nnnnff
Posts: 107
Joined: Tue Oct 04, 2011 8:55 am
Has thanked: 3 times
Been thanked: 6 times

Re: AVR BUG!

Post by nnnnff »

caculation:why "!"do!"NOT"not?

medelec35
Matrix Staff
Posts: 9521
Joined: Sat May 05, 2007 2:27 pm
Location: Northamptonshire, UK
Has thanked: 2585 times
Been thanked: 3815 times

Re: AVR BUG!

Post by medelec35 »

On PIC ! always works for me,

Did it work for you?

Have you checked on hardware, or just simulation?
Martin

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: AVR BUG!

Post by Benj »

Hello,

The C code being produced is this.

Code: Select all

            //Calculation:
            //  b = NOT b
            FCV_B = ~FCV_B;
~ and ! are slightly different in their operations though your program looks to me like it should work. Hmm.

From stack overflow.
For integral types, ! returns true if the operand is zero, and false otherwise.
So !b here just means b == 0.
As far as I know ~ should flip all the bits in the value so 0x00 would become 0xFF which should work. I may however be wrong on this if its not working on the hardware.

Post Reply