Jump to content

SM_fast


anakin
 Share

Recommended Posts

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_DeadbandSet

it 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

Link to comment
Share on other sites

1)I'm searching where I can change the "scanning speed" of the keyboard

It 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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...