Forum: Mikrocontroller und Digitale Elektronik Problem beim Schreiben eines SPI EEPROM AT25080


von Stephan (Gast)


Lesenswert?

Hallo Leute,

das Lesen des EEProm AT25080 geht wunderbar. nur das Schreiben nicht.

folgenden Ablauf verwende ich.:

CS = Low
06h an EEProm senden
CS=High   ; ist notwendig um das Statusregister beschreiben zu können
            globaler Schreibschutz

CS=low
01h an EEProm senden  ; Write statusregister
0Eh an EEProm senden  ; Schreibschutz aufgehoben für alle Arrays
CS=High

CS=Low
02h an EEProm senden  ; EEProm schreiben
00h senden  ; Adresse High
00 h senden  ; Adresse low
16 Byte Daten senden
CS=High

jetzt sollte die interne Schreibroutine laufen.

zum Abfragen ob die Routine fertig ist mache ich folgendes:

CS=Low
05h senden
8 Bit einlesen
CS=High
test ob Bit0 = 1
wenn ja dann fertig
wenn nicht CS=Low , 05 senden etc.pp bis Bit0=1.

Es geht nur eben nicht. Wo ist mein Denkfehler ???

Danke

von Nur mal so (Gast)


Lesenswert?

>16 Byte Daten senden

vieleicht hier?

von Stephan (Gast)


Lesenswert?

"the at25080 is capable of a 32-byte page write operation"

von Stephan (Gast)


Lesenswert?

bei Atmel leider kein Codebeispiel, aber das hier im FAQ Bereech.:


What is the sequence in writing to the SPI devices?
Answer:   For writing to the Status Register:
Write enable Instruction (WREN) command, toggle CS, Write Status 
Register (WRSR) command.

For writing to the Memory:
Write Enable Instruction (WREN) command, toggle CS, WRITE command.


und das hier:


SPI: Write Operation:
Enable device via chip select low
Send write enable op code
Disable device via chip select high
Enable device via chip select low
Send write op code with address
Send data byte(s) for byte write or page write
Disable device via chip select high to start write cycle

Read Operation:
Enable device via chip select low
Send read op code with address
Receive data byte(s)
Disable device via chip select high

vielleicht hift es Euch mal

von Stephan (Gast)


Lesenswert?

Nachtrag:

das Wichtigste zuletzt. Ich "Richtiger" Hinweis im Datenblatt wäre 
wirklich schön gewesen. wer das nicht weis, sucht ewig !!

Question:    I replaced one of your competitor's SPI Serial EEPROM 
devices with a compatible Atmel SPI device and it does not appear to 
perform a Write operation correctly. What is the solution?

Answer:   There is one minor difference in the activation and 
deactivation of Chip Select (CS) for Atmel's SPI devices that you should 
be aware of. Our SPI devices require that CS must be activated and 
deactivated during the same clock idle state (clock rest state). This 
means that if your clock idle state is low (mode 0) as defined by 
Motorola, then any CS transitions must occur when the clock is low. If 
your clock idle state is high (mode 3), then any CS transitions must 
occur when clock is high. This is a very important CS convention that 
must be observed because our device will not initiate the internal write 
cycle if not observed. For more information, please see the device 
datasheet.

Bitte melde dich an um einen Beitrag zu schreiben. Anmeldung ist kostenlos und dauert nur eine Minute.
Bestehender Account
Schon ein Account bei Google/GoogleMail? Keine Anmeldung erforderlich!
Mit Google-Account einloggen
Noch kein Account? Hier anmelden.