Grendel: Reduced polling rate of 3D Pro?

For system help, all hardware / software topics NOTE: use Coders Corner for all coders topics.

Moderators: Krom, Grendel

Post Reply
User avatar
Wasp
DBB Ace
DBB Ace
Posts: 31
Joined: Wed Sep 24, 2008 11:19 am

Grendel: Reduced polling rate of 3D Pro?

Post by Wasp »

Grendel,

Is there any way to deliberately reduce the rate at which the teensy updates so that even if a game should poll at say 250Hz the stick would only be updating at say 16Hz?

I'm trying to counter the affects of a games increased update rate which has completely screwed over the joystick users.
User avatar
Grendel
3d Pro Master
3d Pro Master
Posts: 4390
Joined: Mon Oct 28, 2002 3:01 am
Location: Corvallis OR, USA

Re: Grendel: Reduced polling rate of 3D Pro?

Post by Grendel »

Yes and no. The time delay between joystick readings is measured by timer 0. It's an 8-bit timer and thus is limited to a maximum time of 16.3ms, or, a readout frequency of 61Hz. The line

#define READ_DEL MS2TM( 4.5, 1024 )

at the beginning of main.c defines this delay,

#define READ_DEL MS2TM( 16.3, 1024 )

would be setting it to 61Hz. To make it slower the code needs to modified to either use a 16bit timer or by adding a software divider (ie. read the stick after T0 expired 2 or 3 times.) The latter would be easier to do.
Post Reply