prjbrook

blockdefs (t0 and t0) working well

Nov 30th, 2014
315
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.12 KB | None | 0 0
  1. .org $e00 ;this is where last 1K defs go
  2.  
  3. ;.db " ", $0d
  4. .db " : bA ; ", $0d
  5. ;.db ": not 0= if one else zero endif ; : cn constant ; : d. depth . ; : v variable ; ", $0d ;all handy
  6.  
  7. ;.db ": 1= 0= not ; : 1+ one + ; : inc dup @ 1+ swap ! ; ", $0d
  8. .db "0058 cn TIFR : TOVO 0001 TIFR ; 0036 cn PINB 0053 cn TCCR0B v c1 v c2 0037 cn DDRB" ,$0d
  9. .db " 0052 cn TCNT0 : inputVal 0001 PINB bit@ ;" , $0d
  10. ;.db " : startT0 0001 TCCR0B c! ; " ,$0d
  11. .db ": TOVInt 0001 0059 setbit ; " ,$0d ;enable TOCO and also do sei
  12. .db ": TOVIntX 0001 0059 clrbit ; : globInt 0007 005f setbit ; " ,$0d ;enable TOCO and also do sei
  13. .db " : (t0 stopT0 TOVInt globInt zero dup k0 ! TCNT0 c! startT03 ; : t0) stopT0 globIntX TOVIntX ;", $0d
  14. ; use above like this OK} (t0 delay100ms t0) k0 @ . TCNT0 c@ . $0d Got less than 1% error over 100ms
  15. ;: globIntX 0007 005f clrbit ; <--couldn't get this towork
  16. ;.db " : stopT0 0000 TCCR0B c! ; ", $0d
  17. .db " : sst globInt TOVInt 0000 TCNT0 c! 0000 k0 ! ; ", $0d ;startT0 stopT0 k0 ? TCNT0 c@ . globIntX ; " , $0d
  18. ;.db "testingstopper",$0d ;only used during testing.No effect otherwise
  19.  
  20. .db "finishblock",$0d
Advertisement
Add Comment
Please, Sign In to add comment