Omnimaga

Calculator Community => TI Calculators => Calculator C => Topic started by: _player1537 on August 29, 2010, 12:02:11 pm

Title: Nspire time
Post by: _player1537 on August 29, 2010, 12:02:11 pm
Is there something to return the time on the Nspire?  Like a function, or a ram area or something?
Title: Re: Nspire time
Post by: fb39ca4 on August 29, 2010, 12:08:02 pm
Yeah, there are memory mapped timers. See  here  (http://hackspire.unsads.com/wiki/index.php/Memory-mapped_I/O_ports#900D0000_-_Second_timer)for the addresses. I haven't used the timer, though.
Title: Re: Nspire time
Post by: ExtendeD on August 29, 2010, 12:13:52 pm
There is also an RTC documented here: http://hackspire.unsads.com/wiki/index.php/Memory-mapped_I/O_ports#90090000_-_Real-Time_Clock_.28RTC.29
Title: Re: Nspire time
Post by: _player1537 on August 29, 2010, 12:14:02 pm
Ok, so what I need it for is to start at 0, and count up, and then check it later.  It seems like I'm going to need to set the bits like this (although I don't know how to in C):
900D0014 (location)
Bits:
00001111

That should: Run the timer, increase timer (instead of decrease), and run infinitely.  Is that correct?

Edit: actually, it looks like ExtendeD posted closer to what I wanted :)  But I still don't know how to read from that spot :/
Title: Re: Nspire time
Post by: bwang on August 29, 2010, 12:18:29 pm
Code: [Select]
int time = *(volatile unsigned*) 0x90090000
Be warned that this clock cannot measure any interval less than 1 second long.
Title: Re: Nspire time
Post by: _player1537 on August 29, 2010, 12:22:10 pm
Oh... ok.  I'll keep this information, I don't think I'll need it just yet, but I might have an idea for a game using this :D