(* Changing the 12 bytes parameter block for MSP430 Flash versie

Word: Flash      00 - Flash programming frequency word
Byte: dco-lb     02 - Low byte address
Byte: sw-bit     03 - Bit number for switch
Word: Pin-addr   04 - Address of input port
Byte: br0        06 - Low byte baudrate
Byte: br1        07 - High byte baudrate
Byte: mctl       08 - Tuning baudrate
Byte: leds       09 - Bit mask for leds
Word: Pout-dir   0A - Address of output port

Examples:

ACTUAL              \ Changes for Egel kit
A562 10F8 DCO       \ 16 MHz
0C 01 A0 BAUDRATE   \ 38K4
TEST                \ Try it out
YES!                \ Retain

ACTUAL              \ Changes for Micro Launchpad
A562 10F8 DCO       \ 16 MHz
0C 01 A0 BAUDRATE   \ 38K4
TEST                \ Try it out
YES!                \ Retain

ACTUAL              \ Changes for noForth button vsn-1
06 00 D0 BAUDRATE   \ 38K4
20 20 SWITCH        \ Switch S2 at P1.5
TEST                \ Try it out
YES!                \ Retain

*)

create TEMP  0C allot
: .CONFIG       \ Print configuration data for MSP430!
    cr temp @+ u.  count 1000 or u. ."  DCO   \ flash dco"
    cr count u.  @+ u. ."  SWITCH   \ mask addr"
    cr count >r count >r count .  r> . r> . ."  BAUDRATE    \ br2 br1 br0"
    cr count u.  @ u.  ."  LEDS   \ mask addr"
    cr ;

: DCO       ( flash dco -- )    temp 2 + c!  temp ! ;
: SWITCH    ( mask addr -- )    temp 4 + !  temp 3 + c! ;
: BAUDRATE  ( br2 br1 br0 -- )  temp 6 + c!  temp 7 + c!  temp 8 + c! ;

: TEST      ( -- )              temp config ;

: ACTUAL    ( -- )
    frozen2 temp 0C move  .config ;

: YES!      ( -- )
    frozen  here  [ #segm 0C - ] literal  tidy)
    temp  frozen2 0C rommove ;

\ End
