Jump to content

Photo

SIO coding for Atari 400/800 examples?


65 replies to this topic

#1 spinnaker15136 OFFLINE  

spinnaker15136

    Chopper Commander

  • 144 posts

Posted Mon Apr 22, 2019 6:46 PM

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/...pi-as-a-floppy/


Edited by spinnaker15136, Mon Apr 22, 2019 6:48 PM.


#2 Kyle22 ONLINE  

Kyle22

    River Patroller

  • 4,097 posts
  • broadway1.lorexddns.net 10001
  • Location:McKees Rocks (Pittsburgh), PA

Posted Mon Apr 22, 2019 8:01 PM

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



#3 spinnaker15136 OFFLINE  

spinnaker15136

    Chopper Commander

  • Topic Starter
  • 144 posts

Posted Mon Apr 22, 2019 8:30 PM

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. ;)



#4 spinnaker15136 OFFLINE  

spinnaker15136

    Chopper Commander

  • Topic Starter
  • 144 posts

Posted Mon Apr 22, 2019 8:34 PM

This looks promising

 

https://www.atarimax...i.org/asio.html

 

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



#5 Kyle22 ONLINE  

Kyle22

    River Patroller

  • 4,097 posts
  • broadway1.lorexddns.net 10001
  • Location:McKees Rocks (Pittsburgh), PA

Posted Mon Apr 22, 2019 8:42 PM

$300 is the DCB. Set the parameters for whatever you want to do there, then JSR SIOV. Very simple. You can read / write/ format, etc.

You DO NOT need to directly modify PoKey registers. That is not necessary for simple peripheral I/O.



#6 spinnaker15136 OFFLINE  

spinnaker15136

    Chopper Commander

  • Topic Starter
  • 144 posts

Posted Mon Apr 22, 2019 8:44 PM

This looks promising

 

https://www.atarimax...i.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. :)



#7 dmsc ONLINE  

dmsc

    Dragonstomper

  • 533 posts
  • Location:Viņa del Mar, Chile

Posted Mon Apr 22, 2019 9:32 PM

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/...pi-as-a-floppy/


Read from here for examples to setup serial communication registers: http://atariage.com/...asic/?p=4035193

Have Fun!

#8 Rybags OFFLINE  

Rybags

    Gridrunner

  • 16,145 posts
  • Location:Australia

Posted Tue Apr 23, 2019 5:19 AM

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.



#9 ijor OFFLINE  

ijor

    River Patroller

  • 2,214 posts

Posted Tue Apr 23, 2019 6:32 AM

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.atarimani...ware-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, Tue Apr 23, 2019 6:45 AM.


#10 Rybags OFFLINE  

Rybags

    Gridrunner

  • 16,145 posts
  • Location:Australia

Posted Tue Apr 23, 2019 6:49 AM

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.



#11 spinnaker15136 OFFLINE  

spinnaker15136

    Chopper Commander

  • Topic Starter
  • 144 posts

Posted Tue Apr 23, 2019 7:04 AM

Hi!
 

Read from here for examples to setup serial communication registers: http://atariage.com/...asic/?p=4035193

Have Fun!

 

 

Yeah found that just before I turned in last night.   Thanks.



#12 spinnaker15136 OFFLINE  

spinnaker15136

    Chopper Commander

  • Topic Starter
  • 144 posts

Posted Tue Apr 23, 2019 7:06 AM

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, Tue Apr 23, 2019 7:09 AM.


#13 Rybags OFFLINE  

Rybags

    Gridrunner

  • 16,145 posts
  • Location:Australia

Posted Tue Apr 23, 2019 7:12 AM

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.



#14 ijor OFFLINE  

ijor

    River Patroller

  • 2,214 posts

Posted Tue Apr 23, 2019 7:25 AM

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.

#15 _The Doctor__ OFFLINE  

_The Doctor__

    Flux Capacitor Master Craftsman

  • 6,959 posts
  • Location:10-0-11-00:02

Posted Tue Apr 23, 2019 11:05 AM

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



#16 spinnaker15136 OFFLINE  

spinnaker15136

    Chopper Commander

  • Topic Starter
  • 144 posts

Posted Tue Apr 23, 2019 12:27 PM

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.



#17 spinnaker15136 OFFLINE  

spinnaker15136

    Chopper Commander

  • Topic Starter
  • 144 posts

Posted Tue Apr 23, 2019 12:32 PM

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?



#18 spinnaker15136 OFFLINE  

spinnaker15136

    Chopper Commander

  • Topic Starter
  • 144 posts

Posted Tue Apr 23, 2019 12:35 PM

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

 

 

Where would I get such a thing?  Checked on ebay did not see it.   Is it just the cable?     What is considered "cheap"?   :)



#19 _The Doctor__ OFFLINE  

_The Doctor__

    Flux Capacitor Master Craftsman

  • 6,959 posts
  • Location:10-0-11-00:02

Posted Tue Apr 23, 2019 12:48 PM

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.atarimani...anual_Rev_2.pdf

and many others at

http://www.atarimani...uments_3_8.html


Edited by _The Doctor__, Tue Apr 23, 2019 12:52 PM.


#20 spinnaker15136 OFFLINE  

spinnaker15136

    Chopper Commander

  • Topic Starter
  • 144 posts

Posted Tue Apr 23, 2019 2:23 PM

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.atarimani...anual_Rev_2.pdf

and many others at

http://www.atarimani...uments_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.



#21 _The Doctor__ OFFLINE  

_The Doctor__

    Flux Capacitor Master Craftsman

  • 6,959 posts
  • Location:10-0-11-00:02

Posted Tue Apr 23, 2019 2:28 PM

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..



#22 spinnaker15136 OFFLINE  

spinnaker15136

    Chopper Commander

  • Topic Starter
  • 144 posts

Posted Tue Apr 23, 2019 2:34 PM

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.   



#23 spinnaker15136 OFFLINE  

spinnaker15136

    Chopper Commander

  • Topic Starter
  • 144 posts

Posted Tue Apr 23, 2019 2:36 PM

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..

 

 

I  did a continuity test.   Pretty sure SIO cable is good.

 

 

Will check manual thanks.



#24 spinnaker15136 OFFLINE  

spinnaker15136

    Chopper Commander

  • Topic Starter
  • 144 posts

Posted Tue Apr 23, 2019 2:51 PM

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.



#25 spinnaker15136 OFFLINE  

spinnaker15136

    Chopper Commander

  • Topic Starter
  • 144 posts

Posted Tue Apr 23, 2019 2:52 PM

Just as a reminder computer goes immediately tp Memo Pad when DOS is tyoed or computer is turned on with no cartridge.






0 user(s) are browsing this forum

0 members, 0 guests, 0 anonymous users