\ 300_delays.fs -- delays for the 300 chip -- 06Feb08 rjn
\
\
\ -----[ 300 I/O ]
\ these shouldn't be need if 300SFR.fs is updated, chip init ok -- 06Feb08 rjn
\ $e1 constant XBR0   \ port I/O crossbar Register 0
\ $e2 constant XBR1   \ port I/O croosbar Register 1
\ $e3 constant XBR2   \ port I/O crossbar Register 2

$a4 constant P0MDOUT \ should be done by /chip in application -- 06Feb08 rjn

] \ Target Forth

:m pin3  3 .P0 m;
:m low   [ pin3 set ] m;
:m high  [ pin3 clr ] m;
 
: us  ( n - )   
   7 #for  
      6 #  6 #for 6 #next  
   7 #next ;

: ms  ( n - )   
   7 #for 
      100 #  6 #for 
         81 #  5 #for 5 #next 
      6 #next 
   7 #next ;

:m push-pull  $FF # P0MDOUT ior! m;

: init   push-pull ;

\ measured 9.632 us high, 9.756 low (51.58 kHz) on a scope
: test1   init  begin  high 10 # us low 10 # us  again ;

\ measured 9.642 us high, 45.36 us low
: test2   init  begin  10 # us high  50 # us low  again ;

\ measured 10.00 ms high, 10.00 ms low
: test3   init  begin  10 # ms high 10 # ms low  again ;
\
\
0 [if] -------------------------[ comments ]-----------------------------------

 1. Somewhat clunky original version.  See 310_delays.fs for better
 2. The values measured for other delays in the 310 delays are approximately
    correct for the 300 running on its internal clock. 
------------------------------------------------------------------------ [then]
\
\
0 [if] ------------------------[ revisions ]-----------------------------------

Date	By	Comment
=======	===	===============================================================
06Feb08 rjn     Added comment about applicability of 310 delays, swapped 
                 definitions of high and low (outputs were inverted)
21Aug06 rjn     Initial version

------------------------------------------------------------------------ [then]


