Wenn Du Atmel Studio benutzt:
File -> New -> ExampleProject
nach
AT45DBX DataFlashExample1 - XMEGA A3BU Explained
suchen.
Das ist ein Beispielprogramm für Dein Board, um den Flash-Chip zu benutzen.
Damit könntest Du zumindest feststellen, ob er in Ordnung ist.
int main(void) { uint16_t i; sysclk_init(); // Initialize the board. // The board-specific conf_board.h file contains the configuration of the board // initialization. board_init(); at45dbx_init(); // Prepare half a data flash sector to 0xAA for(i=0;i<AT45DBX_SECTOR_SIZE/2;i++) { ram_buf[i]=0xAA; } // And the remaining half to 0x55 for(;i<AT45DBX_SECTOR_SIZE;i++) { ram_buf[i]=0x55; } at45dbx_write_sector_open(TARGET_SECTOR); at45dbx_write_sector_from_ram(ram_buf); at45dbx_write_close(); // Read back this sector and compare to expected values at45dbx_read_sector_open(TARGET_SECTOR); at45dbx_read_sector_to_ram(ram_buf); at45dbx_read_close(); for(i=0;i<AT45DBX_SECTOR_SIZE/2;i++) { if (ram_buf[i]!=0xAA) { test_ko(); } } for(;i<AT45DBX_SECTOR_SIZE;i++) { if (ram_buf[i]!=0x55) { test_ko(); } } // Write one data flash sector to 0x00, 0x01 .... for(i=0;i<AT45DBX_SECTOR_SIZE;i++) { ram_buf[i]=i; } at45dbx_write_sector_open(TARGET_SECTOR); at45dbx_write_sector_from_ram(ram_buf); at45dbx_write_close(); // Read one data flash sector to ram at45dbx_read_sector_open(TARGET_SECTOR); at45dbx_read_sector_to_ram(ram_buf); at45dbx_read_close(); for(i=0;i<AT45DBX_SECTOR_SIZE;i++) { if ( ram_buf[i]!=(i%0x100) ) { test_ko(); } } [B] gpio_set_pin_low(DATA_FLASH_LED_EXAMPLE_1);[/B] while (1); }
Es gibt natürlich noch viele andere Möglichkeiten. Um nur eine zu erwähnen: hast Du mal in der Nähe gelötet?
Vielleicht ist etwas Lötzinn auf das Board gespritzt und schließt zwei Leiterbahnen kurz.
Ob das vielleicht der Grund für die Abkündigung ist?
Für was, weil der auf deinem Board möglicherweise kaputt ist?
Als Atmel noch Atmel war, haben sie die Dataflash Sparte an Adesto (http://www.adestotech.com) verkauft.
Adesto hat den 642 überarbeitet, der nennt sich nun AT45DB641E. Dieser ist nicht mehr hundertprozentig kompatibel zum alten 642, sollte aber nicht der Grund sein, warum er bei dir nicht antwortet.
Dirk
void SPI_Init(void) { DISPLAY_CONTROL_PORT.OUTSET = 1<<DISPLAY_SIGNAL_CS; DISPLAY_CONTROL_PORT.DIRSET = 1<<DISPLAY_SIGNAL_CS; // CS: Output, high DISPLAY_SPI_PORT.OUTSET = (1<<DISPLAY_SPI_MOSI) | (1<<DISPLAY_SPI_SCK); // MOSI, SCK: Output, high DISPLAY_SPI_PORT.DIRSET = (1<<DISPLAY_SPI_MOSI) | (1<<DISPLAY_SPI_SCK); DISPLAY_SPI_PORT.DIRCLR = 1<<DISPLAY_SPI_MISO; // MISO: Input, high impedance state DISPLAY_SPI_PORT.OUTCLR = 1<<DISPLAY_SPI_MISO; [B]DISPLAY_SPI_PORT.PIN2CTRL = PORT_OPC_WIREDANDPULL_gc;[/B] }
So auf die Schnelle hab ich in den beiden Datenblättern nichts gefunden, daß die ICs Open Collector SOs haben...Okaay..
Jetzt habe ich für MISO mal den PullUp aktiviert..
Auf einmal habe ich Signale die aussehen wie ein Rechteck. Waaahnsinn.
???Sehe ich das richtig, dass wenn ich dem Flash 0x00 sende, 0x53 zurück kommen müsste?