Welcome, Guest. Please login or register.

Author Topic: Writing data on expansion connector in C  (Read 1383 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline kamigaTopic starter

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 165
    • Show only replies by kamiga
Writing data on expansion connector in C
« on: January 19, 2009, 11:17:01 PM »
How would one go about writing data on an A500's expansion connector in C? Are there some Write() routines that would clock a data buffer out of the port?

Or is it simply a matter of making sure the device that is attached to the expansion port is paying attention to the data bus at the right moment?

What libraries would be involved?  Registers? Address ranges, etc?

Thanks!

Keith
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Writing data on expansion connector in C
« Reply #1 on: January 20, 2009, 12:09:45 AM »
There is no direct access.

Basically Zorro HW initializes and then the resources will be available to the OS via normal OS functions.

There are some low level functions such as expansion.library FindConfigDev() and WriteExpansionByte(), though. Even these only poke the HW in a very controllable and transparent way.

If you want to connect your own device you must implement Zorro2 for it. Refer to the Amiga Hardware Reference Manual, Appendix G, "AUTOCONFIG (TM)".
 

Offline kamigaTopic starter

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 165
    • Show only replies by kamiga
Re: Writing data on expansion connector in C
« Reply #2 on: January 20, 2009, 05:52:57 AM »
Thanks for the quick and straight-forward answer.

I have the 3rd edition of AHRM, and it might be Appendix K, "Zorro Expansion Bus."  It has a section, on page 431, entitled "AUTOCONFIG(TM)."

A quick view of it makes it look fairly complicated -- I was hoping to implement something more simple. Hrrmm..

When you say normal OS functions, can you be more specific and give me examples?

Thanks
 

Offline Piru

  • \' union select name,pwd--
  • Hero Member
  • *****
  • Join Date: Aug 2002
  • Posts: 6946
    • Show only replies by Piru
    • http://www.iki.fi/sintonen/
Re: Writing data on expansion connector in C
« Reply #3 on: January 20, 2009, 06:35:57 AM »
Quote
A quick view of it makes it look fairly complicated -- I was hoping to implement something more simple. Hrrmm..

For something simple you could look into serial, parallel or clockport (though A500 needs a clockport adapter for that).
Quote
When you say normal OS functions, can you be more specific and give me examples?

AllocMem/FreeMem to acccess memory for example. exec device drivers to access block devices, such as SCSI controllers.

There is typically some "firmware" software that initializes the zorro hardware, but even this get the I/O addresses dynamically, rather than banging some fixed addresses. Zorro isn't some simple fixed I/O addresses you can bang. The whole point of Zorro is to be dynamic and allow all sorts of configurations and make it work automagically (plug'n'play over decade before microsoft brought it to PC).

That being said, it is not impossible. A500IDE is one example:

http://www.amiga.org/gallery/index.php?n=953=7
http://www.amiga.org/gallery/index.php?n=946=7
http://www.amiga.org/gallery/index.php?n=954=7

Or another build:
http://www.amiga.org/gallery/index.php?n=2528=7
http://www.amiga.org/gallery/index.php?n=2529=7

Schematics, pcb design and ide.device driver software with sources:
http://aminet.net/package/docs/hard/a500ide

This particular device is quite hacky however, for example the driver is built to access the fixed address for the AT registers. It works only because the unit is the only Zorro device plugged in. But if you assume this things get slightly easier. Such design isn't "proper" Zorro2 however.
 

Offline kamigaTopic starter

  • Full Member
  • ***
  • Join Date: Oct 2005
  • Posts: 165
    • Show only replies by kamiga
Re: Writing data on expansion connector in C
« Reply #4 on: January 20, 2009, 06:52:21 AM »
Hahaha. I was just looking at A500IDE today for just this thing.

The idea behind looking at the expansion interface, over the other interfaces was speed.  Serial is super slow, I think Parallel isn't too bad, and I honestly know little/nothing about the clockport.

Thanks for the links, though.

Keith
 

Offline giannis_va

  • Newbie
  • *
  • Join Date: Mar 2008
  • Posts: 7
    • Show only replies by giannis_va
Re: Writing data on expansion connector in C
« Reply #5 on: January 20, 2009, 07:37:55 AM »
@kamiga


why do you want to write to the expansion slot ?