Jump to content
arudzki

Serial Communication

Recommended Posts

All,

I have a question about sending out serial messages from the XL/XE.  If I have a board with a UART on it, can I just use the DATAIN, DATAOUT and COMMAND signals on the SIO port and handle the serial communication myself with code and the POKEY registers?  

 

Secondly, are there any tutorials on doing this?  

 

Thanks in advance.

 

Tony

 

Share this post


Link to post
Share on other sites

There's various methods of SIO that can be done - unclocked, clocked by internal or external source though most usage cases see the clocking done by Pokey.

 

You can also bit-bang but it's a fairly rare thing - the default cassette handler the only OS based thing that uses it and only for determining timing requirements at the start of each block read.

 

Pokey does the byte level IO automatically for you but it uses 0 start bit, 8 data bits lsb first then a 1 stop bit.   You get no choice to change any of that (unless you bit-bang).

Many external Atari and 3rd party peripherals just assume a default bitrate or use special commands to set a higher one and don't use the clocking facility.  Generally the stop to start bit transition is sufficient to compensate for any slight timing differences.

 

All the signalling is 0/5 Volt levels (though the specs have high/low voltage levels that are assumed for 0 & 1s)

 

Depending on what you want to do you can either have your device behave like an Atari smart peripheral, waiting for the Command line to go low then reading the command frame and responding if the device ID matches your own.

Or just act as a dumb peripheral, assuming it's the only device on the bus and deal with the raw serial data.

 

Tutorials and such - not a great deal around I think.

I wrote a 1050 emulator on the ST about 30 years ago and referred to the Atari OS and Hardware manuals - they have needed stuff like the framing and command protocols and timing requirements (e.g. if your device responds too fast it can be missed)

I no longer have the source for it - I sold the ST I had and it was on floppies for DBasic which in itself is probably a lost product as it uses a custom 1K sector format.

  • Like 3
  • Thanks 1

Share this post


Link to post
Share on other sites

How do you bitbang on a Pokey. Can you use it as a 1 bit I/O to control a transistor for example. Turn on. Turn off. I understand the logic level is 4V on and 0 V off which falls into TTL logic spec. Just wondering how to take control of ensuring it goes true and false without worrying about it inserting start bits and stop bits.

Share this post


Link to post
Share on other sites

When nothing's going on there'll be "1" present on the output.

There's an SKCTL bit called "force break" which forces output to "0".

 

Toggling that bit is how you do bit-banging.  Using /Command is optional for your own projects - in fact you'd probably be better off using Motor Control as having Command active while doing your own IO might confuse other peripherals.

  • Thanks 2

Share this post


Link to post
Share on other sites
On 1/18/2021 at 5:04 AM, arudzki said:

I have a question about sending out serial messages from the XL/XE.  If I have a board with a UART on it

You could always use something like an Arduino, it has Serial Ports and also libraries for Software Serial if

you want more than one Serial line

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...