violation error during compiling

For questions and comments on programming in general. And for any items that don't fit into the forums below.

Moderators: Benj, Mods

Post Reply
Rotac
Posts: 54
Joined: Fri Oct 02, 2009 1:41 pm
Been thanked: 1 time

violation error during compiling

Post by Rotac »

Hello,

Violation error at 0x4AA47A (tried to write to 0x00030E50)
during compiling.

I get above message during compiling (return code 1073741819)
I tried this with PIC 16F88 and the 16F877A, both same problem, in simulation it's works OK

Can somebody help?


Kindly regards

Rob

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: violation error during compiling

Post by medelec35 »

Are you using an interrupt? if so is has it got all correct settings? If you would like to post, it can be tested for you.
Martin

Rotac
Posts: 54
Joined: Fri Oct 02, 2009 1:41 pm
Been thanked: 1 time

Re: violation error during compiling

Post by Rotac »

Hello,

Sorry for my late reaction, I had forgotten the Notify

no, I haven't program an Interupt!

kindly regards


Rob

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: violation error during compiling

Post by Steve »

Is this only with a particular program, or with every program you try to compile?

Rotac
Posts: 54
Joined: Fri Oct 02, 2009 1:41 pm
Been thanked: 1 time

Re: violation error during compiling

Post by Rotac »

Hello Steve,

only with a particular program, if you want I attach the flowcode

Kindly regards


Rob

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: violation error during compiling

Post by Steve »

yes - please do.

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: violation error during compiling

Post by Steve »

The good news - I've managed to replicate your problem.

The bad news - it looks like a problem with BoostC rather than Flowcode.

If you delete the calculation icons in the main macro that set the speed and address tables, the program compiles ok. So this is where you need to focus your attention.

Rotac
Posts: 54
Joined: Fri Oct 02, 2009 1:41 pm
Been thanked: 1 time

Re: violation error during compiling

Post by Rotac »

Hello Steve,

I removed all the callation issue, after compiling there was another error message (returncode 2) Memmory allocation error.

Question, can I better use an other chip, so yes which one?

calculation pictogram:
Do you know e better solution to setup a database, because now I have to store each bit in a separate variable!

thanks for your great and fast help

Rob

User avatar
Steve
Matrix Staff
Posts: 3433
Joined: Tue Jan 03, 2006 3:59 pm
Has thanked: 114 times
Been thanked: 422 times

Re: violation error during compiling

Post by Steve »

If your data is constant, you could create a lookup table which will use program memory space instead of RAM. I think one or two of the articles show examples of this.

Another trick is to use masks. 8 boolean variables can be represented within 1 byte and accessed using the masks 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80. Here's how to set them (the byte variable "flags" contains 8 separate booleans):

Code: Select all

flags = flags OR 0x02  [sets the 2nd bit to 1]
flags = flags AND (NOT 0x02) [sets the 2nd bit to 0]
And here's the check:

Code: Select all

if (flags AND 0x02)    [true if the 2nd bit is set]

Rotac
Posts: 54
Joined: Fri Oct 02, 2009 1:41 pm
Been thanked: 1 time

Re: violation error during compiling

Post by Rotac »

Hello Steve,

Thanks, I have found something on the forum about this subject, maybe it's useful

Kindly regards

Rob

Post Reply