+David_P Posted November 26, 2008 Share Posted November 26, 2008 Anyone have any experience in interfacing I2C ICs to an Atari 8-bit? I'm looking at the joystick ports vice SIO for simplicity. In addition, I2C is supposed to be a multi-master bus; that would suggest it should be possible to share any I2C peripheral between two or more 8-bits. Quote Link to comment Share on other sites More sharing options...
Rybags Posted November 26, 2008 Share Posted November 26, 2008 No. Although years ago I developed inter-system comms between A8-> C64 (A8 joysticks to C64 serial) and A8-> Atari ST, which was an APE-like emulator which used A8 serial and no extra software required, to ST parallel with the ST running the emulation layer. Just looking at the Wiki article - I2C seems to be a little different from SIO in that it leaves the clock line high after transmission. On the Atari: - the clock line is only used in certain SIO modes. The Atari OS uses a mode where the clock is generated/transmitted by Pokey. - data bits are sampled when clock goes low, and change when it goes high. I2C appears to do the opposite. Quote Link to comment Share on other sites More sharing options...
supercat Posted November 26, 2008 Share Posted November 26, 2008 - data bits are sampled when clock goes low, and change when it goes high. I2C appears to do the opposite. To send a bit of data as master, a device should assert clock, drive the bit, release clock, and wait for the clock wire to go high. A receiving slave device that sees the clock wire go low should hold the clock wire low until it has a chance to process the bit. If the master waits for the clock wire to go high after each bit, and if the slave has some hardware to latch the clock line low and do a few other things, it won't matter if the slave CPU is sometimes 'distracted' with interrupts, badlines, etc. Note that many slave devices never hold clock low, and so some software I2C master implementations don't check for it. Quote Link to comment Share on other sites More sharing options...
+David_P Posted November 26, 2008 Author Share Posted November 26, 2008 Thanks for the quick replies. I'm looking at bit twiddling on a joystick port, and possibly going to two lines on the Atari (data in and data out) - use two bits on the port, a diode on each to keep things unidirectional. Quote Link to comment Share on other sites More sharing options...
Rybags Posted November 26, 2008 Share Posted November 26, 2008 You could use an invertor IC to take care of the clock problem. I don't know if the Atari would support a device pulling it's own values on the clock line, although there is mention of bi-directional clock modes. If the bps rate is a known value, the Atari can supposedly work in unclocked mode anyway and will resync. It should work fine so far as you're within +- 5% Quote Link to comment Share on other sites More sharing options...
Mathy Posted November 26, 2008 Share Posted November 26, 2008 Hello David Guus Assmann has drawn a schematic year ago, for an I2C interface that connects to the joystickport(s). It's really simple. If I don't forget, I'll see if I can find it this evening. greetings Mathy Quote Link to comment Share on other sites More sharing options...
HiassofT Posted November 26, 2008 Share Posted November 26, 2008 Guus Assmann has drawn a schematic year ago, for an I2C interface that connects to the joystickport(s). And I implemented a simple I2C stack to use it :-) The interface is really simple: Just use 2 pins of a joystick port for SDA/SCL, connect pull-up resistors (10k or 4k7 are fine) and you are done. Here's a link to my software: http://www.horus.com/~hias/tmp/atari-i2c-0.11.zip Have a look at the README.TXT, i2c.inc and i2c.src files. I also included some demo applications to show how to interface to a I2C RTC from assembler and basic. so long, Hias Quote Link to comment Share on other sites More sharing options...
+David_P Posted December 2, 2008 Author Share Posted December 2, 2008 Thanks! Excellent work. I found an online vendor selling I2C boards for around $8 each for both a battery-backed RTC and a flash drive - ships with 16K, easily upgradeable to 256K by swapping out the ICs. (www.futurlec.com - slow shipping, but it's to be expected when it comes from half way around the world). I'm looking at writing a Z: driver for the RTC (DS1307), and possibly a disk handler (128 byte sectors) for the remainder. More to follow as time permits... Quote Link to comment Share on other sites More sharing options...
danwinslow Posted December 3, 2008 Share Posted December 3, 2008 What would the bit rate be on something like this? Quote Link to comment Share on other sites More sharing options...
Mathy Posted December 3, 2008 Share Posted December 3, 2008 Hello Dan That's the nice thing about I2C. It doesn't really have a fixed speed. Just a maximum speed. Which has been increased over the years. greetings Mathy Quote Link to comment Share on other sites More sharing options...
danwinslow Posted December 4, 2008 Share Posted December 4, 2008 I meant how fast could an 8-bit Atari push bits across it? Quote Link to comment Share on other sites More sharing options...
Rybags Posted December 4, 2008 Share Posted December 4, 2008 (edited) I've heard of people doing somewhere around 100,000 kbps via the joystick ports. Regardless of what you might achieve with nice shielded wiring, twisted pairs, whatever - you're constrained by the CPU. 100,000 bps means about 18 cycles per bit - if you turn the screen off. I guess a heavily optimised I/O routine could use tables to avoid having to do bitshifts, which might reduce the overhead. But still, bit banging means that at really high speeds you then have to contend with Refresh DMAs causing the interval between bits to fluctuate. Edited December 4, 2008 by Rybags Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted December 4, 2008 Share Posted December 4, 2008 The AtariVox (and SaveKey) use the I2c protocoll (via joystick port). Quote Link to comment Share on other sites More sharing options...
danwinslow Posted March 18, 2009 Share Posted March 18, 2009 Hello David Guus Assmann has drawn a schematic year ago, for an I2C interface that connects to the joystickport(s). It's really simple. If I don't forget, I'll see if I can find it this evening. greetings Mathy /Necrobump Does anyone know where this schematic is? Quote Link to comment Share on other sites More sharing options...
Thomas Jentzsch Posted March 18, 2009 Share Posted March 18, 2009 (edited) nevermind Edited March 18, 2009 by Thomas Jentzsch Quote Link to comment Share on other sites More sharing options...
danwinslow Posted March 18, 2009 Share Posted March 18, 2009 ? Quote Link to comment Share on other sites More sharing options...
HiassofT Posted March 19, 2009 Share Posted March 19, 2009 Does anyone know where this schematic is? If found it in my mailbox. The PCF 8583 is the RTC, the 24C16 is a serial EEPROM (just for testing if this also works). IICKLOK.pdf so long, Hias Quote Link to comment Share on other sites More sharing options...
danwinslow Posted March 19, 2009 Share Posted March 19, 2009 Thanks! Quote Link to comment Share on other sites More sharing options...
a8isa1 Posted February 12, 2013 Share Posted February 12, 2013 And I implemented a simple I2C stack to use it :-) The interface is really simple: Just use 2 pins of a joystick port for SDA/SCL, connect pull-up resistors (10k or 4k7 are fine) and you are done. Here's a link to my software: http://www.horus.com...ri-i2c-0.11.zip Have a look at the README.TXT, i2c.inc and i2c.src files. I also included some demo applications to show how to interface to a I2C RTC from assembler and basic. so long, Hias Hi, Hias (and all). Sorry to revive an old thread but while looking into RTCs I came across many low cost Arduino modules like this one and of course this thread.. Would one of these RTC modules work here? -SteveS Quote Link to comment Share on other sites More sharing options...
HiassofT Posted February 12, 2013 Share Posted February 12, 2013 Sorry to revive an old thread but while looking into RTCs I came across many low cost Arduino modules like this one and of course this thread.. Would one of these RTC modules work here? The module looks fine and I guess it should work. Of course you'd have to modify the source code and change the I2C address and registers (which are different to the PCF I used in my example code). so long, Hias Quote Link to comment Share on other sites More sharing options...
a8isa1 Posted February 12, 2013 Share Posted February 12, 2013 The module looks fine and I guess it should work. Of course you'd have to modify the source code and change the I2C address and registers (which are different to the PCF I used in my example code). so long, Hias Ah, of course. I'll give it a try. Thanks, Hias! Quote Link to comment Share on other sites More sharing options...
Marius Posted February 12, 2013 Share Posted February 12, 2013 I have hooked up an ARDUINO board with DS1307 RTC right to the PIA (PA0 and PA1 are used) That works great. It did not work out of the box connected directy to the Joystick Port. I have contacted Guus Assmann about that, but his advice did not help me yet. My problem is that the RTC works great connected to the PIA, and using PA0 and PA1 is rather safe to do (you still can use your joystick since that can not alter PA0 and PA1 at the same time!) But ... as soon as you connect a Touch Tablet (which still leaves Pa0 and PA1 alone) the RTC does not work anymore. I still don't understand completely how that can happen. The RTC is soldered almost directly on the PIA and still... when something is connected on the joystick port; even when PA0 and PA1 aren't even touched... there is something that makes that the RTC can not communicate well with the PIA. Quote Link to comment Share on other sites More sharing options...
+tf_hh Posted February 13, 2013 Share Posted February 13, 2013 Hi, two things... maybe the TouchTablet pulls one of pins (PA0, PA1) to ground or VCC (+5 volts). Also if there is a low-valued resistors this may happen. Check with DMM. When this problem occours after the software for TouchTablet is loaded, then the software may change the DDRA (Data Direction of port A) in any interrupt or so. Some RS232 interfaces for the joystickports also work in this way. Use monitor or Freezer to find it out. Jurgen Quote Link to comment Share on other sites More sharing options...
Marius Posted February 13, 2013 Share Posted February 13, 2013 Hi Jurgen, Thanks for your reply. Unfortunately nothing of this all does happen. The problems do occur as soon as I connect the touch tablet; so no software problem. It have measured with DMM, nothing weird is going on. It think I will open up the touchtablet to check what is going on inside. For my own solution: I now connect touchtable to joystick port 2 in stead of joystick port 1, and I adapted atari Artist, so I can work with it; so problem is solved a bit.. but ofcourse I would like that my RTC 'invention' is as compatible as possible. Quote Link to comment Share on other sites More sharing options...
a8isa1 Posted February 13, 2013 Share Posted February 13, 2013 I have hooked up an ARDUINO board with DS1307 RTC right to the PIA (PA0 and PA1 are used) That works great. It did not work out of the box connected directy to the Joystick Port. I have contacted Guus Assmann about that, but his advice did not help me yet. My problem is that the RTC works great connected to the PIA, and using PA0 and PA1 is rather safe to do (you still can use your joystick since that can not alter PA0 and PA1 at the same time!) But ... as soon as you connect a Touch Tablet (which still leaves Pa0 and PA1 alone) the RTC does not work anymore. I still don't understand completely how that can happen. The RTC is soldered almost directly on the PIA and still... when something is connected on the joystick port; even when PA0 and PA1 aren't even touched... there is something that makes that the RTC can not communicate well with the PIA. well, I ordered an RTC module (a different one than my link showed). My controllers are joysticks, paddles, and a mouse (but that's on joy2). No touch tablet. Hopefully, I won't have a problem. Might even be a non-issue for me. I can't imagining accessing the RTC more than once per session (SDX) and I don't typically use game controllers at such times. -SteveS Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.