gforth
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gforth] problem with gforth7 and serial access


From: Dennis Ruffer
Subject: Re: [gforth] problem with gforth7 and serial access
Date: Thu, 22 Mar 2012 20:05:57 -0700

Bill,

I haven't actually used serial in gforth in the last 5 years, and Forth has
become a background hobby for me, at this point.  The best I can do is guess
and give you some generic guidance.

You would have to setup a prompting system if that is what you want.  I've
always tending to use hard coded settings for that very reason.

It looks like there is some kind of translation from COMx to /dev/ttyx, but
I don't remember enough about how I got around that.

I've attached some old code that I had working 5 years ago on a Mac.  It may
help or it may just confuse you some more.  Either way, I no longer even own
a Mac to figure out how to make it work today (;e.g. absolutely no warranty
implied or inferred;).

Good luck.

DaR

-----Original Message-----
From: address@hidden
[mailto:address@hidden On Behalf Of kibler
Sent: Thursday, March 22, 2012 3:25 PM
To: address@hidden
Subject: Re: [gforth] problem with gforth7 and serial access

the "test" works fine - but serial is still dead.
Now all we need to do is change the "do this" line in the terminal.fs to
match.

from terminal.fs
\ examples of using terminal:
\
\   COM2 B9600  c" 8N1" terminal     ( terminal on com2 at 9600 baud, 8N1 )
\   COM1 B57600 c" E71" terminal     ( terminal on com1 at 57.6 Kbaud, 7E1 )

Any idea how to change one of the parameters from a prompt?

Another question that I keep forgetting, how do we change from
/dev/ttyS0 to /dev/ttyUSB0? Does it even work on USB converters?
Bill.

On 03/22/12 15:02, Dennis Ruffer wrote:
> Try typing : test COM1 B38400 c" 8N1" terminal ; into a definition.  
> There error is trying to tell you that c" can't be interpreted.
>
> DaR
>
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On Behalf Of kibler
> Sent: Thursday, March 22, 2012 2:28 PM
> To: Bernd Paysan
> Cc: address@hidden
> Subject: Re: [gforth] problem with gforth7 and serial access
>
> I just completed some testing that got me nowhere.
> I tried both 7.0 and 7.9 both with same results.
>
> Basically my setup is thus - I have SiLabs board connected to 
> /dev/ttyS0 running at 38400 Baud, and sending a non-stop full page of 
> text that includes the cpu temperature and mem dump of a web page.
>
> When using minicom, I get the full page of output, refreshing at about 
> a one second rate. No problems with minicom, works as expected.
>
> Run gforth inside the contrib directory after changing the terminal 
> program to do 38400 instead of the 9600 - nothing.
> Try and run the string and get:
>
>     ok
> COM1 B38400 c" 8N1" terminal
> :8: Interpreting a compile-only word
> COM1 B38400>>>c"<<<  8N1" terminal
> Backtrace:
> $7FBA30F8ECF8 throw
>
> Do "term" and get only a blank screen, F1 doesn't do anything. Should 
> be seeing the same text I see in minicom, but nothing - no errors, no 
> help, nothing.
>
> Got any ideas what might be going on?
> Will look at the R8C code next for ideas.
> Have two serial ports, so will next try "term" talking to one, and 
> minicom talking on other to see if that works.
> Bill.
>
>
> On 03/22/12 08:36, Bernd Paysan wrote:
>> Am Donnerstag, 22. März 2012, 08:30:52 schrieb kibler:
>>> I am currently looking at the entire contrib section and it seems 
>>> that the c-lib calls are in 7.0, and as such then we might only have 
>>> to load the entire contrib set to get working serial on 7.0 versions.
>>> I will try that later today, as that seems like a do-able compromise.
>>> We would just need to ship all of those files with our own code - an 
>>> option we already use.
>>>
>>> Thanks Bernd for the suggested arch code - I will look at that as 
>>> well, but my minor checking says that the select code is broken, and 
>>> thus I would expect that to not work - assuming my testing is valid 
>>> - not always a good assumption to make.
>> The terminal.fs code in arch/r8c is not architecture-dependent, it is 
>> just an application for the R8C board, using the serial interface of 
>> a PC.  And it does not use the select code of key_avail.
>>
>> I don't know why the select code should not work on serial lines, 
>> this must be a bug in Linux.
>>
>
>
>


Attachment: TestSerial.f
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]