Read/Write EEPROM with Microwire interface (93c46)

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User16414
Level 1
Level 1
Hello!

I'm trying to read/write an EEPROM 93c46 that uses a Microwire interface, which is to my knowledge a subset of SPI.
I still have trouble with the correct settings, this might be the case as I'm fairly new to XMCs and DAVE and therefore might no use the correct settings in my SPI app.

One problem I have encountered is the fact that according to the datasheet of the 93c46 the chip select is active high instead of active low.
Another thing is the state of the MOSI line which is high on default, altough it should not be.
An additional problem is the fact that the 93c46 does not use a multiple of 8 bits for its addressing. It uses 1 start bit, a 2 bit op code and 6 address bits


I thought about just using 4 Digital IOs and creating the necessary signals myself but I also failed at creating an accurate clock signal with a stable frequency that I can turn on and off.

I hope you can give me some hints.
Thanks!
0 Likes
7 Replies
User16414
Level 1
Level 1
Does anyone have an idea?
0 Likes
Andi_H
Employee
Employee
First solution authored First like received
Hello "TestAccount"

first, which DAVE Version do you use? Which apps?

I am pretty sure you will find a sloution with the SPI Master app under "advanced settings".

To generate a stable freq you have to use the pwm app. This is very easy to use.

best regards
Andreas
0 Likes
User16414
Level 1
Level 1
Hi Andreas,
thank you for your reply.

I'm using DAVE 4.3.2 with only the SPI_MASTER app, as I'm right now only trying to get the EEPROM working.
I have now also found the "selo_inversion" member within the "XMC_SPI_CH_CONFIG_t" struct in the "spi_master_conf.c" file, but I'm not sure how to change it when using the SPI app. I sadly also didn't find anything helpful in the "advanced settings" of the app.

I have also tried the suggested PWM app for creating a stable clock signal, which works perfectly! I will also give using the 4 digital IO lines to implement the interface another go.
0 Likes
User16414
Level 1
Level 1
Does anyone have more information on this topic?
0 Likes
User14604
Level 4
Level 4
First solution authored
Looks like a SPI interface to me, don't know why the call it 3-wire.
Try it with CPOL=0, CPHA=0, means: SPI mode 0. (I could be wrong on this ...)

Try read any valid address. Should return 0xFF (default values in EEPROM). You'll find some interfacing examples for other chips when you google for the chip name.
0 Likes
User16414
Level 1
Level 1
Hi ErnieT, thanks for the comment!

I have tried SPI mode 0 (and 1, 2 & 3 for good measure), but that didn't yield any results (MISO stays low for the entire time).
According to the datasheet the slave select line is also active high compared to active low for "standard" SPI which i was able to implement, but that didn't help either.

I'll try replacing the EEPROM with another identical one, maybe that helps.
0 Likes
User14604
Level 4
Level 4
First solution authored
If you are going for SPI anyways, also have a look at FRAM solutions. They have much more write cycles and an extremely reduced erase/writing times, which means you can write byte-wise and expect the writing to have finished with a single SPI clock cycle. No more polling the write status!
Also, those chips usually come with a status register, which eases getting the interface working during implementation. There are more benefits, but they also come with higher price compared to EEPROMs.

EDIT: Interfaces of EEPROMs and FRAMs are usually very similar, so it should be easy to switch over.
0 Likes