RS-232 Read/Write from Machine Language
Moderator: Moderators
RS-232 Read/Write from Machine Language
Are there any source examples out there for reading from and writing to the RS-232 port from assembly?
Re: RS-232 Read/Write from Machine Language
Do you mean directly or via KERNAL calls? I've written a prog that accepts Intel HEX from the serial port and writes it to memory using KERNAL routines.
Re: RS-232 Read/Write from Machine Language
KERNAL calls are fine. In fact preferred, I think. I want to keep the code small. 192 bytes in the cassette buffer.
Re: RS-232 Read/Write from Machine Language
Any examples that can read/write at 9600 baud would be fantasic for using (configuring) the 10$ ethernet adapter...
Re: RS-232 Read/Write from Machine Language
Here's my complete program, the setup of the serial port is near the start. I tripped over a 'feature' that BASIC works around. The OPEN call returns with Cb set and $F0 in .A on success, it's a side-effect of calling MEMTOP at the end of OPENRS...
I've only used 1200 baud. It should work up to 2400 baud, beyond that I don't think the software implementation of the 6551 is stable.beamrider wrote:Any examples that can read/write at 9600 baud would be fantasic for using (configuring) the 10$ ethernet adapter...
- Attachments
-
- ihex.zip
- (1.81 KiB) Downloaded 69 times
- joshuadenmark
- Big Mover
- Posts: 1217
- Joined: Sat Oct 23, 2010 11:32 am
- Location: Fr-Havn, Denmark
- Occupation: Service engineer
Re: RS-232 Read/Write from Machine Language
Just ran a setup at 1200 baud rate from windows 10 - seemed to work
Module used: [USR-TCP232-2] Serial RS232 to Ethernet TCP/IP Converter Module http://www.usriot.com/Product/24.html
This post actually should be moved to this thread, my mistake:
http://sleepingelephant.com/ipw-web/bul ... =11&t=7464
Module used: [USR-TCP232-2] Serial RS232 to Ethernet TCP/IP Converter Module http://www.usriot.com/Product/24.html
This post actually should be moved to this thread, my mistake:
http://sleepingelephant.com/ipw-web/bul ... =11&t=7464
Kind regards, Peter.
____________________________________________________
In need of a wiki logon - PM me
____________________________________________________
In need of a wiki logon - PM me
Re: RS-232 Read/Write from Machine Language
Isn't that setting it to1200, the setup process would be conducted at 9600 by the software?
Sent from my Nexus 5 using Tapatalk
Sent from my Nexus 5 using Tapatalk
- joshuadenmark
- Big Mover
- Posts: 1217
- Joined: Sat Oct 23, 2010 11:32 am
- Location: Fr-Havn, Denmark
- Occupation: Service engineer
Re: RS-232 Read/Write from Machine Language
kind of both - I've set the COM3 (in windows) to 1200 baud and ran the setup tool and then set the card to 1200 baud too.
But I doesn't know if this program can override the windows setting for COM3 port?
But I doesn't know if this program can override the windows setting for COM3 port?
Kind regards, Peter.
____________________________________________________
In need of a wiki logon - PM me
____________________________________________________
In need of a wiki logon - PM me
Re: RS-232 Read/Write from Machine Language
Yes, its a parameter in the win32 openfile API.
Sent from my Nexus 5 using Tapatalk
Sent from my Nexus 5 using Tapatalk
Re: RS-232 Read/Write from Machine Language
Try a terminal emulator like Realterm set it to 1200 or 2400 and try to configure it manually with the config string. I'd be surprised if it works.
Sent from my Nexus 5 using Tapatalk
Sent from my Nexus 5 using Tapatalk
- joshuadenmark
- Big Mover
- Posts: 1217
- Joined: Sat Oct 23, 2010 11:32 am
- Location: Fr-Havn, Denmark
- Occupation: Service engineer
Re: RS-232 Read/Write from Machine Language
First a connection with SyncTerm to the BBS (IP show in post above) - something is working - at a slow rate - when it stopped I pressed Enter and some more characters showed up.
Kind regards, Peter.
____________________________________________________
In need of a wiki logon - PM me
____________________________________________________
In need of a wiki logon - PM me
Re: RS-232 Read/Write from Machine Language
That looks like garbage caused by an incorrect baud rate to me.
Use a loopback connector (I use a paper clip to poke in the tx and rx connectors ) to check that you have successfully configured the device (@1200 baud) to talk (@1200 baud).
Use the terminal emu, set the baud rate to 1200 (and switch off local echo) and you should be able to type characers and see them on screen.
Use a loopback connector (I use a paper clip to poke in the tx and rx connectors ) to check that you have successfully configured the device (@1200 baud) to talk (@1200 baud).
Use the terminal emu, set the baud rate to 1200 (and switch off local echo) and you should be able to type characers and see them on screen.
Re: RS-232 Read/Write from Machine Language
Thanks srowe, this is very helpful.srowe wrote:Here's my complete program, the setup of the serial port is near the start. I tripped over a 'feature' that BASIC works around. The OPEN call returns with Cb set and $F0 in .A on success, it's a side-effect of calling MEMTOP at the end of OPENRS...
I've only used 1200 baud. It should work up to 2400 baud, beyond that I don't think the software implementation of the 6551 is stable.beamrider wrote:Any examples that can read/write at 9600 baud would be fantasic for using (configuring) the 10$ ethernet adapter...
Keys