[Flashforth-devel] empty for PIC24 family
Brought to you by:
oh2aun
|
From: Peter J. <pe...@me...> - 2014-04-28 12:47:19
|
Mike,
I'm having a bit of fun updating the tutorials and extending them (a
little) to the other architectures to which you've ported FF.
A small problem that I'm having tonight is that "empty" does not
seem to reset the dictionary back to its original state of the
PIC24FV16KM202. If I put in a marker, I can take the dictionary back to
the state before that marker, however, I forgot to do that before
defining a few words and now I don't seem to be able to remove those
words (short of reprogramming the chip).
Also, for the assembler words bset, and bclr, the order of bit and
register-address arguments seem to be the reverse of the PIC18 family.
Why is that? (Just asking out of curiosity and, since I know almost
nothing about the assembly language of these machines, I don't mind
being told to read the docs.)
Regards,
Peter J.
-speed-test
marker -speed-test
\ For the PIC24FV16KM202, waggle RB15 as quickly as we can,
\ in both high- and low-level code.
$02c8 constant trisb
$02ca constant portb
$02cc constant latb
$02ce constant odcb
1 #15 lshift constant bit15
: initRB15
bit15 trisb mclr \ RB15 as output
bit15 latb mclr \ initially known state
;
\ high-level bit fiddling, presumably slow
: blink-forth ( -- )
initRB15
begin
bit15 latb ! 0 latb ! \ one cycle, on and off
bit15 latb ! 0 latb !
bit15 latb ! 0 latb !
bit15 latb ! 0 latb !
cwd \ We have to kick the watch dog ourselves.
again
;
\ low-level bit fiddling, via assembler
: blink-asm ( -- )
initRB15
[
begin,
#15 latb bset, #15 latb bclr, \ one cycle, on and off
#15 latb bset, #15 latb bclr,
#15 latb bset, #15 latb bclr,
#15 latb bset, #15 latb bclr,
] cwd [ \ kick the watch dog
again,
]
;
|