Go Down

Topic: What a library can work with Atmel AT93C46? (Read 794 times) previous topic - next topic

ogogon

Hi, colleagues!

Please tell me, what a library can work with Atmel AT93C46?

She has a three-wire interface, very similar to SPI.
I tried using the SPI library (SPI.h), but did not achieve a positive result. Although, in my opinion, has filed all the necessary commands.

Is there any experience with the three-wire EEPROM-chips of this type?

Ogogon.

ogogon

As I clarified, the bus of this chip is called Microwire (aka 3WI).

The forum is a link to a file http://leyenda2.demon.co.uk/mike/Electronics/datasheets/SPIvsMicrowire.pdf, which explains everything.
But he, of course, is not available.

How to implement support Microwire (3WI) bus for Arduino?

Ogogon.

Riva

I'm no expert on using SPI but looking at the AT93C46 datasheet have you setup the SPI interface to suit this chip.
The datasheet says 2Mhz clock but SPI defaults to 4Mhz (look here http://arduino.cc/en/Reference/SPI) so put a SPI.setClockDivider(SPI_CLOCK_DIV8) to drop clock to 2Mhz. You need to make sure the SPI mode is correct for reading/writing bits on rising edge of clock pulse (SPI.setDataMode(SPI_MODE0) ) and the bit order is correct MSB to LSB (SPI.setBitOrder(MSBFIRST) )
The final hurdle is the CS signal seems the wrong way round, normally CS is HIGH and pulled LOW when your talking to the device but the datasheet shows the opposite of this. You could maybe overcome this in software by using a different output pin to slaveSelectPin for CS, set it to HIGH just before reading/writing to AT93C46 and then set it LOW after.

Go Up