anakin Posted May 5, 2009 Report Share Posted May 5, 2009 I'm studying the application SM_fast ( asm version) and I have some question on it, just for tryin' to understand the way it work.1)I'm searching where I can change the "scanning speed" of the keyboard: I think it is on main.asm here: movlw 10000 & 0xff movwf MIOS_PARAMETER1 movlw 10000 >> 8 movwf MIOS_PARAMETER2 movlw 0x00 call MIOS_TIMER_Init call SM_Init movlw 0x00 movwf SM_CH_STATUS movlw 0 call MIOS_AIN_NumberSet call MIOS_AIN_UnMuxed movlw 4;7 call MIOS_AIN_DeadbandSetit is right? If no where it is ?2)What's the difference in Sm-Fast and Sm_slow in performance? What's the difference in managing the scan matrix?Thank you for your help!Anakin Quote Link to comment Share on other sites More sharing options...
TK. Posted May 5, 2009 Report Share Posted May 5, 2009 1)I'm searching where I can change the "scanning speed" of the keyboardIt cannot be changed, as sm_fast scans the keyboard "so fast as possible" in an endless loop.If you prefer a defined scan period, use sm_slow.On the other hand - why do you want to change the speed?I think it is on main.asm here:No, the timer is only used to decrement the debounce counters.2)What's the difference in Sm-Fast and Sm_slow in performance? What's the difference in managing the scan matrix?sm_slow uses the common MIOS hooks to scan a matrix and can be used in parallel to other routines w/o drawbacks. E.g., I'm using the same approach for MBSEQ, MBSID, MBFM - and these are really CPU intensive applications.sm_fast is a hack which controls the SRIO chain directly so fast as possible. This should be done exclusively. No other routines should run in parallel.Best Regards, Thorsten. Quote Link to comment Share on other sites More sharing options...
anakin Posted May 5, 2009 Author Report Share Posted May 5, 2009 Hi Tk and thank you :)It's not a matter of changing the speed ( it is just as fast!) it is only for try to understand how it work as I'm bit new to asm.So, what does the code I posted stands for? I can't understand the reason of it and what does it mean.Ok , it is for the debounce counters but I don't know how it means, maybe it's better to search at google and then return here!For the difference between sm_fast and sm_slow thank you very much I understand ( so for example if I add a pot in a free ain port, it will stop the scanning of the matrix , right?)thanks!Anakin 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.