I'm using the Silicon Laboratories C8051F345 with the Keil IDE.
I now have two different projects of which the firmware won't execute. If I comment random pieces of code the firmware will execute. I am still within the memory limits of the device.
From my point of view, the compiler is not configured correctly for the device or I assign my variables incorrectly. I ran out of ideas, tired of searching and pulled almost all my hair out of my head.
I program alone and don't have anyone to look at my source.
I want to ask if someone experienced will please have a look at my project to point any possible mistakes or problems.
I have read umpteen posts - all with different symptoms - that were solved by killing the dog in startup. The 'secret code' that executes between startup and main seems to be the culprit.
Do yourself a favor and kill the dog right here
STARTUP1: ;; disable watchdog (should be enabled after initialization) mov xxxx ; Disable WDT
If that is not it (I'll bet you dollars to doughnuts it is) you have spent two minutes on eliminating one possible cause.
By the way, this is not a PC so you MUST have void main (void)
{ .... while(1) {
..... }
}
Erik
OK! I apologize erik. I killed the dog in the startup and the firmware executed!!! Do I owe you dollars or donuts?
Anyway, let me not get too excited yet. Let me first test that everything is working fine and I'll let you guys know.
Don't get so upset about the main(). It is implemented as you show, I just "abbreviated".
Funny how the dog can cause such funny symptoms?
Do I owe you dollars or donuts? as I bet you dollars to doughnuts, you could owe me a doughnut Krispy Kreme, please :) But since you did not accept the bet you are home free.
Funny how the dog can cause such funny symptoms? not really, the dog is asynchronous to the code, and thus can hit any possible way. There has been posts such as "when I remove one variable, it starts working'
Glad we got you going
But it all makes sense now. If I am correct, that explains the reason when I add more code (more variables) it will stop working.
During startup all these variables need to be initialized and the more variables to initialize the more time it takes. And if I don't look after the puppy during this time it will cause a reset. So just kill the puppy!
So just kill the puppy! ... when you get going (if it is anything critical) resussicate the puppy at the start of main()