Working with the AT91SAM9260 controller from atmel, I get a lot of errors when I try to program the NOR flash AT49BV160 which is connected at NSC0.
The problem is, that I have no communication at NRD, NRW0 and NCS0, when I try to program the flash or turn on the power of this board (BMS pin is high during the reset).
During the programming via the jtag interface I get a lot of errors (validation failed). Erase and programming was successfull (said uvision).
Maybe someone of you working with this controller, could show me the right commands / settings (especially to configurate this flash).
thank you in advance - best regards
Stefan
- do you have flash connected in 16-bit bus?
_WDWORD(0xFFFFEC0C,0x00021003);
this is the mode register for the SMC controller (NCS0), where I selected 16bit databus mode, write operation controlled by NWE, read operation controlled by NRD, NWAIT disabled, TDF data float time = 2, standard read, page mode not enableda and TDF optimization disabled.
If answers to previous questions are yes can you then try this for
yes, the connections are correct (and as you described it in your last message).
int EraseSector (unsigned long adr) { // Start Erase Sector Command M16(adr) = 0x20; M16(adr) = 0xD0; return (Polling(adr)); }
It's still the same problem -> no activity on NWE and the databus (0x20 and 0xD0), when I try to erase the chip. There's only a activity at NCS0, the addressbus and NRD. All control signals (NWE, NCS0 and NRD), as well as all address lines are connected direct to the memory.
I have installed two bidirectional transceivers for the whole databus (between the controller and the flash memory). OE (transceiver) is always low active when the sdram (which is not connected at the moment) won't be active (-> so it's always low which is correct). And NRD is connected to control the T/R (transmit / receive) pin. If NRD is low then the information goes from the memory to the controller.
www.fairchildsemi.com/.../74LVTH245.pdf
That's my hardware wiring.
best regards Stefan
Hi Stefan,
can you try in initialization:
_WDWORD(0xFFFFEC00,0x3F3F3F3F); _WDWORD(0xFFFFEC04,0x7F7F7F7F); _WDWORD(0xFFFFEC08,0x01FF01FF); _WDWORD(0xFFFFEC0C,0x000F1103);
Did you see anything on NWR or NRD?
Best regards, Milorad
When I try this configuration, then I see nothing on NRD, NCS0 and NWE... No signal at all.
That setting I gave you should have setup communication for longest times and should have worked.
Can you try another microcontroller (new chip)?
I would suggest that you contact Atmel support directly and ask them for help about how to configure SMC for NOR Flash.
thanks for your help. I will contact the support from atmel.
By the way, when I try to erase the flash, I see an activity at the SDCS pin (NCS1 chip select configurated for the sdram)? And I don't program the sdram in the init-file. The same occurs when I use another NCS-pin.
At the moment there's no sdram chip on the board.
I changed the controller and know I am able to see some activity on all relative pins (WE, NRD and so on).
The problem now is, that NRD, WE or CE pin goes only low at the beginning of each page; but within a page there's still no activity. From this it follows that'I have only at the addr - and data lines activity within each page. So a lot of the data, the controller sends to the flash, can't be stored in the flash because the CS and WE lines are both high.
Dataline: |||||||||||| (activity) CS: | | | NRD: | | |
what did Atmel support tell you? Did you get any help from them?
If you want to read/write from the chip, you must know the SPI protocol, that's it.
However, If you want to make it compatible with windows (linux, etc..) you must adhere to the FAT format which is very complex. You can either spend two years learning it, or you can use off the shelf chips that contain the fat stack.
Alfat is one of several companies that create a system where you communicate using DOS-like commands and UART to write the code and the chip handles the FAT.
While reuse of existing code is good, it is wrong to say that FAT is very complex. It is actually very, very simple, so we are not talking about any two years to learn, as long as support for long file names are ignored.
Without long file names, it is probably possible to implement FAT in two days.
On the other hand, almost no FAT implementation available have support for long file names. The code used by Linux may be the only free code in existence for long file names.
Hi Milorad,
atmel send me a configuration example for the registers which should work - but their timing is very fast (maybe normal) and so there's no activity at the pins like WE. I'm only able to read out the product ID from the flash, when I use a extrem slow configuration (long timings) but, I'm not able to read out for example the CFI ID.
At the moment I'm in the dark.
The difference between the longest and shortest trace is only 40mm - (which is round about 0.25ns). It's very strange.
I would then suggest to you:
- try another chip, perhaps that one is damaged - try to arrange with Atmel to send them your board so they try to get controller working - ask Atmel if they have any development board using SAM926x chip with NOR Flash, so you could try on original Atmel development board and look at the signals - choose another non-volatile memory like SPI Dataflash or something similar with SDRAM