Hi,
There is none.This is my question... what is the command for accessing the internal clock?
No, you're not looking in the wrong place because there is no such command or function call.I may be looking in the wrong places but I can't find it anywhere.
Yes, timers would work and timers is exactly what those other chips are using (and using up, stopping you from using them the way you wish) to provide you with the millis() function call etc. So no you can't "just" ask the PIC "What time is it now" - if you don't have a PIC with built in RTC obviosuly, in which case you could ask it EXACTLY that.I see stuff that appears to be timers, and I guess that would work, but can't I just ask the PIC "What time is it now?"
No it's not. It can most certainly do it but you need to write the code for.Is it not keeping a clock cycle tally from bootup?
At the very least you set one of the hardware timers up to derive its clock from the main oscillator and there you have your cycle counter. You read the timer as you read any other register in the PIC, no special function calls etc.
For example, TMR1 is a 16 bit wide counter/timer. It's pretty much setup to be a "tick counter" at start up, all you need to do is enable itFrom now on TMR1 will tick at Fosc/4 but you can scale that down by using the prescaler.Code:T1CON.0 = 1 ' Start TMR1
But, instead of calculating the velocity based on BOTH the time delta and the position delta, why not simply make sure you poll the position at a specific interval? That way you know when the velocity is changing without doing a lot of math.
Finally, PBP and PICAXE are both BASIC but they are not the same. They are similar in some ways, different in others.
/Henrik.




Bookmarks