Re: [stella] Trouble with AtariVox code - please help!

Subject: Re: [stella] Trouble with AtariVox code - please help!
From: "Alex Herbert" <herbs64@xxxxxxxxxxx>
Date: Fri, 3 Jun 2005 20:37:49 -0400
> I'm having trouble getting my code to work that is supposed to read/write 
> high scores to the AtariVox. > Would someone take a look at this routine 
> and see if they can see what I am doing wrong?

Hi there,

I think there may be problems with my i2c driver package.  It's pretty 
timing sensitive.  People reported that the last version of MGD I posted on 
the AA forums wasn't saving, but it's working fine for me - my particular 
i2c chip seems slightly less fussy than some.

First thing to try is add a NOP to the end of macros I2C_SCL_1 and 
I2C_SCL_IN.  (Maybe do the same to I2C_SCL_0 and I2C_SCL_OUT).

Basically, if it goes SCL_1 --> SCL_0 (or SCA_IN --> SCA_OUT) too quickly, 
the i2c chip doesn't always see it.  (The rise time is longer than the fall 
time because the RIOT only has single-transistor outputs.)

I thought we'd found that 12 clock cycles between state changes on each pin 
was enough, but maybe it needs more.

Actually, I've just seen there's a place in the driver where that rule is 
broken.  Try putting a buch of NOPs (3 or more) after the I2C_TXNACK in 
i2c_stopread. (i.e. just before i2c_stopwrite).  That might help, but I 
would expect the first read to be successful since that doesn't happen until 
after the read is complete.  It might screw up subsequent access though, so 
worth trying.

I'll look into it further as soon as I can - I'm not well at the moment and 
sitting at my PC for any length of time is difficult.

Sorry 'bout that.  Hope that sorts you out.


How much free photo storage do you get? Store your holiday 
snaps for FREE with Yahoo! Photos
Archives (includes files) at
Unsub & more at

Current Thread