I2C Slavery

craig008

New Member
i have been reading the new commands data sheet and did not find anything much about getting data from 28x1 slave witha 28x1 master, now iget how to address the chips i think but where do iput the data the the slave collect until the master is ready to pick it up, and how does it pick it up, so presume i have 8 o2c eeproms and RTC and i set the slave 28x1 address as 1011000x

for slave:
hi2csetup i2cslave, %10110000
'read varibles
'loop round

for master:
hi2csetupr i2cmaster, %10110000, i2cfast, i2cbyte
hi2cin(%10110000), (b0,b1...)
________
TOYOTA TECHNOLOGICAL INSTITUTE SPECIFICATIONS
 
Last edited:

Technical

Technical Support
Staff member
The 28X1 has 128 bytes of scratchpad memory. Look up scratchpad in the help file for more details.

Basically the 'master' can 'read' from, and 'write' to any byte (0-127) of the slave's scratchpad.

So if your slave program writes a value into the scratchpad address 5 e.g.

put 5,b1

the master can read that value by doing a hi2cin on address 5 of that slave e.g.

hi2cin 5,(b1)

It also works in reverse by hi2cout and get. But its a bit more complex the slave has to know when the master has written - thats the purpose of the hi2cflag. When the master writes to the slave the hi2cflag gets set on the slave.

The slave program can either poll the hi2cflag directly or use the setintflags command to generate an interrupt on change in the flags byte.
 

craig008

New Member
so for some clarification
Slave:
hi2csetup i2cslave, %1011000
put 0,b0,b1,b2

master:
hi2csetup i2cmaster, %10110000, i2cfast, i2cbyte
hi2cin 0,(b0,b1,b2)

the idea of this is to allow the master to be abele to concentrate on some task like time keeping and key board input while the slave loops around taking reading, storing them an then giving them up when the master wants them.

while we are here is it possible to control a printer of some description, and if so how.

thanks for the feed back
________
HERBALAIRE REVIEWS
 
Last edited:

Technical

Technical Support
Staff member
Printer interface chip is here

<A href='http://194.201.138.187/epages/Store.storefront/?ObjectPath=/Shops/Store.TechSupplies/Products/FRM015' Target=_Blank>External Web Link</a>
 

papaof2

Senior Member
That chip only talks to a *parallel* printer - not USB.
You can probably find someone giving away an old parallel inkjet - the HP 500 series is big, heavy, and slow by current standards but they are also just-won't-die reliable. I have one on my home network as the draft printer (very low standby power, and requires only a small UPS). My wife (a teacher) is still using one for the &quot;things to be copied&quot; printing she does. I had a 500 that finally died last year (at age 15, after a power hit) and is currently being cannibalized for a high school student's robot project.

John
 

papaof2

Senior Member
buy one - Ebay, local computer club, Craig's list for sale/computers, surplus equipment auction/sale, post a &quot;wanted&quot; ad (newspaper or Ebay), computer sales/repair shop

free - Freecycle.org (see if there's a local group - if not, start one ;-), Craig's list free, junked equipment, computer sales/repair shop

The wiring diagram is in the PDF file for the chip.

Ink is still available from Ebay, refill services, and offshore clone makers - I have used cartridges from all three sources. here are also companies that sell refill-it-yourself kits - I've had reasonable success with Epson and Canon cartridges, but never with an HP cartridge. A former co-worker gave me a cartridge that they found while cleaning out an old office last week.

John
 
Top