Jump to content
IGNORED

SIO coding for Atari 400/800 examples?


Recommended Posts

Can anyone point me to a simple code example for talking to the SIO port? I did this about 30 years ago and darn if I can remember how. I know I had to set the audio frequency register for the clock or baud rate. but still trying to digest the OS manual on how I did that. for the desired frequency. also I know that I set SKCTL for async but in this instanse I want to use sync.

 

Can anyone help?

 

Basically I am trying to determine if my SIO is working on the 800.

 

 

This thread looked promising but I am not seeing the Atari end of the code.

 

http://atariage.com/forums/topic/209010-sio2pi-raspberry-pi-as-a-floppy/

Edited by spinnaker15136
Link to comment
Share on other sites

Look at Mapping the Atari. $300 is a good place to start.. Look at SIOV $E459. here: Mapping The Atari-Memory Map

 

$300 is the device handlers.

$E459 looks more promising but I can't make heads or tails of what that document is trying to say.

But I think I need to go deeper. I think I nee to set the clock with

 

AUDF4 $D206 but still havn't figured out how to set the frequency.

 

Then set bit 5 of SKCTL $D20f Found this in my OS guide. Again not entirely sure I understand what they are saying about it in the memory map in the link you provided.

 

Finally write to SEROUT $D20D

 

I addition to the frequency of the clock, what I can't figure out is how to know if the transmit buffer is busy or not. I can't remember if I can poll it or have to use an interrupt vector.

 

Of course I would like someone to confirm all of this theroy.

 

I must have been a lot smarter close to 40 years ago. ;)

Link to comment
Share on other sites

This looks promising

 

https://www.atarimax.com/jindroush.atari.org/asio.html

 

But time to get some sleep now. Real work tomorrow.. :(

 

 

Than again maybe not so promising. :) But it looks like $E459 is the wrong track. Looks like that is for talking to one to the devices. I think I need to go deeper since I really don't have a device. Unless it is going to put data out on the port anyway?

 

 

OK time for sleep now. Really. :)

Link to comment
Share on other sites

Hi!

 

Can anyone point me to a simple code example for talking to the SIO port? I did this about 30 years ago and darn if I can remember how. I know I had to set the audio frequency register for the clock or baud rate. but still trying to digest the OS manual on how I did that. for the desired frequency. also I know that I set SKCTL for async but in this instanse I want to use sync.

 

Can anyone help?

 

Basically I am trying to determine if my SIO is working on the 800.

 

 

This thread looked promising but I am not seeing the Atari end of the code.

 

http://atariage.com/forums/topic/209010-sio2pi-raspberry-pi-as-a-floppy/

Read from here for examples to setup serial communication registers: http://atariage.com/forums/topic/279135-sio-from-basic/?p=4035193

 

Have Fun!

Link to comment
Share on other sites

The stock OS SIO only uses a small fraction of the abilities. And only uses 2 bitrates ~ 600 for tape and ~ 19.2K for everything else.

 

Useful programming examples in the official docs of the day are actually pretty thin on the ground. In fact most examples will be doing disk IO via $E453 rather than lower level SIO via $E459 which is more versatile as it allows specifying block size.

 

I made a 1050 emulator on the ST about 30 years ago - what I did find handy regarding that was the timing diagrams and descriptions of command and ack flow etc.

Link to comment
Share on other sites

Can anyone point me to a simple code example for talking to the SIO port? I did this about 30 years ago and darn if I can remember how. I know I had to set the audio frequency register for the clock or baud rate. but still trying to digest the OS manual on how I did that.

Personally I prefer the official documentation that here is very comprehensive: http://www.atarimania.com/documents/atari-400-800-hardware-manual.pdf

 

There are several samples, including again, the routines Atari actually used at the OS or at DOS.

 

also I know that I set SKCTL for async but in this instanse I want to use sync.

 

Hmm, are you sure you want to use synchronous mode? Atari peripherals don't use synchronous mode.

 

... what I can't figure out is how to know if the transmit buffer is busy or not. I can't remember if I can poll it or have to use an interrupt vector.

Pokey transmitter status can be checked at IRQST. You can poll or use an interrupt.

 

Basically I am trying to determine if my SIO is working on the 800.

...

But it looks like $E459 is the wrong track. Looks like that is for talking to one to the devices. I think I need to go deeper since I really don't have a device. Unless it is going to put data out on the port anyway?

SIO will of output some data anyway. Will output a command frame and retry if there is no response. Eventually will timeout but your code can retry calling SIO constantly, if you want.

 

I guess you realize that diagnosing SIO without a device can only be limited. You can scope SIO output if you want, but you can't fully test the receiver and the input channel.

Edited by ijor
Link to comment
Share on other sites

Just issuing a CSAVE command from Basic can determine if Pokey is able to transmit. Just enter a couple of lines first with random characters after REM.

 

If you have a floppy drive that doesn't respond it could be numerous things. First up would be to flip the ID switches back/forth and then back to drive 1 to ensure they're not giving a false reading. Continuity of the cable next.

 

On the Atari side, a faulty PIA can cause problems since it's used to control the /Command line, and most (all?) non cassette peripherals won't work without it.

Link to comment
Share on other sites

Just issuing a CSAVE command from Basic can determine if Pokey is able to transmit. Just enter a couple of lines first with random characters after REM.

 

If you have a floppy drive that doesn't respond it could be numerous things. First up would be to flip the ID switches back/forth and then back to drive 1 to ensure they're not giving a false reading. Continuity of the cable next.

 

 

 

 

Already tried those things thanks. Including reseatting all chips in the 810, all connectors and the side board. 810 goes though the power up routine but does not load a disk.

 

 

Will CSAVE still try the SIO even if there is no device responding?

Edited by spinnaker15136
Link to comment
Share on other sites

Tape operations don't know if a device is present - aside from the fact that a successful block read means there very likely is one there.

 

I've got a non responsive 810 too... I'd put odds of an 810 being at fault 99 times out of 100 vs the computer.

  • Like 2
Link to comment
Share on other sites

Already tried those things thanks. Including reseatting all chips in the 810, all connectors and the side board. 810 goes though the power up routine but does not load a disk.

Get a cheap SIO2PC cable, at the very least just for the purpose of diagnosing.

  • Like 1
Link to comment
Share on other sites

Tape operations don't know if a device is present - aside from the fact that a successful block read means there very likely is one there.

 

I've got a non responsive 810 too... I'd put odds of an 810 being at fault 99 times out of 100 vs the computer.

 

 

Never used CSAVE. Can I place it in a line of the code and loop to it? Working right now, on a brak but I could try it later.

Link to comment
Share on other sites

did you clean the 810's heads? are you certain the disk is good?

 

Yes cleaned the heads. I tried a couple of different disks. But the head does not move at all. Clean / bad head or bad disk, shouldn't the 810 at least try to read?

 

 

And can someone refresh my memory? With BASIC cart in, I type DOS correct? Will that cause DOS to be loaded in memory? Right now it just goes to memo pad. And with no cart, nothing happens on power up of the computer.

 

Just to make sure I am doing it right. Power up 810 (it goes trough its power up routine). Power up computer with no cart. Bootable disk should be loaded correct?

Link to comment
Share on other sites

after power switch is off a few minutes...

 

make sure power brick is good, make sure switches have been move to d1: position a few times...

 

what when power is turned on to 810 the first time?

does the head move at all? does the hub spin?

if no head movement turn off power and make sure it will move towards the center hub and that the hubs belt is good as well as able to spin...

 

if it broke free either broke free like they were stuck try it again... if it spins and the head moves, try a disk if not...

 

check the power supply external and internal voltages

and then double check that all is seated correctly, no bent, folded under, missed or miss- aligned pins

 

failing all of that it's field service manual time...

 

since there are a number of issues mentioned across the threads, find the 810 fsm here at

http://www.atarimania.com/documents/Atari_810_Disk_Drive_Service_Manual_Rev_2.pdf

and many others at

http://www.atarimania.com/documents-atari-400-800-xl-xe-technical-documents_3_8.html

Edited by _The Doctor__
Link to comment
Share on other sites

after power switch is off a few minutes...

 

make sure power brick is good, make sure switches have been move to d1: position a few times...

 

what when power is turned on to 810 the first time?

does the head move at all? does the hub spin?

if no head movement turn off power and make sure it will move towards the center hub and that the hubs belt is good as well as able to spin...

 

if it broke free either broke free like they were stuck try it again... if it spins and the head moves, try a disk if not...

 

check the power supply external and internal voltages

and then double check that all is seated correctly, no bent, folded under, missed or miss- aligned pins

 

failing all of that it's field service manual time...

 

since there are a number of issues mentioned across the threads, find the 810 fsm here at

http://www.atarimania.com/documents/Atari_810_Disk_Drive_Service_Manual_Rev_2.pdf

and many others at

http://www.atarimania.com/documents-atari-400-800-xl-xe-technical-documents_3_8.html

 

 

Already mentioned disk drive goes though power up procedure. Head moves disk spins.

 

I have +5V +12V in the 810. Not sure where to find the other voltages. Looked at the 810 service manual but did not see where they were located.

Link to comment
Share on other sites

Just issuing a CSAVE command from Basic can determine if Pokey is able to transmit. Just enter a couple of lines first with random characters after REM.

 

If you have a floppy drive that doesn't respond it could be numerous things. First up would be to flip the ID switches back/forth and then back to drive 1 to ensure they're not giving a false reading. Continuity of the cable next.

 

On the Atari side, a faulty PIA can cause problems since it's used to control the /Command line, and most (all?) non cassette peripherals won't work without it.

 

 

Thanks for the CSAVE tip. SIO appears to be working. At least output. I entered a few lines in BASIC. Typed CSAVE and heard a tone on the TV speaker. Square wave appeared on scope.

Link to comment
Share on other sites

in field service see the section about the sio id switches, and the chip for id select...

make sure the sio cord is good as well..

 

 

What should I look for on the switches? I have confirmed that they are set correctly. I do see the PSU right after that but don't see where they can be found on the board. I am still can't locate -5V

 

Not finding references to "and the chip for id select." I do see the reference to the PIA that reads the switches.

 

Is there a physical layout of the 810 boards somewhere? Just finding a schematic.

Link to comment
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...