Arduino Forum

Using Arduino => Storage => Topic started by: Eternyt on Nov 27, 2017, 09:31 pm

Title: Read and write W25Q64FV chip from winbond
Post by: Eternyt on Nov 27, 2017, 09:31 pm
Hi everybody,
I difficult question, but I ask it anyway hoping that someone has the right answer.
I have a Winbond W25Q64FV and I need to program it in some way. I tried using the CH341a programmer with the related software, but the software has not the right chip in the library so I used the most similar one, the Winbond W24Q64. But after pressing read (the chip is already programmed so it's not empty) and after some minute it still shows to me only FF. So I assume that the chip wasn't read correctly. How can I read, but more importantly write, on this little piece of silicon?This is the schematic I've used (DO is MISO and DI is MOSI) without adding the resistor and obviusly not attaching the wires on a parallel port but on my CH341 programmer:
(https://wiki.openwrt.org/lib/exe/fetch.php?w=350&h=300&tok=433615&media=http%3A%2F%2Ftastiere.altervista.org%2FTG582n%2FOpenwrt%2520installation%2Fschema.png)
Thank you!
Title: Re: Read and write W25Q64FV chip from winbond
Post by: chucktodd on Nov 28, 2017, 01:22 am
Why don't you connect it to an Arduino's SPI bus?

Chuck?
Title: Re: Read and write W25Q64FV chip from winbond
Post by: Eternyt on Nov 28, 2017, 02:56 pm
I thought it was just simpler with the ch341. How can I do that with the Arduino. And more important, I can do that on my specific chip?
Thanks!
Title: Re: Read and write W25Q64FV chip from winbond
Post by: chucktodd on Nov 30, 2017, 08:30 pm
I thought it was just simpler with the ch341. How can I do that with the Arduino. And more important, I can do that on my specific chip?
Thanks!
(https://s5.postimg.org/fl20i7t7b/SCH_23LC512.jpg)

The !SPI_RAM line just connects to an Arduino pin that you specify.  It is your CS pin.

use Marzogh library (https://forum.arduino.cc/index.php?topic=324009.msg3489807#msg3489807)

Chuck.
Title: Re: Read and write W25Q64FV chip from winbond
Post by: Eternyt on Dec 02, 2017, 05:18 pm
Thanks, but I'm still not able to connect to my chip.
I use this schematic for the voltage conversion from 5V to 3V (where I assume that the non _L pin stands for the Arduino pins, and the pins with the _L in the end are the chip pins):
(https://www.flashrom.org/images/c/ca/P2v1_resdivider.png)
And this for SPI references(where I assume CS = SS, SCK = CLK, MISO = DO, MOSI = DI):
(https://i.stack.imgur.com/QJx5X.jpg)
Then I just run the FlashDiagnostic example from the library you linked (without changing anything of the code) and it's no work at all.
What I'm doing wrong here? Thanks!
Title: Re: Read and write W25Q64FV chip from winbond
Post by: chucktodd on Dec 03, 2017, 06:28 am
Thanks, but I'm still not able to connect to my chip.
I use this schematic for the voltage conversion from 5V to 3V (where I assume that the non _L pin stands for the Arduino pins, and the pins with the _L in the end are the chip pins):

Then I just run the FlashDiagnostic example from the library you linked (without changing anything of the code) and it's no work at all.
What I'm doing wrong here? Thanks!
If you need to talk with a 3.3v SPI device a resistor divider is not recommended. 

Steve Marple (http://blog.stevemarple.co.uk/2011/10/interfacing-33v-devices-to-5v-arduinos.html)

Has a good discussion. Note the error That is listed in the comment section after the article.

I have used the 25Q64FVS but on custom boards. The TiBackup is a atMega328P running on 3.3v.
The Lifter is with a MEGA2560 running on 5.0v.

On both of these schematics, VDD is 3.3v and VCC is 5.0v

Chuck.
Title: Re: Read and write W25Q64FV chip from winbond
Post by: Eternyt on Dec 03, 2017, 12:12 pm
So I'm not able to interface to my chip because of the resistor dividers? So I don't understand why on the GitHub page of the library the Arduino UNO is completely supported...
What do you suggest to interface this chip? I see that the ESP8266 are supported, can I use my NodeMCU?
Also, I don't understand what the TiBackup and the Lifter (with relative schematics) are.
Many thanks!
Title: Re: Read and write W25Q64FV chip from winbond
Post by: chucktodd on Dec 04, 2017, 04:03 am
So I'm not able to interface to my chip because of the resistor dividers? So I don't understand why on the GitHub page of the library the Arduino UNO is completely supported...
What do you suggest to interface this chip? I see that the ESP8266 are supported, can I use my NodeMCU?
Also, I don't understand what the TiBackup and the Lifter (with relative schematics) are.
Many thanks!
Those schematic are examples of how I have successfully connected 25Q64 devices to Arduino Processors, the TiBackup show how a directly connect to a AVR processor running on 3.3v  The second schematic show how I interfaced the 3.3V 25Q64 to a 5V Arduino Mega.  The resistor divider circuit not recommended for SPI devices because of the high frequency (fast) signals.  The resistor's limit the current drive.  This limited current and the parasitic capacitance modify the signal waveforms.  Depending on the exact capacitance of your circuit you may not achieve reliable communications with the Flash chip.  The 10k resistor limits the maximum current to 0.5mA  as the voltage at the tap point increase this drive current is reduced.  Instead of a crisp 0V to 5V translations the Flash will see a distorted wave.  Read this example from Joonas Pihlagamaa (http://codeandlife.com/2012/04/06/level-shifting-101/) .

Chuck.
Title: Re: Read and write W25Q64FV chip from winbond
Post by: Eternyt on Dec 07, 2017, 06:56 pm
Thanks! Anyway, I just resolved my problem changing the values of my resistors: now they are 220ohm and 470ohm.