Re: Amiga serial port programming question

From: Marko Mäkelä (marko.makela_at_hut.fi)
Date: 2004-01-24 12:34:54

Hi Luca, Daniel,

> did you try to query the serial device using SDCMD_QUERY? Not sure if this
> is what you want: maybe you can show us a piece of code?

I tried that, but it didn't seem to have any effect.  Besides, according
to the NDK 3.5 documentation, SDCMD_QUERY sets io_Actual to the count of
unread _input_ characters, not unwritten (or written) output characters.

> I would be glad to help more, I have a huge number of Amiga's at home, and
> programmed a lot on AmigaOS, but no C2N232 adapters at all...

If you have a null-modem cable and a terminal program, that should be enough.
The function for detecting the C2N232 would need to be commented out, or the
timeout would have to be made longer.  Other than that, the problem can be
debugged with a terminal program.

There can be similar problems with the cbmlink serial routines on AmigaOS,
and cbmlink supports null-modem connections to 8-bit CBMs equipped with 6551.

> BTW, why should this be OT here? Amiga was made from CBM as well! :-)

Well, I never had an Amiga, and I don't consider it a "real" Commodore, since
the design was bought, not made in-house.  But I guess that's my problem. :-)

On Sat, Jan 24, 2004 at 10:11:38AM +0100, Daniel Kahlin wrote:

> I don't really remember much of the Amiga specific detail, but in over5 
> (0.711), I seem to ignore data read in blocks that got timeout.

Reading is not a problem; there, AbortIO works, and io_Actual is set to a
meaningful value (or at least I didn't have any problems with it so far).
The problem is writing.

> I attached the file bl_serial.c which is the Amiga serial-drivers for 
> over5, originally based on Olaf Barthel's 'Term' code.

The only function that does CMD_WRITE is SerWrite, and it uses DoIO(), which
blocks until completion.  So, there is no write timeout.  BTW, the strlen
call is unnecessary in SerWrite.  If io_Length is set to -1, the serial
line driver will assume that io_Data points to a NUL-terminated string.

I looked at the C-Kermit source code, and it appears to send characters
input from the console one at a time.  That works for a terminal program,
but I don't think that the full bandwidth of a 38400 bps serial line could
be saturated that way.

	Marko

       Message was sent through the cbm-hackers mailing list

Archive generated by hypermail pre-2.1.8.