Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

EPCS4 read/write using SPI

Status
Not open for further replies.

Deepak350

Member level 1
Joined
Jan 27, 2009
Messages
38
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Location
India
Activity points
1,550
epcs4

Hi,
I am interfacing ECPS4SI8N serial eeprom to 8 bit mcu. I have problems in reading and writing to the eeprom. Algorithm seems to be straight forward but it is not working. Can anyone give a proper working algorithm.
Thanks
 

epcs4 m25p40

w w w.sst.com/downloads/software_driver/SST25VF040B.txt
it's only program bytes and ID different
 

spi read back

Hi,
I have gone through the code and read and write has the same logic. I really cannot understand why the serial eeprom is not responding.
Thanks
 

spi_read c compiler

Hi

your inital setup might be wrong.
 

hcs08 spi read write

Hi,
Can you please tell me how to initialise the serial eeprom. I shall check with my code and see if its right.
 

spi read write

Hi,
Can someone help me out with EPCS4 serial eeprom. The eeprom is not responding to any of my commands. Can someone tell me the procedure to make it work, atleast read status register and write status register.

Thanks
 

eprom epcs4

Just a short, but functional test
Code:
setup_spi(SPI_MASTER | SPI_MODE_3 |SPI_CLK_DIV_1);
SPI_nCS = 0;
spi_read(0xAB); // Read ID
spi_read(0);
spi_read(0);
spi_read(0);
result=spi_read(0);
SPI_nCS = 1;
printf(_putc,"Serial Flash ID 0x%x\r\n",result); // 0x12

SPI_nCS = 0;
spi_read(0x05); // ReadStatus
result=spi_read(0);
SPI_nCS = 1;
printf(_putc,"Serial Flash Status 0x%x\r\n",result); // 0x00

SPI_nCS = 0;
spi_read(0x06); // WREN
SPI_nCS = 1;

SPI_nCS = 0;
spi_read(0x05); // ReadStatus
result=spi_read(0);
SPI_nCS = 1;
printf(_putc,"Serial Flash Status 0x%x\r\n",result); // 0x02
If this doesn't help in your case, as I suppose, you may want start to tell what you're actually doing.
 

epcs4 compatible

Hi,
I am doing the same thing what you have mentioned. I have tried all sorts of frequencies for the SPI. It just returns 255.
SPI module:
MOSI, SCK and CS is all output and MISO is input and pulled up.

EPCS4:
Pin 1 is CS
Pin 2 DATA (to the MCU)
Pin 3, 7 and 8 VCC
Pin 4 GND
Pin 5 ASDI
Pin 6 SCK

Is there any delay required?
I have tried to find application notes for this serial eeprom. But not finding any.

Thanks
 

problems writing to m25p40

I'm running the part at 8 MHz without any delay, it can be used at higher clock frequencies, if needed.

Obviously, I can't know what you're doing wrong respectively what's wrong with your circuit. EPCS4 is fully compatible to industry standard serial flash, e.g. ST M25P40, you can use their application notes and code examples as a reference.
 

spi_read

Hi,

Nothing is working on this EPCS4. I dont even know if the EPCS4 is powering up. Is there any way to check that? It should respond for reading the silicon ID atleast.

Thanks
 

spi read write code

Hi,
My code looks like this

byte read(int eeprom_addr)
{
int data;
CS = 0;
spi_send(READ);
spi_send((char)(addr &0xFFFFFF)>>16);
spi_send((char)(addr &0xFFFF)>>8);
spi_send((char)(addr &0xFF);
result = spi_send(0xFF);
CS= 1;
return restult;
}

fill_buffer(void){
int j;
for(j=0;j<16;j++){
buffer[j] = 5;
}
}

main(){
delay(10);
fill_buffer();
CS=0;
spi_send(WREN);
cs = 1;
delay(100);
cs = 0;
spi_send(WRITE);
addr = 0;
spi_send((char)(addr &0xFFFFFF)>>16);
spi_send((char)(addr &0xFFFF)>>8);
spi_send((char)(addr &0xFF);
for(i = 0; i <16; i++){
spi_send(buffer);
}
cs = 1;
delay(5000);
for(i = 0; i<16;i++){
eeprom_output[1] = read(addr);
addr++;
if(addr == 16)
addr = 0;
delay(100);
}


Please check if this is correct. Is there anyother way to write and read.

Thanks
 

spi_read(0)

Seems basically correct, however the SPI setup must be correct, too.
 

asdi spi

Hi,
This is my SPI setup.

Spi_init(){
SPI1C2 = 0x00;
SPI1BR = 0x01;
(void)(SPI1S ==0);
SPI1C1 = 0x5C;
}

I have changed the SPI1C1 to operate spi in different modes (CPOL and CPHA bits).

But nothing seems to work.

Thanks
 

spi(0) to read and for write

You may want to mention the processor and C-compiler.

P.S.: Seems to be a HC08 or similar. As far as I see, the SPI setting are correct. You should search for a way to debug the operation of your hardware, e.g. with a multichannel DSO or a LA.
 

spi read/write

Hi,
Yeah Im using a HCS08 processor.

Can you please tell me more about Multichannel DSO and LA, Im not aware of them.

Thanks
 

epcs4 standard flash

Well, I simply mean any instrument, that can be used to record the waveforms at the memory device, at least for two pins simultaneously. So that you are able to verify, that all pins are driven according to the specification in consecutive measurements.

If you have also connected an A_ltera FPGA, you may try SignalTap II as a logic analyzer replacement.
 

spi flash writing and reading code

Hi,

I have checked the output waveforms. Whatever Im sending is being displayed. But on the data output line from EPCS4 value is always high.

Thanks
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top