The German electronics Magazin Elektor distributed in its December 2005 issue a Renesas-R8C-Board produced by Glyn. The Software by Glyn distributed in the Magazin contained a C-Cross-Compiler for Windows. But it is more interesting to have a Forth System on this CPU.
The System is now production quality.
ram and rom the user can switch between compilation in (Flash-) ROM and RAM flashc! and flash!.:dovar is located at an address (
20 cells allot rom:noname bgtask @ 0= ?EXIT
rp@ bgtask @ sp@ cell+ bgtask ! sp! rp! ;
IS pause
: task r> bgtask
20 cells + bgtask
10 cells + bgtask ! ;
:noname echo @ IF
BEGIN pause key? UNTIL THEN (key) ;
is key
ram</code>
An adapted version of the Blinkenlights Demo above:
rom : light! led! &100 ms ; : run 1 light! 2 light! 4 light! 8 light! 4 light! 2 light! ; : blinkenlights task BEGIN run AGAIN ; ram
Similar to the Blinkenlights we can create a Text Scroller. The scroll speed is controlled with the potentiometer on ADC channel 6.
rom
Create text
," GNU Forth EC R8C -- Microprozessor -- "
Create ledtable 1 c, 2 c, 4 c, 8 c, 4 c, 2 c,
Variable /text
: scroller task
BEGIN text count /text @ over mod /string
16 min dup >r lcdpage lcdtype
r@ 16 < IF text 1+ 16 r@ - lcdtype THEN
rdrop 1 /text +!
/text @ 6 mod ledtable + c@ led!
6 adc@ 2/ ms
AGAIN ;
ram