EmbeddedRelated.com
Forums
The 2024 Embedded Online Conference

controlling 68HC11 board from Serial Port

Started by AndreyGleener October 17, 2004

I am not a programmer at all, so my question most likely will be
silly. Yet I'd love to figure it out!

I thought to make use of NMIN-0021 board which is 68HC11 processor
with embedded Buffalo Momnitor or Max-Forth language. I thought to
connect the board to Host PC and write to Serial Port of
NMIN-0021 commands that will make it 'do tricks' without
programming the 68HC11. I need very little: set pins of Output Port
high/low and read A/D converter.

From the description of 68HC11 I learned that to set up pins of the
port I need to write to it's registers:

writing 01 at address $1004 should set pin PB0 to +5v

For data acquisition, I want

Write 00 to register $1030 then

Read register $1030 in a loop. When $1030 is more then 128
(conversion completed), I would read

Read register $1031

- That's all I need - the rest I can do in my PC in Visual Basic. I
read manual for Buffalo Monitor and Max-Forth list of commands and I
can not comprehend how to do it either way. Please help me - explain
and maybe send me a small example.

Sincerely,

Andrey



Presuming MAX-FORTH works as one would expect (I've had the kit here
for ten years or more, yet to try it out!),

> writing 01 at address $1004 should set pin PB0 to +5v

HEX 01 1004 C! (may need to go DECIMAL later; reads "value, address,
( Character_put" - language is otherwise word-oriented)

> For data acquisition, I want
> Write 00 to register $1030 then

00 1030 C!

> Read register $1030 in a loop. When $1030 is more then 128
> (conversion completed), I would read

BEGIN
1030 C@ ( Read character at address )
128 > ( 128 is the reference, is greater? )
UNTIL ( exit loop when true )

>
> Read register $1031

1031 C@ ( Read character at this address )

. ( Print it out, on this system, presumably to terminal )
( That was, by the way, a "dot". )

To enter this all as a "word" (program element), encapsulate the text
(leave out all bracketed, BTW) in:

: READ_INPUT ( define a word of this name )
( all above code )
; ( complete definition )

And execute it by entering that same word; "READ_INPUT". Capitals are
probably not critical.
--
Cheers,
Paul B.




Thank you Paul,

looks so simple when you've done it. I did not realize FORTH is built
around symbols, like in good old days. Got so used to look for words,
descriptors ...

Andrey

--- In , "Paul B. Webster" <paulb@m...> wrote:
> Presuming MAX-FORTH works as one would expect (I've had the kit
here
> for ten years or more, yet to try it out!),
>
> > writing 01 at address $1004 should set pin PB0 to +5v
>
> HEX 01 1004 C! (may need to go DECIMAL later; reads "value,
address,
> ( Character_put" - language is otherwise word-
oriented)
>
> > For data acquisition, I want
> > Write 00 to register $1030 then
>
> 00 1030 C!
>
> > Read register $1030 in a loop. When $1030 is more then 128
> > (conversion completed), I would read
>
> BEGIN
> 1030 C@ ( Read character at address )
> 128 > ( 128 is the reference, is greater? )
> UNTIL ( exit loop when true )
>
> >
> > Read register $1031
>
> 1031 C@ ( Read character at this address )
>
> . ( Print it out, on this system, presumably to
terminal )
> ( That was, by the way, a "dot". )
>
> To enter this all as a "word" (program element), encapsulate the
text
> (leave out all bracketed, BTW) in:
>
> : READ_INPUT ( define a word of this name )
> ( all above code )
> ; ( complete definition )
>
> And execute it by entering that same word; "READ_INPUT".
Capitals are
> probably not critical.
> --
> Cheers,
> Paul B.





The 2024 Embedded Online Conference