Serial programming, hardware handshaking
Hey. Beginner Amiga (and Motorola) coder here.
I have some serial communication going on in assembler on the Amiga, and some send/receive on my PC. It's running in 9600 baud on a 040 accelerated Amiga 1200 with minor problems, but it's without hardware handshaking, checking the register SERDATR for incoming data and resetting INTREQ bit 11. When sending, writing to SERDAT with stop bit and waiting for bit 13 of SERDATR to clear (though I should probably switch those two operations :) ) The PC side was quite straight forward, but when I turn on hardware handshaking the transfer just hangs. Questions: * Is the Amiga capable of this? * Do I need to do something else than what is described in the hardware manual from page 250 and onward (what I described above). * Any idea why it halts? The Amiga code: http://pastebin.com/1BYjr01P The PC code: http://pastebin.com/yR7isyxv Would be cool with faster baud rates but also to run on slower Amigas... Why? Why not? :-) PS. If somebody has some serial programming reference code I would love to see it! Ds. |
Quote:
Quote:
Quote:
Quote:
Quote:
EDIT: Just saw you wrote that you're a beginner, so you're probably not hitting the hardware for fun? I should mention that there is also serial.device, which works fine. Certainly faster than 9600 bps on a 040. |
Thanks for your reply!
Messing around with the CIA-B seems to be over my head right now but perhaps writing an interrupt routine would be a good step for me to try. To be honest I haven't tried 38400/57600 but I tried 19200 and got far too many errors even there, but there are some optimizations I could do in the code too I guess, to fine tune the performance. Yeah I'm poking the hardware with my beginner stick, but having lots of fun in the meantime. I do this in pure asm, serial.device is a c library no? Anyhow, it's working, I just want it to perform better for no particular reason, but as you suggested, writing a interrupt might be doable. |
From my experience with the Amiga serial port...
You get 19200 Baud on an Amiga (A500/A1000/A2000) with 68000 CPU (@ 7MHz) using standard serial device (WB 1.2 or WB 1.3) and decent terminal program (eg. JR-Comm), 38400 Baud can be achieved with faster serial device and tweaking screen mode (number of colours), etc. A plain A1200 gives you 57600 Baud using standard serial device (WB 3.1) and decent terminal program (eg. NComm), with any accelerator (020/030 CPU) over ~30Mhz you can do 115200 Baud. The "hardware" part of RTS/CTS refers to the physical RS-232 pins in the serial port to handle the handshake, as opposed to XON/XOFF handshaking which is "soft" as in characters sent by software in the data flow. I haven't done any serial programming on the Amiga, so can't help much there. |
Thanks anyway, the performance is interesting information!
Didn't think about switching screenmode to gain a few cycles, good idea. Can't run WB, I run my program on boot, it waits for a package to be received from the PC, unpacks it and runs the executable from it, that way I can set up a programming environment on the PC but run on the real hardware. It works already, just wanna fine tune the transfer... works good on the accelerated 1200, but the stock 1200 doesn't run as smoothly, but I suspect 19200 should be achievable with it from your tests.. I'll optimize the code :) Like this: https://www.facebook.com/thec77/vide...5/?pnref=story only I wrap my code with Makefiles and send it to the amiga with the install script. |
Quote:
since you're hitting the hw directly, have you shut the system down properly? otherwise the os may interfere with what you're doing... |
Quote:
|
Quote:
One obvious speedup would be compression. |
Go for floppy port - HW and faster than UART - 250/500kbps should be supported by most good UART2USB (almost sure it should be supported by FTDI).
btw http://aminet.net/package/comm/misc/easytransfer |
Quote:
|
Quote:
.. yeah, of course there is similar programs out there now that I spent the whole month for research and coding, but, since coding for the amiga is just for kicks anyway, no problem :-) As a complete n00b (didn't even own one back in the day) these things are not easy to find... |
Quote:
In case of Amiga UART, Copper can be used to output data (as such fast Tx rate) but problem is R(x)eception - UART in Paula is not buffered like 16550 on PC (16 byte FIFO) and every byte will create interrupt - this can kill multitasking efficiently - perhaps block oriented transfer may help a bit but still - this is serious limitation for vanilla Amiga. Btw - level (voltage) translator used in Amiga (old 1488/1489) can be serious limitation - it can be desired to replace them with something more modern (faster) for example MAX232 like IC's- when FDD serial is used this not a limitation - just use FTDI232 with TTL level translator. |
Quote:
|
Quote:
Unrelated, I'm having a strange error now in my code, I'll post about it later. |
Quote:
|
Quote:
|
All times are GMT +2. The time now is 11:56. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.