Why do I get different answers from the same math process?
krazyideas
Posts: 119
Hello,
I have a program have been fighting with. I decided to run another propellor chip to double check it.
The one gives me an answer of 9000, while the other gives me an answer of 4500.
Besides one useing the TV·object to show me the result, and the other useing the FullDuplexSerialPlus to show me the result, they are twins. At least as far as I can see.
I have been fighting this for a couple hours and I am out of ideas.
Could the crystal be bad, or the chip? something.
Here they are
Any thoughts would be great.
I have a program have been fighting with. I decided to run another propellor chip to double check it.
The one gives me an answer of 9000, while the other gives me an answer of 4500.
Besides one useing the TV·object to show me the result, and the other useing the FullDuplexSerialPlus to show me the result, they are twins. At least as far as I can see.
I have been fighting this for a couple hours and I am out of ideas.
Could the crystal be bad, or the chip? something.
Here they are
Any thoughts would be great.
Comments
1). In the second program, you bitwise encode the pin number. This makes a completely different number (2^21) than just setting it equal to 21 (10101)
2). In the second program, you delay by 50_000_000 less cycles.
This line (in both programs) is in error. According to the Propeller Manual, cnt is a read only resource. It appears that the compiler doesn't check for this, but it's still wrong.
As a side note, you should be able to use the same program for both setups, since TV_text and FDSP share some of the same methods (like str, dec, and tx). So, if you name both objects the same, and have both calls to their start, you can comment one out at a time, and easily switch when the need arises.
That was just a mistake I did when I was copy and pasteing into a smaller folder, so I could post it.
Sorry bout that
It still gives me to anwsers, one twice the size of the other. The crystals are the same and everything.
I would fix the problems and post the code again. If you are not trying what you post can you try the test code that you post so we are not trying to debug something different from you are running, sometimes a bug elsewhere can affect other parts of your code.
Thanks so much
Thanks so much