??? 02/07/05 09:39 Read: times |
#86731 - Let's compare parallel vs. serial Responding to: ???'s previous message |
Let's make a minimalist assumption - plain vanilla '51.
Parallel variant: memory-mapped 74xx573-like latches. LoadLED: mov dptr,#MemoryAddress mov p2,#HIGH(LatchAddress) mov r0,#LOW(LatchAddress) mov r2,#LatchesCount Loop: movx a,@dptr ;2 cycles inc dptr ;1 cycle movx @r0,a ;2 cycles inc r0 ;1 cycle djnz r2,Loop ;2 cycles = 8 cycles per loop Serial variant: a chain of 74xx595 connected to RxD/TxD, UART in mode 0 (SPI-like). LoadLED: mov dptr,#MemoryAddress mov r2,#LatchesCount clr LatchPin Loop: movx a,@dptr ;2 cycles inc dptr ;1 cycle mov sbuf,a ;1 cycle nop ;1 cycle nop ;1 cycle nop ;1 cycle nop ;1 cycle djnz r2,Loop ;2 cycles = 10 cycles per loop setb LatchPin Where is your significant speedup with the parallel solution? Moreover, Erik suggested you to load 8 serial lines simultaneously, then there is no overhead. And, I would never do a 1:32 multiplex unless the datasheet for your LEDs claim they can be pulsed with a 32x nominal current; otherwise your overall brightness will be low. Jan Waclawek |