i2c

Discussions about Sinclair ZX80 and ZX81 Hardware
Post Reply
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

i2c

Post by Andy Rea »

Hi,

I have read references to the i2c used by some on here, but can not find details of how to build such an interface, i should be able to code a 'bit basher' as long as i can get the hardware working, i want to interface an i2c RTC to my zx81, as part of my hard disk drive clock project, once everything is working i will build standalone Z80 based system instead of using zx81, but for my development zx81 is ideal as it allows quick and easy code modifiction for testing, i use mostly wordpad to write assembler then compile it with Tasm direct to .p file then use java tapeutils to load it into zx81. for the moment i am using a cicuit i found on here for input and output using some 74xx logic chips, giving me 8 input bits and 8 output bits of the inputs i am only using 4, 3 for push buttons, and 1 for a rotation sensor, of the outputs i an going to be using mininmum of 3 maybe 6 to drive RGB leds possibly 3 levels of brightness for each. is it possible to use these left over inputs and outputs to form an i2c connction ?

all the best Andy
what's that Smell.... smells like fresh flux and solder fumes...
BlackCanyonFX
Posts: 35
Joined: Sun Dec 26, 2010 7:03 am
Location: Black Canyon City, AZ

Re: i2c

Post by BlackCanyonFX »

Hey there, Andy,

"I have read references to the i2c used by some on here, but can not find details of how to build such an interface, i should be able to code a 'bit basher' as long as i can get the hardware working, i want to interface an i2c RTC to my zx81..."

I'm kind of an I2C freak myself (mostly with PIC micros). I am just now working on adding a chip to my 64k RAM project that might interest you. The PCF8584 from Phillips. I've attached the datasheet.

"...is it possible to use these left over inputs and outputs to form an i2c connction ?"

The nice thing is that this chip handles all of the tedious timing crap and it is designed with the Z80 processor (and a few others) in mind. You just call it, address the I2C device you want, and read or write to it. Poof! Done. Now with just four wires (+,-,clk,dat) you have an I2C buss for all kinds of toys. Just plug 'em in and call them with the address code for that chip.

My favorites are:

LM12438 8-channel 12bit+sign A/D (13bit)
DS1307 RTC
LM75 Temperature/thermostat (1 I/O pin with hysteresis settings)
24AA1025 128k X 8 EEPROM (and others)

Add to that D/A, TV tuners, etc. Lots of cool and/or weird I2C chips out there. With a handshaking arrangement, I have even shared EEPROMs between two PICs, letting one send data to the EEPROMs and one to read them for display on an lcd. My first PIC just didn't have the time to mess with the display overhead, hence the sharing solution.

No reason a PIC (or other micro) and a ZX81 couldn't do the same sort if I2C buss sharing. Lots of possibilities....
Hmmm...Maybe a high speed PIC handling FFT for my ZX, yeah, that's the ticket!

I hope that this is some help,

GT Blocker.
Attachments
PCF8584ds.rar
PCF8584 Data Sheet
(155.48 KiB) Downloaded 277 times
User avatar
Andy Rea
Posts: 1606
Joined: Fri May 09, 2008 2:48 pm
Location: Planet Earth
Contact:

Re: i2c

Post by Andy Rea »

That looks like an interesting chip, looks easy enough to hang off the z80 bus and as you say takes the work out of having to write a 'bit banger' yourself, i'll be adding one of those to my shipping list :)

Thank you

Andy
what's that Smell.... smells like fresh flux and solder fumes...
RWAP
Posts: 1348
Joined: Thu May 08, 2008 8:42 am
Location: Stoke-on-Trent, UK
Contact:

Re: i2c

Post by RWAP »

This topic has now been sorted out - it was started by Andy Rea :-)
Post Reply