cancel
Showing results for 
Search instead for 
Did you mean: 

how to read/write eeprom microwire 93c66

No_Name
Associate II

Hi all.
I want to do read/write on eeprom microwire 93c66 but there is no open source HAL library that I can find. how can I do it? I am new to stm32.

Thanks

7 REPLIES 7
AScha.3
Super User

Hi,

>how can I do it?

As with every other cpu ...

- read ds of 93c66

- decide, how you want to do it, SPI, bit bang, ...

- or use a chip with standard  I2C interface and connect to the I2C (and the HAL lib)

If you feel a post has answered your question, please click "Accept as Solution".
Pavel A.
Super User

Here you can find help with this part.

I don't really understand how to read the datasheet and apply it like a timing diagram, because I was previously in arduino which is mostly an open source library.


@No_Name wrote:

I don't really understand how to read the datasheet and apply it like a timing diagram,


That is a basic skill - nothing specific to STM32.

As @Pavel A. suggests, if you don't have the time or inclination to do it yourself, then you'll need to pay someone to do it for you.

 


@No_Name wrote:

because I was previously in arduino which is mostly an open source library.


That's the downside of relying on 3rd-party libraries - you're stuck until someone else provides a library!

If you're relying on the availability of 3rd-party libraries, then you have to just confine yourself to parts for which libraries are available. 

 

As you say, the Arduino libraries are open-source - so you could get the source, and port that to your STM32.

 

Or, perhaps, load STM32Duino onto your STM32:

https://www.stm32duino.com/

https://github.com/stm32duino

https://docs.arduino.cc/libraries/stm32duino-examples/ 

 


@No_Name wrote:

 I am new to stm32.


Start here:

https://community.st.com/t5/stm32-mcus-products/for-better-learning-stm32-programming-and-debugging/m-p/719485/highlight/true#M260696

https://community.st.com/t5/stm32-mcus-products/for-better-learning-stm32-programming-and-debugging/m-p/719468/highlight/true#M260690

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.

@Andrew Neil wrote:

@No_Name wrote:

I don't really understand how to read the datasheet and apply it like a timing diagram,


That is a basic skill


Where can I learn to read the datasheet properly? Is there a source for that?

Enrol on an electronics course?

 

https://www.egr.msu.edu/classes/ece480/capstone/read_datasheet.pdf

https://www.digikey.com/en/maker/tutorials/2024/how-to-read-and-understand-technical-datasheets

and many more via: https://www.google.com/search?q=how+to+read+a+datasheet

(other search engines are available)

A complex system that works is invariably found to have evolved from a simple system that worked.
A complex system designed from scratch never works and cannot be patched up to make it work.
bmckenney
Associate III

Microwire is a "cousin" to SPI, but it's rather different. Its main advantage is that -- while billed as a 4-wire protocol -- it's designed such that it can run over a 3-wire (shared MISO/MOSI) bus.

I'm not aware of any STM32 that supports Microwire, and I didn't see any tricks to make the SPI talk to this device. If your requirement is to use this particular device I expect you'll have to bit-bang it based on datasheet (Microchip document DS21795B) Tables 1-3/4 and Figures 2-7/8. 

----

ST sells a few Microwire EEPROMs (https://www.st.com/en/memories/standard-microwire-eeprom/documentation.html), but I don't see any sample code.

----

"Five minutes with Google" turned up this, though I suspect you'll have to add the GPIO part (I suppose it's in asm/ic/ssi.h):

https://github.com/themadinventor/u-boot-stm32/blob/master/drivers/mtd/mw_eeprom.c

Microwire implementations can vary quite a bit, so you should check the code against the datasheet Tables.