hallo ich bin gerade dabei eine spi -> 1 wire bridge zu proggen und will dazu einen 2343 nehmen (ohne ext. quarz). für das slave transfer des sw spi habe ich folgende routine: SLAVE_TRANSFER: ;r16 wird transferiert cbi SCK_PORT ;cbi MISO_PORT ;set in SALVE_TRANSFER_0 cbi MOSI_PORT ;mosi pull-up off cbi SCK_DDR sbi MISO_DDR cbi MOSI_DDR ldi r20, 8 ;8 bits to transfer SLAVE_TRANSFER_0: sbi MISO_PORT sbrs r16, 7 ;change if miso line should not be high cbi MISO_PORT SLAVE_TRANSFER_1: sbis SCK_PIN ;wait for h on sck rjmp SLAVE_TRANSFER_1 rol r16 ;get to next bit sbr r16, 0 sbis MOSI_PIN ;change if bit in read register should not be set cbr r16, 0 SLAVE_TRANSFER_2: sbic SCK_PIN ;wait for l on sck rjmp SLAVE_TRANSFER_2 subi r20, 1 ;one bit more to transfer brne SLAVE_TRANSFER_0 ret Kann man die Routine noch schneller machen (abgesehen von loop unrolling - was nicht in frage kommt)? Gut wären so 8-11 clocks anstatt 13... danke
Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.