You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
alee-forth/msp430/examples/uart.txt

14 lines
325 B
Plaintext

\ UART example, 19200 baud, pins D0/1
: uart-init ( -- )
bit5 bit6 or p2sel0 byte set
ucswrst uca1ctlw0 reg set
ucssel__smclk uca1ctlw0 reg set
52 uca1brw reg!
18688 ucos16 or ucbrf0 or uca1mctlw reg!
ucswrst uca1ctlw0 reg clear ;
: uart-emit ( n -- )
begin uca1ifg reg@ uctxifg and until
uca1txbuf byte! ;