Sign in to follow this  
n4gix

25 KHz Tunable

Recommended Posts

A MODULE_VAR like COM_FREQUENCY normally returns a BCD value for the frequency, less the most significant digit.For example, if the COM1 frequency is currently 118.25, then MODULE_VAR com_frequency = { COM_FREQUENCY }; lookup_var(&com_frequency); UINT32 bcd = com_frequency.var_value.d;would set bcd == 0x1825. Now, what if you enable 25 KHz tuning, by setting COM_RADIO_25_KHZ_TUNABLE true?Does this just mean the final digit can now be '2' or '7' in addition to '0' or '5', and you interpret that to me .025 MHz or .075 MHz?

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Yep.... That's precisely what you do. For my fully-featured Collins RTU (Radio Tuning Unit) I developed string-based BCD2DEC() and DEC2BCD() functions to handle this situation.As it turns out, it's actually a lot faster than using the typical bit-shifing conversion function... ;)

Share this post


Link to post
Share on other sites

>Oh? Did you profile it or eyeball that measurement? :DI reasoned it out using logical thinking... fewer operations equals faster execution... ;)If both methods are 'translated' to assembly equivalents, the string method requires less than one-third of the operations as the bit-shifing method.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this