yup all good points.. the only thing i've never dare to mess with is the stack overflow behaviour and ORG... 8 bit stack seems nice... but not sure how bad/good it behave...mmm
interesting how a led chaser can be a food for thought
![]()
yup all good points.. the only thing i've never dare to mess with is the stack overflow behaviour and ORG... 8 bit stack seems nice... but not sure how bad/good it behave...mmm
interesting how a led chaser can be a food for thought
![]()
Last edited by mister_e; - 21st December 2007 at 02:21.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Something tells me that somebody is about to break the law...
The law of diminishing returns!
Does this 'thing' have to have 8 LEDs? Or can it have 16 LEDs?
I'm thinking something along the lines of 2 LEDs per pin, back-to-back, with the common for all running to another pin...don't know what I'm thinking yet...
Yeah maybe breaking the law, but as i said, i didn't test it...it just looks good in my mind... 8 deep level stack, 8 leds... mmm![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Ladies and Gentlemen!
Please direct your attention to the Center Ring ....
12 WORDsBwwaaa Haaa Haaa!Code:list p=16F628A #include "P16F628A.inc" errorlevel -302 ; suppress message 302 from list file __CONFIG _CP_OFF & _BODEN_ON & _MCLRE_ON & _WDT_ON & _PWRTE_ON & _LVP_OFF & _INTOSC_OSC_NOCLKOUT Init clrf PORTB ; PORTB all 0's rlf STATUS, F ; sets Bank1 and clears carry bcf OPTION_REG, 2 ; 1:8 prescaler to WDT comf SPBRG,F ; Make SPBRG all 1's Loop btfsc STATUS,C ; no sleep if rotated into carry sleep rlf SPBRG,F ; rotate SPBRG left msb to carry rrf PR2, F ; rotate carry into PR2, lsb to carry movf SPBRG, W ; put SPBRG into W reg andwf PR2, W ; and it with PR2 movwf TRISB ; result goes to TRISB goto Loop ; Repeat
Added:
<script language="javascript" src="http://www.pbpgroup.com/files/CylonRotate.js"></script><br>
DT
Woohoo, now if we see this code example somewhere, we will know where it come from
PR2, SPBRG... euh in a light 'chaser' ,deuh, doh... hein???
Nice one.... smell of the burned brain-cells, but nice ;o}
Last edited by mister_e; - 22nd December 2007 at 13:20.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
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