Trying to debug some flakey code recently, so want to clear up a question about GCBasic wait routines. Looking at the source code, it might appear that using 'wait xx us' delays with an 8mhz osc would be illegal? Yet, a software Uart code that uses 'wait 104 us' with no problem. But I know on occasion, the compiler will complain that 'us' delays not supported, or something to that effect.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
On 20 MHz and higher chips, GCBASIC uses a delay subroutine for the us delay. This means that it can handle both variables and constants as length parameters.
On chips that are less than 20 MHz, it creates inline delay code. To do this, it needs to know the length of the delay beforehand and thus only constants can be used.
This doesn't apply to any other delays, since they're all long enough to call without adding significant extra overhead.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I appreciate the clarification, Thanks, that helps! The delay was like 'wait RMotorOut 10us', so its somewhere else.
Been trying to decode an R/C transmitter signal. It seems that by luck a valid signal is presented to the 16f684. The difficultly is changing the R/C signal to a suitable PWM. Had the PWM down cold with a substitute potentiometer, inserted back into the main code, tinkered with it, then lost it. Oh well, back to the grindstone.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Trying to debug some flakey code recently, so want to clear up a question about GCBasic wait routines. Looking at the source code, it might appear that using 'wait xx us' delays with an 8mhz osc would be illegal? Yet, a software Uart code that uses 'wait 104 us' with no problem. But I know on occasion, the compiler will complain that 'us' delays not supported, or something to that effect.
On 20 MHz and higher chips, GCBASIC uses a delay subroutine for the us delay. This means that it can handle both variables and constants as length parameters.
On chips that are less than 20 MHz, it creates inline delay code. To do this, it needs to know the length of the delay beforehand and thus only constants can be used.
This doesn't apply to any other delays, since they're all long enough to call without adding significant extra overhead.
I appreciate the clarification, Thanks, that helps! The delay was like 'wait RMotorOut 10us', so its somewhere else.
Been trying to decode an R/C transmitter signal. It seems that by luck a valid signal is presented to the 16f684. The difficultly is changing the R/C signal to a suitable PWM. Had the PWM down cold with a substitute potentiometer, inserted back into the main code, tinkered with it, then lost it. Oh well, back to the grindstone.