Well, that's going to be tough to beat. Nice work Darrel.
Interesting side note: Using your rlf STATUS,F approach reduced my 13 word version to
only 12 words..;o}
Code:list p=16F628A #include <P16F628A.inc> errorlevel -302 ; suppress message 302 from list file __CONFIG _CP_OFF & _BODEN_ON & _MCLRE_OFF & _WDT_ON & _PWRTE_ON & _LVP_OFF & _INTOSC_OSC_NOCLKOUT clrf PORTB ; clear port rlf STATUS,F ; Bank1, clear carry for 1st rotate bcf OPTION_REG,2 ; 1:8 prescaler to WDT Left sleep ; go to sleep for ~1 second rlf TRISB,F ; rotate 0 from carry into lsb, then left across trisb btfsc TRISB,7 ; jump to Right once trisb,7 = 0 goto Left Right sleep ; go to sleep for ~1 second rrf TRISB,F ; rotate bit right across trisb btfsc TRISB,0 ; jump to left once trisb,0 = 0 goto Right ; loop until trisb,0 = 0 goto Left ; now rotate back to the left end




Bookmarks