bianchi77
Advanced Member level 4
- Joined
- Jun 11, 2009
- Messages
- 1,313
- Helped
- 21
- Reputation
- 44
- Reaction score
- 20
- Trophy points
- 1,318
- Location
- California
- Activity points
- 9,442
Code:void AT25_WritePage(uint address, //from this address; uchar num_of_byte, //the number(<32) of bytes to write; uchar* source //data to write. ) { uchar i=0; /* Filter the parameters */ if(num_of_byte>32) num_of_byte=32; //if(address>4096) address=0; if(address>8192) address=0; /* make sure that the device is write enabled */ AT25320_CS=0; _nop_(); SPI_WriteByte(WREN); AT25320_CS=1; _nop_(); _nop_(); /* write op_code,address and data into the device */ AT25320_CS=0; _nop_(); SPI_WriteByte(WRITE); //op_code SPI_WriteByte((uchar)(address >>8)); SPI_WriteByte((uchar)(address)); for(i=0;i<num_of_byte;i++) { SPI_WriteByte(*source); source++; [COLOR="#FF0000"]DELAY SHOULD BE HERE[/COLOR] } AT25320_CS=1; }
Very valuable information, I will try now, I have tried at ISIS, it works, my question, how can I make VCC for WP and HOLD at 25AA640 ?
I'll let you know the result soon...
Thank you very much