; ------------------------------------- ; dd-2.asm DIGITAL DICE ON A ATTINY13 ; Copyright (c) 2011 Mike Shegedin ; ezdenki.com ; Released under the GNU General Public License version 2 ; ; Chip: ATTiny13A-PU ; ; Revisions ; ; dd-1.asm, 101005 ; First attempt. Was able to manually set individual die segments on left right die ; and got multiplexing on the hardware working. ; ; dd-1a.asm, 101006 ; ; dd-2.asm, 101011 ; First attempt at full function. ; ; dd-2b.asm, 101020 ; Basic functionality. Dice are animated upon startup. Pressing roll button ; initiates brief roll animation and displays roll. ; To do: ; Enable Sleep/Wakeup modes. ; LED glows dimly when polling the button. Try to make it mostly invisible. ; ; dd-2c.asm, 101021 ; Added sleep functionality ; ; dd-2d.asm, 101027 ; Improved polling timing and blanking ; ; dd-2e.asm, 110923 ; General cleanup of code ; Improved consistency on sleep routine. ; Optimized for hardware that includes the one resistor. ; Reduced ghosting on center LED for hardware w/o resistor. ; dd-2f.asm, 110923 ; Greatly reduced ghosting due to polling by modifying button polling routine ; ; dd-2g.asm, 110925 ; Cleaned up code/comment formatting. No functional changes ; ------------------------------------- ; ; Die Segment (DSn) and associated Hardware Pin Definitions: ; ; DS1, center dot, PB0 ; DS2, upper-left and lower-right dot, PB1 ; DS3, upper-right and lower-left dot, PB2 ; DS4, left and right middle dots, PB3 ; LR , left/right die select, PB4 ; ------------------------------------- ; Setting die segments (DSn): ; ; The patterns in which die segments are lit depend on whether the left or right die ; is being accesed, as determeined by LR. LR=0 is the left die, LR=1 is the right. ; To set segments in the left die (LR=0), relative bits must be turned on (1). ; To set segments in the right die (LR=1), relative bits must be turned OFF (0). ; ; Example, set the left die to show a 3 (segments 1 and 2 lit) ; ; ldi TMP, (Lon< Power Down ldi tmp, (1< Power Down out MCUCR, tmp ldi tmp, (0<