A2I2C - I2C bus for Atari

Moderator: bbiernat

Bertrude
Posts: 7
Joined: 06 March 2021, 03:07 - Sat
Location: Austin, Texas

Re: A2I2C - I2C bus for Atari

Post by Bertrude »

Thanks for that additional information. I've been working on this project the last month or so, and updated my schematic to reflect the changes you mentioned.
  1. Removed /INT
  1. Added a resistor when setting pin 12 high as part of the address decoding
  1. Added a 12 mhz Clock
I also got the MADS assembler running and was able to assemble your code and get it running on my 6502 computer with some minor tweaks for addressing and the new 12mhz clock. I then padded the assembled file so I could flash it to a 32K eeprom; however, I did run into a small problem with the outputted ROM file. When I would jump to subroutines, I noticed the address they were jumping to wasn't correct (off by 6), so I ran the file through a 6502 disassembler, and noticed the beginning of the file included instructions that I didn't know the origin of. I was thinking this might be something ATARI specific?

They were:

Code: Select all

FF FF 00 60 10 61

Code: Select all

0000   FF         ???
0001   FF         ???
0002   00         BRK
0003   60         RTS
0004   10 61      BPL $0067
0006              .END
After removing these 6 bytes, the addressing issue I was having was resolved.

Another problem I ran into is the RESET line on the 6502 is being pulled low when connecting it to the PCF8584 RESET pin. I suspected this is because the PCF8584 RESET line is open drain, so I connected a 10K pull-up resistor to it, and then later a 4.7k resistor, but still had the same problem. I'm not sure what's going on with that, but I did resolve it with a temporary hack by running the 6502 RESET line through two NAND gates and then connecting the output of that to the PCF8584 RESET pin. I'm still rather new to the hardware side of things, so that's the best I could come up with :D

Unfortunately, even after all that, when I run the code on my computer, I'm still not seeing any output on the PCF8584 SDA and SCL lines :cry: . I connected a logic analyzer to the circuit to verify the PCF8584 is receiving the correct input, and didn't see any problems. I'm thinking it could still be a problem with my hacky RESET line "fix", or these eBay PCF chips are no good. I'm going to try purchasing some brand new surface mount versions of the PCF and see if that makes any difference.

I've attached a copy of my updated schematic. I was wondering if you could check it out and let me know if you see any problems with it :) ?
Attachments
pcf8584 i2c 6502 board v1.1.jpg
pcf8584 i2c 6502 board v1.1.jpg (385.38 KiB) Viewed 15128 times

User avatar
pancio
Administrator
Posts: 63
Joined: 18 September 2013, 23:02 - Wed
Location: SILESIA

Re: A2I2C - I2C bus for Atari

Post by pancio »

Hi,

As you mentioned, the /RESET line is open drain and for normal work you need to pull-up it to Vcc thru resistor but I suppose your microcomputer system has this line pulled-up in other place. Are you sure that PCF8584 RESET pulls the line down? It's input pin, so probably PCF is damaged. I had issues run PCF in 6800 mode so I decided to use Intel mode.. You should analyse your address decoder/discrete breakout for /RD /WR /CS to be sure that time restrictions are ok e.g. using logic analyser. For example I added screenshot with timing sequence with Atari, PCF8584 and PCF8574 which may be helpfully. In case /CCTL is connected to /CS (from address decoder), O2 is clock signal from Atari (1.79MHz), Rest signals you know...
PCF8574_write_01+ACK.png
PCF8574_write_01+ACK.png (85.27 KiB) Viewed 15124 times
According to your firs question, first 6 bytes from output file is header which means:
FFFF - file/block descriptor
0060 - means start fill the block from address $6000 (little endian)
1060 - to $6010

This is specific for Atari OS so if you're using MADS, you should delete all headers from output file - for better understanding, check file your_project.lst where you will see all blocks.

I'll analyse schematic soon...
Last edited by pancio on 13 November 2022, 20:52 - Sun, edited 1 time in total.

Bertrude
Posts: 7
Joined: 06 March 2021, 03:07 - Sat
Location: Austin, Texas

Re: A2I2C - I2C bus for Atari

Post by Bertrude »

Thank you for the detailed response :)

I will double check my reset line circuitry. I also took the PCF8584 out of circuit and only hooked up VDD & VSS and then connected the RESET pin to VDD using a 4.7k pull up resistor, and still had the RESET pin registering as low. I'm going to order a new chip, just to make sure that's not my problem.

Thanks for the timing diagram. I also have a Saleae logic analyzer, so I will wire mine up the same as yours, and check it out.

Post Reply