Re: [Amforth] Quiestion about SPI core word spirw.asm

2014-08-29 Thread Rafael Gonzalez
ok, understood. Thank you ! So the optimized routine would be do_spirw: out_ SPDR, tosl do_spirw1: in_ temp0, SPSR sbrs temp0, 7 rjmp do_spirw1 ; wait until complete in_ tosl, SPDR ret Greetings Rafael El Viernes 29 de agosto de 2014 19:37, Matthias Trute escribió:

Re: [Amforth] Quiestion about SPI core word spirw.asm

2014-08-29 Thread Matthias Trute
Hi Rafael, > do_spirw: > 1.out_ SPDR, tosl > do_spirw1: > 2.in_ temp0, SPSR > 3.cbr temp0,7 > 4.out_ SPSR, temp0 > 5.in_ temp0, SPSR > 6.sbrs temp0, 7 > 7.rjmp do_spirw1 ; wait until complete > 8.in_ tosl, SPDR > 9.ret > > In 1) we transmit a byte (and activa

[Amforth] Quiestion about SPI core word spirw.asm

2014-08-28 Thread Rafael Gonzalez
Hi Amforthers, I was learning a bit about the internals of the SPI driver and finally found the "core" word c!@spi I'm comparing side by side the assembler source with the 328P datasheet (=Arduino) and I can't understand completely the purpose of some of this code, which I list here for conven