aboutsummaryrefslogtreecommitdiff
path: root/forth/forth/avr/task2-test.fs
blob: 2897fe1f2859c73a962c24f32e67202d6052d826 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
\ *******************************************************************
\                                                                   *
\    Filename:      task2-test.txt                                  *
\    Date:          01.03.2014                                      *
\    FF Version:    5.0                                             *
\    MCU:           Atmega 328(Olimex AVR-P28)                      *
\    Copyright:     Mikael Nordman                                  *
\    Author:        Mikael Nordman                                  *
\ *******************************************************************
\ FlashForth is licensed according to the GNU General Public License*
\ *******************************************************************
\ Demo for the Olimex AVR-P28 with Atmega328P. Blinks led in 
\ background task.
single
-task2
marker -task2
ram hex
\ Registers for Atmega 328P. Change if needed
$0028 constant portc
$0027 constant ddrc
$20 constant pin5

ram variable delay

: ledoff  pin5 portc mset ;
: ledon   pin5 portc mclr ;

0 18 20 0 task: task2
: task2loop 
  100 delay !
  pin5 ddrc mset  \  Output
  begin
    delay @ ms 
    pin5 portc mtst
    if
       ledon
    else
       ledoff
    then
  again
;

: t2go ['] task2loop task2 tinit task2 run ;

' t2go is turnkey
warm