Jump to content
Zybex

PIA Port Question

Recommended Posts

I'm using the pia port (porta), of my 65XE. I can set the pia for output with Poke 54018,56, to send signal to outside i use the 54016 address, but... ¿ how i can send and receive data by this port? (simultaneously)

 

In other words...

 

With what value must be poked the $D302 to allow I/O ?

How i can read/write it?

What pins are for In and Out?

 

I try to get info from Mapping but :? i dont understand the explaination of the $D302 address (PACTL)

Share this post


Link to post
Share on other sites

Oh, that's quite easy. PACTL (54018) doesn't set the PORTA (54016) for output, it only allows to change the meaning of PORTA's bits.

 

Normally, all PORTA's bits are set for reading. By clearing PACTL's 2nd bit (like you did with POKE) you turn PORTA into programming-mode. Then you can write varoius values into PORTA to program the PIA ports.

For example, if you want to set all PORTA bits for writing, you set all bits of PORTA to 1 (by writing 255 there). If you want to set all bits for reading, you clear all bits of PORTA, by writing 0. And if you want to use bits 0, 2 and 4 for writing and the rest for reading, you set PORTA's value to 2^0 + 2^2 + 2^4 = 1+4+16 = 21.

The last step is to re-set the 2nd bit of PACTL (by writing 60 there). Then you can use PORTA just as you've programmed it before.

 

Here is a diagram telling how joystick ports' pins connect to PORTA's bits.

 

-------------------------/

    1   2   3   4   5   /

   *   *   *   *   *  /

     6   7   8   9   /

     *   *   *   *  /

                   /

     -------------/

port    pin     PORTA's bit

 1      1            0

 1      2            1

 1      3            2

 1      4            3

 2      1            4

 2      2            5

 2      3            6

 2      4            7

 

Hope that helps :)

Share this post


Link to post
Share on other sites

Right. You can think of it this way:

 

There are 2 different registers needed to control a port: the data register and the direction register. Both are accessed at the PORTx register address, so the PxCTL register allows you to select which one you want.

 

When you're writing to the direction register, 0=input, and 1=output. You have total control over all 8 bits. Then, flip back to the data register to read the data at that port (all bits that are set to output will simply read back the data stored there).

 

-Bry

Share this post


Link to post
Share on other sites

Well, this has got me thinking...

 

What are all the known devices that connect to the Joystick ports that are not joysticks/paddle/trackballs/etc.

 

I know of the following:

 

Keypad CX-85

MPP-1000C/E modems

XEP80

 

And whatever multiplexer this is: http://www.atarimagazines.com/v6n4/computalk.html

 

 

I am sure I am missing a few. Any multi-game links via this port?

 

~C~

Share this post


Link to post
Share on other sites
What are all the known devices that connect to the Joystick ports that are not joysticks/paddle/trackballs/etc.

Interface MULTIJOY8 (16)

This easy multiplayer interface allows connect up to 8 joysticks to one Atari XE/XL computer via both joystick ports (MultiJoy16 up to 16 joysticks.)

http://raster.infos.cz/atari/english.htm#MULTIJOY

or

http://raster.infos.cz/atari/hw/multijoy.htm

:)

Share this post


Link to post
Share on other sites

Interface MULTIJOY8 (16)

 

Oh, yeah. I've seen this. Forgot about this... very cool!

 

 

~C~

Share this post


Link to post
Share on other sites

Hi,

 

When I used to develop on an STE, cross-assembling for the A8,

I had a parallel cable which split into two joystick connectors.

On the XL you'd load a 'bootstrap' loader from disk, then this

would sit and wait for instructions to come down the cable.

Using the 4 bits of each port to make an 8-bit value and the

triggers for handshaking, transfer rates were quite good.

 

All that you needed to do on the ST was to 'print' the binary

you wanted to send. Pretty neat.

 

I did also manage as well connect an XL and a C64 together via

a single joystick extender cable with an female-2-female adapter

on one end. using a reset cartridge I had to type in the hex code

for the 'send' routine somewhere into the C64 memory and then

run it. This way I managed to get across the memory for some

'screens', e.g. "The Sentinel" loader screen - so that I could then

play with the data on the Atari. There must have been an easier way?!

 

Best wishes,

Mark

Share this post


Link to post
Share on other sites
What about the 5th bit...ie, the button. Can you read/write on that pin as well?

 

No, it is read-only.

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