Rowan Posted July 6, 2003 Report Share Posted July 6, 2003 Hi everyoneHere's an idea for a feature of MIOS.Having the ability to choose between linear ang log input's on the AIN's. Meaning that you could connect a log pot to the input's and then MIOS scales the sampled voltage to a linear output or vice versa.The math to do this is simple. Is MIOS and the 18F up to the job? I guess this is taking MIOS in to the realms of DSP on a very basic level.Any feed back would be helpfulRowan Quote Link to comment Share on other sites More sharing options...
ilmenator Posted July 6, 2003 Report Share Posted July 6, 2003 Hi Rowan,I think it's not so much a matter of maths but more of resolution (of the pots). Then you might experience a not so precise sampling of values in the upper or lower area of the pot, so something like "jitter" might occur (though technically speaking, this is no jitter). You might not be able to access certain values anymore, like say there's a direct jump from 125 to 127, without being able to enter 126.Regards, ilmenator Quote Link to comment Share on other sites More sharing options...
TK. Posted July 7, 2003 Report Share Posted July 7, 2003 Yes Ilmentor, and this jitter will be especially appear in the region where the output curve of the logarithmic pot has it's highest increase rate where a sampled voltage value changes between 4V and 5V without moving the pot.However, the implementation of a scale table is very simple, especially if only 7bit values should be converted. Insert a table into your source code with 128 values: Conversion_Table db 0x7f ; value #0x00 db 0x7e ; value #0x01 db 0x7d ; value #0x02 [..] db 0x01 ; value #0x7e db 0x00 ; value #0x7f Now you can convert a pot value in this way: ;; 7-bit pot value saved in TMP1 ;; move converted pot value to TMP2 TABLE_ADDR Conversion_Table movf TMP1, W ; get pot value 0x00-0x7f TABLE_ADD_W ; add WREG to table pointer tblrd*+ ; read from table movff TABLAT, TMP2 ; copy table entry to TMP2 Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
Rowan Posted July 7, 2003 Author Report Share Posted July 7, 2003 HiThanks for the feed back. Thorsten, Cool. This is just what I needed to know. Rowan Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.