Re: [Flashforth-devel] Assembler Loops
Brought to you by:
oh2aun
From: Thomas B. <bus...@gm...> - 2014-07-21 17:14:13
|
Dear Mikael, thank you very much for helping. I test the program and it runs good, but every 1 ms I get a error (like a delay). Please see at attachment. Is that a watchdog? Greetings Thomas The files are here (Logic/Screenshot) -> http://wikisend.com/download/584094/pwm_old.logicdata http://wikisend.com/download/785422/Bildschirmfoto 2014-07-21 um 19.03.36.png 2014-07-11 16:46 GMT+02:00 Mikael Nordman <mik...@pp...>: > Here is example for bitbanging 16 bits on a spi interface. > It uses the FSR1L(=Tp) and FSR1H(=Tp 1 +) > temporary registers which are always free to be used in > any assembly word. > > Note that FSR1H is only 4 bits wide. FSR1L is 8 bits wide. > > Srw and Sminus words are accessing the parameter stack indirectly. > > There are also other registers that can safely be used as variables in > assembler words. > FSR2L FSR2H TBLPTRL TBLPTRH TABLAT PRODL PRODH > The registers are located in access ram so no bank bits need to be set. > > : spi! ( u -- ) > [ #2 movlw, ] > [ Tp a, movwf, ] > [ begin, ] > [ #8 movlw, ] > [ Tp 1+ a, movwf, ] > [ begin, ] > [ Srw f, a, rlcf, ] > [ cc, if, lata sdata a, bsf, else, lata sdata a, bcf, then, ] > [ lata sclk a, btg, ] > [ lata sclk a, btg, ] > [ Tp 1+ f, a, decf, ] > [ z, until, ] > [ Sminus w, a, movf, ] > [ Tp f, a, decf, ] > [ z, until, ] > ; > > Mike > > > > ------------------------------------------------------------------------------ > Open source business process management suite built on Java and Eclipse > Turn processes into business applications with Bonita BPM Community Edition > Quickly connect people, data, and systems into organized workflows > Winner of BOSSIE, CODIE, OW2 and Gartner awards > http://p.sf.net/sfu/Bonitasoft > _______________________________________________ > Flashforth-devel mailing list > Fla...@li... > https://lists.sourceforge.net/lists/listinfo/flashforth-devel > -- www.aloedb.org - database for aloes |